It's just useful for different things. Java is definitely more verbose and has more boilerplate to write, but it's also stricter than Python and is a semi-compiled language, which means that it sometimes catches errors more quickly. It also forces you into an object oriented structure, which tends to encourage you to design your programs better rather than jamming a big list of functions into a single file.
I also find they have strengths in different kinds of applications. I tend to prefer Java for writing games (pygame isn't great), python for doing numerical analysis work (numpy and matplotlib are pretty great), and Fortran, C, or C++ for the big parallel numerical simulations.
With Python, the source code is interpreted line-by-line into the "Python VM" bytecode and then executed.
Comparatively, Java source code is translated into JVM bytecode, and then when it's actually run on the JVM (which is a JIT compiler/interpreter) that bytecode is optimised into native instructions on the fly.
199
u/mistaekNot Jan 05 '18
Isn’t java “harder” than python