Originally Posted by xsabrewulf
Which programming language is the most popular and the best one to learn?
I have NO experience in programming and I don't care if the language is hard to learn I have time.
I am debating between JAVA or C++
I just dont want to learn a dying language that will be dead in 10 years
This question seems like your chasing fads, like most other people are doing. Don't worry, I have succumbed to this before. In my opinion, it's irrelevant whether a given language is alive or dead 10 years ago. A computer programmer with a good experience and judgement should eventually come to understand the paradigms that _transcend_ a specific programming language implementation. Once you have learned important _paradigms_ in computer programming as well as one or two programming languages to go along, picking up a new programming language will be very easy. So don't worry if the language will be relevant 10 years from now, worry about higher knowledge that you obtain from learning a programming language.
C++ is a terrible first programming language. This is one of the few programming languages that takes maybe not months, but years to master. Rigid static system, manual memory allocation (unless you use some abstract containers, STL, classes, etc), a class system with too many bells and whistles, etc. Its primary use these days in developing heavy weight applications, where performance is so important that you're willing to swallow up all the pain associated with coding in C++/C: operating system kernels, virtual machines, 3D games, software for embedded hardware, web server and other fundamental service software, numerical number crunching stuff, etc. Most of enterprise software developers will not touch C++ with a 10 foot pole. Most casual programmers will not touch it with a 10 foot pole, etc. Not that I mean to discourage you. C++ can teach you a lot. If you want to be a well rounded programmer, learn it, but it's hardly a good first programming language. Also, a lot of C++ books really sweep under the rug the C programming, just like a lot of pure C programmers discount C++ as "just C with classes". Both are wrong.
It may also be beneficial to get a good understanding of C first, but C itself is a can of worms, but it's a lot more manageable one. A well rounded programmer should probably understand C as this language runs as close to hardware as it gets, before starting to code in assembly language, even if you never actually use it. Another great reason to learn C, it has no objects! Point. I think it's great to be forced at least once to code in pure procedural style, so you can learn to judge for yourself when it makes sense to write a class and when it makes sense to simply write a functions. Far too many people who grew up with Java and the like can't figure out how to pick a mouse off the ground without creating an object.
Now, Java is basically like C++, but with a lot nastiness removed, a lot of "bells n whistles" removed to keep things simple. Memory management is automatic. LOTs of libraries. So overall, JAVA is cleaner than C++, but it's not as close to hardware as C or C++, it runs on a virtual machine, so its normally slower than well written C++ or C code. Nonetheless, JAVA is still very verbose to program in. Just consider a static type system.
My pick? Learn Python. Look at three excellent _free_ books online. First is called "Dive into Python". The second is the official Python Tutorial on python web site. The third, the Python version of SICP (an influential computer science book that uses a lisp dialect) rewritten to use Python at UC Berkeley (SEE HERE
). For that matter, if you're interested in programming _paradigms_, the SICP is the best book of the three. This is what Berkeley teaches as its freshman CS course. In fact, it may be also worth to take a look at the original MIT SICP book ONLINE
, which uses Scheme, a Lisp dialect (somewhat more difficult reading, may need to know math at the level of basic calculus).
So, why Python over C++ or Java? It's designed with simplicity in mind. Fully dynamic type system that allows creating and processing complex data structures in no time, huge libraries, and did I already mention extremely simple syntax? I have worked my way recently through all of the three books I mentioned, and lo and behold, I am really impressed. I have spent some time learning and coding in Perl, C, C++, Lisp dialects, and several numerical languages (R, Matlab, etc) and it is refreshing to learn something like Python after all that. Python sets a new standard in simplicity and readability. And you can do a lot in Python, very fast. Web applications, numerical applications (with scipy), and many other things.
So I am kind of puzzled at the vote above for "Python or C++". These are not even close. The difference between them is like a swiss army knife vs an industrial meat grinder.
To see where I am coming from, take a look at this discussion:
Simply compare the clean Python snippet at the top and then look at the proposed "Perl solutions". I kind of cringed when I saw that, and I used to think Perl is nice. And then I realized that I myself succumbed to peer pressure years ago to learn Perl. Don't make that mistake. Learn Python.
Having said that, if I were to choose between C++ and Java, I'd recommend Java first. I wouldn't want to be bogged down in endless discussions of l-value and r-value semantics, move and copy constructors, and all that cruft that comes with C++ on my first brush with programming.
C# is also supposed to be kind of nice, may be better than Java, but I always discounted it as a "Microsoft technology" (despite existence of Mono). I do think Java will remain a big player for some time, if only because we're now seeing an explosion of new programming languages running on top of Java virtual machine: Jython (Python for JVM), Scala (an improved version of Java), and Clojure (a Lisp dialect), and all of these are very popular. Obviously, knowing Java classes will make you more productive with these languages (all of them can access java classes).Edited by ZAKOH - 1/25/13 at 2:45am