I will go ahead and disagree with the majority of answers here:
- Choice of languages matter a lot!
- Caveat: except for personal projects and toys.
- Java is hands down better than Python.
- Caveat 1: Java’s advantages (will explain later) increase with difficulty of the requirements, so toy websites are indeed easier to do in Python. However, in that case, writing a static generator (in Python) is probably easiest.
- Caveat 2: There are specific cases where Python is better. If you are (or member of a teams who are) one of these Python wizards, well….. Plus, very simple, straight-forward websites can be done easier with Python. However, in about 90% of the time, Java wins.
Let me go over the points one at a time.
I) It is important to choose correct language
Let me share with you 2 anecdotes:
- At work, I have seen a variety of languages employed. Without fail, Java (or C#, or one of those “serious programming languages”) projects are the best written, with the highest code coverage, with the most stability. Without fail. Ruby looks good until the 3rd person starts to work on the same project. Don’t get me started on LISP (can be very nice, but extremely hard to get it correctly).
- Within the last 4 years, my most enjoyable programming experience involves (re-)implementation of a bunch of machine learning algorithms in Scheme. I felt so alive after the weekend of dreaming up beautiful structures.
My point is, the language choice dictates much much more than we give credit for. To be 150% fair, the features of the language itself generally speaking are not the only deciding factor. However, the mere presence of a language tends to make or break code quality.
In conclusion:
- Business-wise: choosing the right language usually save time, money, and a lot of trouble.
- Personal-wise:
- Right language makes your time much more enjoyable.
- New & correct language reforms your brain and optimizes it.
Therefore, choose wisely!
II) Java wins, hands down
Here are the advantages of Java:
- Professionalism (probably more relevant in business setting)
Using Java (& other “professional languages” like C#) feels similar to going to the library or wearing a pressed shirt. When you are in the library, no one forces you to read books or be prim and proper, but the feel of the place makes you want to do the above. Similarly, when I wear a pressed shirt, I can slouch; the shirt would rub against my back and shoulders, reminding me that it would much prefer to stay in shape.
Java gives off such feeling. It feels so boring, so unexciting that hacks and clever tricks look stupidly out of place. It makes you want to write the kind of code that would fade in the background, but would rarely cause issues. Interestingly enough, this is the best kind of code.
This way, code in Java tends to gravitate away from downright terrible. At worse, they look boring and tedious. However, I would take boring and tedious over crazy jackshit any day of the week.
- Availability of Expertise:
No one should be surprised if Java has the most expertise around. This in term of available developers as well as available code snippets to learn from. Given that we usually learn by examples, these resources and expertise are invaluable.
Furthermore, Java tends not to inspire holy war and works extremely hard to avoid opinions. Python, perl, Ruby, LISP (actually, each different flavors of LISP), Haskell, etc. have very strong and colorful characters. Java does not have such personality. Which may make it boring, but, again, only rarely do holy wars break out over Java. This tends to allow programmers to work together and learn from each other much better.
- Tooling:
You can argue until your face is blue, but one thing is certain: as a programming language, Java has the best tooling. It has at least 3 outstanding IDEs (Eclipse, Netbeans, and IntelliJ), along with mirage of smaller systems. Each of these, then, have lots of plug-ins, which pretty much cover just about any situations you can find yourself in.
- Type system: OOP and static
OOP excels in description of a system. It’s very good at saying “what”. Procedural and functional are better at saying “how,” but OOP describes “what” much better. This makes OOP describes long-running systems better. Functional & procedural talking about 1 task, which, but definition, has a start and an end. OOP talks about system description, which has neither start nor end.
As such OOP describes website well. A website has neither start nor end. It just is, responding to users’ requests. It fits very well with OOP. And Java is OOP. Not the most OOP, mind you, but it is OO enough to make things pleasant. It’s certainly more OO than Python.
Java is also statically typed, which is such a pleasant things to work with. Especially for larger systems that have tight coupling with its infrastructure (eg. your website!). Since the types a known at compiled (read: coding) time, your IDE can chase down all references and help you deciding what needs to go where. Python’s (or perl’s and Scheme’s; the other 2 are among my favorites) type system gets extremely hard to deal with as the size of the project increases.
Note that this is more than mere “bug prevention.” It’s more pleasant to code in, too! Types usually describe the intention of the functions. Plus, you can easily navigate to declarations and implementations of whatever you need, which makes coding so much easier.
- JVM platform: stability in presence & future proof
Python as a platform sucks compared to JVM. Frankly, anything-as-a-platform (except maybe Linux or unix) pales in comparison to JVM. Even .NET is not quite 100% JVM.
See, JVM offers you roughly 2 major advantages.
First, it highly prioritizes backward-compatibility. Only extremely rarely do you have issue with upgrading JVM. This reflects both advantages in compiling down to simpler system (bytecodes are easier to maintain backward-compatibility than fullblown languages) and priorities of Java as a project and community.
Secondly, it supports myriad of other languages. You can have Scala, Groovy, Scheme (Kawa, thou art my love), etc. run side-by-side! Doing the same thing in Python requires a lot of finesse, if possible at all, and a lot of risk and performance penalty. Thus, when you choose Java, you are not locked out of other paradigm that Java as a language does not support well. When you choose Python, you’d better be sure that you are really into Python.
- Performance: Without further elaboration, JVM is faster than Python. End of discussion.
- Libraries and support:
Due to its longevity and status, Java enjoys enormous sets of 3rd party libraries. Its libraries are also much better support and written, compared to CPAN and Python’s repo.
Java also enjoys supports on many more platforms: AWS Lambda to Google cloud to plain Linux.
- Economics:
One point to make clear: if you like to have fun, Python may be a good language (but how fun in Python? You can also have fun with Javascript and LISP and Haskell and perl). However, economically speaking, Java enjoys much more powerful network effects.
More job posting is in Java. Reversely, more qualified candidates can work in Java. Better yet, due to Java nature (see above about holy wars), Java can be picked up much faster. Due to its conservative attitude, newbies in Java will pose smaller risks.
Conclusion: do it in Java. Stay away from Python. Pythons are good for decoration and roasting (and scaring your siblings :P). I don’t find it to be a good computer tool.