Okay, so lots of bloggers answering this question with joke/parody languages like Whitespace and Brainfuck. Yes, those are "hard", but they're designed to be hard (if not impossible) to use.
Talking about actual languages intended for real-world production use: it depends. Let me lay out some broad categories:
- Languages that are extremely low-level
Examples: Assembler/machine language. Really old "high-level" languages like FORTRAN or COBOL or C.
In some sense these are "easy" - you just tell the computer what to do, one instruction at a time! But you have to tell it what to do in fine detail - extremely fine, in the case of assembler. They were also all developed before graphics and audio processing were commonplace, so anything beyond simple text input/output is extremely complicated. This makes it very difficult for inexperienced programmers to write large, useful programs.
- Languages that make you think differently
Examples: LISP/Scheme and other purely functional languages. PROLOG and other logic programming languages. Some more specialized low-level languages like FORTRAN.
These all make you formulate your program in a very particular way.
LISP and related languages are very simple - there are only a handful of operators. But wrapping your head around doing everything recursively and functionally can be extremely difficult. Writing programs that are inherently stateful in a functional language can be extremely awkward.
In logic programming, rather than giving the computer instructions on what to do, you write first-order logic rules, feed in data, and then perform queries that are evaluated on the data with the rules you specified. Very flexible, and in some cases (like certain types of language parsing and generation) it's much simpler than imperative code. But figuring out how to model a problem in that way can be very hard.
Specialized languages like FORTRAN are usually very good at some things (in this case, high-performance math), but everything else is usually hard. If you're not an expert in that area or not using it for that purpose, it would not be a good language choice.
- Languages with poorly-defined structure and rules
Examples: Assembler, BASIC, Perl, PHP.
These are languages that provide little or no guidance of how code should be written and structured. Often there is no or limited scoping/encapsulation, multiple ways to mess with flow of control, and few pesky "rules" like strong variable typing. (Or any concept of "variables" at all, in the case of assembler.) Perl and PHP also suffer from frequently having many ways to accomplish the same thing. While in some sense this is "easy" - you can just flexibly do whatever comes to mind at the time while writing code - it makes maintenance of nontrivial programs a nightmare.
- Languages with a lot of rules and features
Examples: C/C++ (standard libraries in particular), Java, C#, (many others - even an "easy" language like Python has a lot of bells and whistles in its libraries.)
These are languages where there's a steep learning curve to do anything useful, or to understand most existing code. For example, it's hard to do much real work in C++/Java/C# without an understanding of both OOP and their generic container libraries. C/C++ requires dealing with pointers and manual memory allocation. Those are complex subjects in their own right.
Which language(s) are going to be the hardest for a particular person to learn and use will vary from person to person. Some people find functional programming intuitive, while others have a hard time understanding it at all. Some people find it easier to understand what's going on in a program when the language forces you to write everything out explicitly, while others get bogged down in the details. Some people love flexibility, while others value consistency.
Most languages are also very good at some tasks and mediocre or terrible for others - using the right tool for the job makes a big difference. And while some older languages are largely obsolete these days, (almost) any language that came into widespread use did something better than other existing languages. At least at the time it was developed...
Comments
Post a Comment