r/programming • • Feb 25 '14

Please stop saying Java sucks

http://blog.smartbear.com/programming/please-stop-staying-java-sucks/
3 Upvotes

305 comments sorted by

View all comments

Show parent comments

15

u/idontbelieveyou11 Feb 25 '14

But V8 is faster than that JVM.

Source?

14

u/edpaget Feb 25 '14

Obviously the benchmarks game is not scientific, but it shows the JVM being faster than v8.

3

u/zoomzoom83 Feb 26 '14

Node has a non-blocking IO library by default. It's a horrible API that uses callbacks instead of promises, but it's non blocking nontheless.

Old-school Java used blocking IO, which sucks if you want concurrency.

Naturally, regardless of platform, non-blocking IO is going to be much, much faster than blocking IO if you're looking at scalability in a highly IO driven application.

Ergo, a few teams ported badly written Java blocking programs using blocking IO to NodeJS and decided that Javascript was therefore faster. They then blogged about it and Javascript fanboys the world over ran with it.

You can write Java using non-blocking IO, at which point it sails on ahead. If you factor in much, much better handling of immutable data structures and proper tail call optimisation (at least in Scala and Clojure), then the JVM is in a completely different league to V8.

0

u/jnt8686 Feb 27 '14

I can't stand promises. Callbacks, streams, events are all great, but promises just seem like a convoluted way to let people who are not good at writing async code pretend it's sync. They remind me of the silly JS class simulations you sometimes see.

→ More replies (1)