Ask HN: What makes a programming language 'hard'?
Some programming languages seem easier to learn than others. I've often heard people (myself even) saying, "I choose [language] because it was easier than [language]."
What do you feel makes a language easier or harder to use?
It it primarily a documentation issue? Are lower level languages more difficult than higher level languages by their nature? Is it a syntax issue? Or are some languages just harder than others?
my programming background: I only work currently in Ruby. I did some C/C++ in high school, but I hit a brick wall after a point. I wish my teacher had required the k&r book. After high school I tried perl and cgi stuff for web work, but it was too confusing to me at the time. I picked up Ruby about 18 months ago very quickly, starting with _why's (poignant) Guide to Ruby. I had never seen documentation so clear.
9 comments
[ 22.7 ms ] story [ 2014 ms ] threadBut I think documentation (books, available source code, tutorials) is the biggest issue. Finding a practical PHP or Ruby tutorial is way easier than a Scala or LISP one. I'm the kind of person who learns by reading other people's code, so I've never been interested in the more obscure languages because of that.
And how you see a problem is strongly influenced by prior programming language experience.
You often need to determine if a language will become easier for you once your mind groks how it represents problems, and if, in the long run, the effort to reach this comprehension is worth it.
The tricky thing is determining if a language will become easier once you reach that Ah Ha! moment, or if it is intrinsically hard (for whatever reason; typically poor design).
But some of the languages I've seen just have me shaking my head. Hardly anything about them are logical.
I know Ruby and Perl as supposed to be close, but when I look at your average Perl script, I just get confused instantly. Ruby of course I get. Yet when I try to read Python (which doesn't have a direct heritage), I quickly get what's happening.
Python:
sort(my_list, key=my_instance.sort)
C++/Boost:
sorry, I had only had 2 hours and couldn't work it out (it's 10 years since I did any real C++).
Hadn't used it in, well, forever, but have done something similar. Pretty much stolen straight off of http://live.boost.org/doc/libs/1_34_1/libs/bind/mem_fn.html . For non-boost solution: http://www.cplusplus.com/reference/std/functional/mem_fun/
On top of the task-driven reasons, I think the other big reason people find languages easier/harder than others is really a sort of emotional connection. The number of Ruby docs that use the word "joy" or something close speaks to this. Similarly, the people who have emotional responses both for and against Python's syntax and white space might speak to it.
How well the language fits brain (which mostly reduces to how similar it is to other languages you're used to; think imperative versus functional programming).
The ease or difficulty of recovering from an error (C++'s error messages that involve STL templates are notorious for being incomprehensible, but I'm also thinking about things like mysterious crashes you can get if you make a memory-management error at an unrelated point earlier during program execution).
I don't think documentation is a significant issue. It's more important for learning a language than for using it. Once you know a language you'll be able to use it without having to refer to the documentation.