Why is Java so "unpopular"?
I've been taking computer science since the beginning of the school year, and we program in Java. Many people in the class claim that Java is crap and get upset that we program in Java and not some other programming language.
But Java is the most widely used programming language in the world, isn't it? So why not Java? I think it's good that we program with Java.
Where does this hatred towards Java come from and is it justified?
Frag sie doch, warum sie Java schlecht finden.
Eigentlich alle heutigen Java-Umgebungen legen neue Projekte soweit an, dass die leere main()-Methode direkt erscheint, wo die Programmausführung beginnt.
Dort kann man direkt loslegen.
Naja ihr Argument ist, dass Java zu alt, also “outdated” und zu viel zu langsam sei.
Dies stimmt aber kein bisschen in meinen Augen.
Java ist brandaktuell.
There are probably fewer cool YouTube videos about it and you would have to really delve into the subject matter.
Also zu meiner Zeit war das extrem langsam. Keine Ahnung wie das jetzt ist.
Bei Java geht halt hauptsächlich kompatibel mit allem … nicht unbedingt Leistungsfähig wie sonst nichts.
An der Performance liegt es sicherlich nicht. Python ist gerade beliebt, das ist noch langsamer.
Das einzige was langsam ist, sind die Rechner in der Schule
Java can beat C if it wants to. 🙂
The reason:
In C, the machine code that the compiler spits out directly as an executable file is set in stone and contains more or less optimizations for common additional functions of the processors.
With Java, things are different: The .jar file is essentially just a highly compressed version of the source code. The final compilation into machine code takes place at runtime (JIT compilation). This gives Java an advantage: This compilation can be tailored to a very specific processor—namely, the one installed in the computer. This can be done even if the processor is newer than the program.
This means that the machine code does not have optional optimizations for processor functions that may not exist and therefore have to be skipped, making it smaller and faster.
The JIT compiler also performs other optimizations: What appears to be totally unperformant to a C programmer is actually not (e.g., reading a large amount of data byte by byte using a getter from an InputStream instead of a larger byte buffer array, which is usually easier for the programmer to handle. However, the optimization more or less secretly makes this getter disappear, provided the overhead is disproportionate to the code contained.)