Ask HN: Which complied language to learn?
Hi,
I'm a programmer who is fairly well versed with interpreted / dynamic languages (Python, JS, ruby). I've started revisiting my algorithms course and felt the need to implement the algos in a complied language. I vaguely know Java to the point of not knowing it at all. So my question is - which of 2 languages ( Java/C++ ) should I learn. Considerations in order of priority -
1. Ease of learning (minimum amount of time required to be productive for someone coming from py/rb/js)
2. Free online resources to learn
3. Powerful standard library so that I can use heaps, lists and dicts as easily as I do in Python
4. Performance
5. Should not require need an IDE to be productive (I love Vim)
6. Market Demand
Thanks a lot!
(
11 comments
| 4 points
| on HN
)
Not that it's that much better in Java, where most tutorials leave you wallowing through outdated or complicated features, especially if you're restricted to an older standard and no non-JDK libraries (like Guice, Apache Commons etc.).
The Google C++ class is short and succinct, and could be a good start, although I would recommend reading up on C++11 features as soon as possible after finishing that.
http://code.google.com/edu/languages/cpp/basics/
http://www.stroustrup.com/C++11FAQ.html http://en.cppreference.com/w/ http://msdn.microsoft.com/en-us/library/vstudio/hh567368.asp...
For Java, the official Sun, erm, Oracle tutorials are decent enough, especially if it isn't your first language:
http://docs.oracle.com/javase/tutorial/
2: If you want to learn modern idiomatic C++11, then there aren't many online resources out yet, but it's getting better fast.
3: a tie
4: C++, but for many 'normal' use cases it's not too big a difference
5: C++
6: Depends entirely what you want to do. Java is pretty ubiquitous in large companies and for writing enterprise system. C++ is more of a niche language these days, used in areas like 3d-engines, high-speed simulations, low-latency systems and other areas where performance is paramount.
With all that said, personally I'd learn C as well. Calling C from most dynamic languages is pretty easy (certainly easier than calling C++ or Java) and the combination of the productivity of your dynamic language of choice plus the speed of C when needed is a very powerful one.
But, as others have pointed, very easy to make mistakes
You love VIM, that's great. But do you hate IDEs? if the answer is no, I recommend trying it...
Thanks
[1] - http://learnpythonthehardway.org/
This is a bit off topic but I'm in a similar situation and wanted to know if anyone had any thoughts on Go. It seems to strike a balance on everything except for current market demand (which could change going forward).