Hacker News new | comments | show | ask | jobs | submit login
Ask HN: Which complied language to learn?
4 points by krat0sprakhar 1080 days ago | 11 comments

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!

I think you're split pretty evenly between Java and C++ given your requirements. Although it would tend more towards C++ if you could find a decent introduction that starts out with C++11, which I'm not aware of right now (standard is pretty new). If you're going with "old" C++ and then just add the new bits in the end, you're wasting a lot of time (as would be the case if you're going C -> C with Classes -> Generic Programming -> "Modern C++").

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://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:



1: Probably Java. C++11 makes many things related to pointers and memory management easier, but there are still lots of corner cases that will bite you.

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.


I would recommend C. It will give you a better understanding of the concepts of programming. Gives you more control over what you can do.

But, as others have pointed, very easy to make mistakes


I almost said Java because it fits most requirements perfectly, but requirement no. 5 makes it much harder to recommend it over C++. I think that developing in Java without an IDE can be a pain...

You love VIM, that's great. But do you hate IDEs? if the answer is no, I recommend trying it...


Is there something like LPHTW[1] for Java? I've owned a book called "Core Java by Horstmann" and the sheer size of the book is scary. Can you suggest some good resources that can I get up to speed with?


[1] - http://learnpythonthehardway.org/


I don't know about online tutorials, but I do recommend the book Head First Java


I would suggest C followed by C++ (for the STL and other library). I think every programmer should learn C/C++ at some point. Don't ask me for reasons for thinking so. Just a feeling.


What about Go? http://golang.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).


For learning basic algorithms I would say C, but given your requirements, I think C++ fits the bill.


I'll put my vote in for Java mainly because along with Objective-C it's where I do most of my work so there's clearly (at least some) market demand for it.


not a fan of each those, but Java. I think it is easier to learn and especially as you come from python you will know how to avoid common misunderstandings. If you learn java, please, please, please don't learn from "thinking in java". This is one of the books with huge influence which is totally wrong in 99% of the times.


Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact