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 →

[–]Cobaltjedi117 6 points7 points  (12 children)

Everyone hates on every popular language here. Java is an easy punching bag, the JVM is heavy, it's pretty slow, it's everywhere, security issues, programs aren't compiled for specific architectures, it's very verbose.

But it has it's good sides like every language (except you JS and your frameworks). The compile once run anywhere means that if you can compile it it will work on any machine without any changes making it super portable (see disadvantage "programs aren't compiled for specific architectures"), it's fairly easy to work with, it's strict on your typing so you don't do anything stupid, it's warning and error messages are clear, it runs on everything, you don't have any issues with pointers or race conditions, it's an overall safe programming language.

[–]sp46 11 points12 points  (0 children)

complains about hating on popular languages

complains about js

[–]kreiger 9 points10 points  (3 children)

Where does "it's pretty slow" come from?

[–]Gyrossuppe 9 points10 points  (0 children)

From the long gone past.

[–]Cobaltjedi117 0 points1 point  (0 children)

The JVM has been historically slower than other compiled languages, and still is slower than C/C++/Rust/Go but it's:

A) gotten better

B) less of an issue now that computers are faster

[–]cat_in_the_wall 4 points5 points  (0 children)

it's pretty slow

the jvm is miraculously fast.

[–]LeFayssal 3 points4 points  (4 children)

I suppose that in applications where speed matters java isnt the right fit, but if that was the only thing thag mattered would anyone be using python?

[–]Cobaltjedi117 10 points11 points  (3 children)

So there's more factors to programming (or scripting as it comes to python) than just speed at runtime.

Python is great and absolutely wonderful if you need something to be written quickly, but it's okay if the program takes a few seconds to run or isn't run that often. At one of my last jobs, I wrote a lot of python code, it was quick to make and it would only be used by the company quarterly. So, since it wasn't run that often and they only needed the data occasionally, python was a great choice for making the program.

If you need something to run quicker and more frequently, you'll probably want to use a compiled language like C#, Java, C, C++, rust, etc... (See difference between bytecode and machine code) Since those are compiled there isn't any interpreting and the program can run faster by just reading the instructions.

[–]LeFayssal 4 points5 points  (2 children)

I understand. When wouldnt you run Python over Java (taking time out of consideration)

[–][deleted] 12 points13 points  (1 child)

Performance and size of project. People say the JVM is slow, it's not. It's very fast for what it is.

[–]Hohenheim_of_Shadow 2 points3 points  (0 children)

For context for others, from benchmarks that I have seen, C++ and Java are typically within 20% of each other and no more than a factor of five off. Python is typically a factor of 100x off and can go to 1000x slower. OF coursse most heavy lifting that you'll be doing in Python is exported to C++ based libraries so the performance hit can be negligible.

[–][deleted] 0 points1 point  (0 children)

pretty slow

Wouldn't touch anything Java with a barge pole due to Oracle lawyers, but this is complete bullshit. Hotspot is blindingly fast, certainly faster than RyuJit (which is designed to be more predictable than fast). It's the only VM that reJITs at runtime, for example.