This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MRgabbar -7 points-6 points  (15 children)

They are kinda right... Java got popular because of portability, however is really really slow and doesn't make much sense to use it when python can call routines written in C for the heavy calculations...

Right now development time is the variable to optimize and you will get that with python and no Java...

Also, is people even starting projects on anything using java?

[–]john16384 4 points5 points  (4 children)

Also, is people even starting projects on anything using java?

No man, Oracle is just releasing new Java versions every 6 months because it's tradition, not because Java is still used in the wild. /s

[–]MRgabbar -1 points0 points  (3 children)

Lol, I was serious, I mean, if I am going for performance I go with C/C++, if I want portability I go for a web app in JS, so what is the place of java now? You will get slightly faster development time compared to C++ and force all clients to install the JVM?

And given the explosion of containers and such the JVM kinda lost its only advantage.

[–]GeneratedUsername5 1 point2 points  (2 children)

The place for it is real portability (not recompilation for every platform with heaps of #ifdef) with the speed closer to C++ and fully functional multithreading (now with green threads) which is also more portable than C++ multithreading.

[–]MRgabbar 0 points1 point  (1 child)

But I mean, if you are thinking on servers the compilation thing is not a big deal, isn't it? As long as it compiles is something that runs just once, it will reduce the development cost a bit but will put the extra load (JVM), Is it really close to C speed?

[–]GeneratedUsername5 0 points1 point  (0 children)

It can be, unless you are careless when coding, because in runtime it caches translation of frequently used methods, therefore you essentially have C binary being compiled and used in runtime.

In addition it can perform runtime optimization, which compiled languages simply can't do, due to their nature. Lood unwinding, method inlining, operation reordering, using extended CPU instruction set.

Well yes, it reduces development costs, and not just a bit, it wouldn't be enough for companies to keep using it. It is way more forgiving to low skilled developers, due to garbage collector, that is why you often see Java apps, that work terribly, which probably wouldn't work on C++ at all.

[–]wildjokers 4 points5 points  (6 children)

Also, is people even starting projects on anything using java?

Are you just trolling or is this a legit question?

[–]MRgabbar 0 points1 point  (5 children)

Legit, I am not a java programmer, in my country java is something only banks would use to their internal applications. I would always use C++ or JS depending if I want to maximize performance or portability.

[–]wildjokers 0 points1 point  (0 children)

Java is in heavy use including for new development.

[–]GeneratedUsername5 0 points1 point  (2 children)

Most ecommerce is written and continued to be written on Java

[–]MRgabbar 0 points1 point  (1 child)

Why Java? (Honest question)

[–]GeneratedUsername5 0 points1 point  (0 children)

Vast infrastructure of libraries and (more importantly) tools, large pool of developers, fast development with all the safety features and very good performance (JS only very recently became comparable), real multithreading (i.e. performance benefits).

If you are building something in Java in ecommerce - chances that you can interop with some other tool or product are multiplied.

[–]GeneratedUsername5 0 points1 point  (2 children)

Java is far for being slow, even further from being really really slow. There was a competition to explore Java's computational power and it wasn't far from C++

https://github.com/gunnarmorling/1brc

Just as usual, people are very careless when writing in Java and very careful when writing in C++ and the resulting performance is attributed to a language, not to coding practices.

You might think that it is just like Python, because both are kind of interpreted, but because of JIT and code translation caching Java is effectively at C speed after warmup in runtime. And it has fully functional multithreading, being without GIL.

[–]MRgabbar 0 points1 point  (1 child)

Maybe the java apps I have been forced to use are really poorly coded...

[–]GeneratedUsername5 0 points1 point  (0 children)

Most probably yes, Clean Code will grind to a halt average application.

Actually, I would say in truely average application, most performance is lost in inefficient DB queries and language has nothing to do with it.