Java is a wonderful tool for a LOT of systems programming. It's got a nice object model, automatic memory management, and pretty good execution speed. Given the choice between C++ and Java, I'll take Java every time. Remember, Java was originally designed for embedded systems like set-top boxes. It's still one of the best languages out there for those kinds of applications.
It's not a good fit for UI or web work, but neither is C/C++. As always, consider the type of job before selecting a tool.
That's so true. Java is a great general purpose language but it so terribly verbose when you're trying to do string heavy or database work. The web is both.
One thing though, compared to several years ago the speed penalty has all but disappeared, it's fast enough to build some pretty impressive stuff with it.
I do not agree that Java is all that great. I classify it as "ok". I don't disparage "ok" but there were languages before Java that were better than "ok". Java isn't and never was a revolution, it picks from various things that came before and in some places make incremental improvement.
During the early days of J2EE I built an app framework that ended up being about 300,000 lines of Java, we had to replace most of the core JDK classes as well due to their poor design. What we ended up with was enterprise quality but far more accessible than the J2EE equivalents. Prior to this app framework, I built essentially the same thing in Smalltalk. The Smalltalk version was much fewer lines of code, easier to maintain, easier for the end-user. And so far as Java performs great, yes it does. One key reason is the hotspot and jit stuff which were directly taken from the Smalltalk world.
btw, when I'm playing up Smalltalk here, I know its hard for newcomers to see the value as Squeak is "hard to take" compared to what we had in the early 90s.
[EDIT] one thing I do like about Java is it forces the programmer to think more formally about an object's interface. This is a good skill to learn and can be applied to other languages. The loose way some play with duck typing is a little much for my tastes.
Quite frankly I think Java is actually _very_ good for web programming. IFF you are using the Spring framework(autowiring and transaction handling are very strong components of this framework) along with some nice templating frameworks (tiles, sitemesh)
I absolutely love the Spring (MVC) framework and this is probably why I hold java in high regard.
Says who? Ignoring the fact that LoC is a terrible metric for measuring anything except the amount of paper it would require to print the program, I think it would be very hard to use it to quantify how much you will accomplish. Your (implied) assertion that you will not just accomplish less, but accomplish between a half and a fifth as much in Java as in Python is even more outlandish. I can't imagine you have any evidence to support this?
> Stay away from Java; everything is too damned complicated
What is this supposed to mean? That the hundreds of thousands of people who make their livings from doing web development with Java and being competent Java programmers are either stupid (for not programming in Python), or super-smart (because they can grok Java)? This is pretty absurd. Java is no better and no worse than pretty much any other language in wide-spread use. To its benefit, it has extensive library support for pretty much everything under the sun, and all the enterprise features which would make it relatively painless to do a whole heap of things that would become very difficult in almost any other language.
Really, I think you should refrain from giving advice on specific programming languages if you are just going to resort to complete and utter nonsense to provide comparisons.
Here is a study of how lines of code produced annually differs across languages in a collection of open-source projects: http://sequoia.cs.byu.edu/files/pubs/Delorey2007.pdf
Of course, the correlation between lines of code and "productivity" is pretty nebulous. (Copy-and-paste programming is the most obvious example of a negative correlation.) LoC is an easy thing to measure, but not necessarily useful.
Python is generally considered to be 2 or 3 times as expressive as Java. I did some estimation on a compiler implementation in C++ and arrived at the conclusion that it could have been done in 20% as much Python.
(FWIW, OCaml is probably a better language for compiler writing. It hits all its strengths. Failing that, I'd still rather do one in Python or Lua than C, though.)
I didn't say anything about the intelligence of Java programmers. Like everywhere else some are brilliant and some are dumb as hammers. When I said "everything is too damned complicated", I was thinking of Java Web development which has a proliferation of one-size-fits-all frameworks which encourage bloated implementations. It could be that I have blundered into a tiny swamp and everywhere else is sweetness and light, but I dont think so.
For example, I would much rather maintain a Java-based web application than a PHP-based web application.
Take a look at the standard libraries and third party packages. If someone else has written it, you dont have to, unless you want the experience. Python, Java, and Perl have lots. Ruby and IO less so.
Look at job listings. If you are starting out, you might as well pick on that you can get money for.
Look at the communities. Are the people ones that you would like to hang around with. If they dont like newbies, look elsewhere. Python seems to be pretty good in that respect.
As for web development, Python has Django (I recommend) and Pylons. Ruby has Rails. Stay away from Java; everything is too damned complicated, but there are a lot of jobs.