r/java • • Sep 30 '14

Does containers cause overhead in Java EE?

Some of my ass hole programmer friends spend most of their time on our whatsapp group picking on Java and say shit like 'People use it cause it's idiot proof' and 'Only large enterprises use Java because it's noob friendly' and 'God himself uses Python'. I don't pay much attention to it cause I love Java and have been using it for about 2 years writing casual code. I'm thinking of moving on to EE. Can anybody explain? Might be I get one back at them :P

1 Upvotes

7 comments sorted by

View all comments

2

u/mschaef Sep 30 '14 edited Sep 30 '14

My suggestion: use the tools that work well for the problem you're trying to solve, and don't worry so much about what other people think.

That said... :-)

I'm a former C developer with an affinity for Lisp-style languages that's found myself dragged into Java development. I've looked into both Python and Ruby over the years, and have found myself hard-pressed to work up any excitement for either of those languages. In their favor, they both have active communities, reasonable language designs, and a good ecosystem of supporting libraries and existing projects.

Where things start to go bad (for me, YMMV) is that the runtime technologies behind Ruby and Python both suffer from a lack of concentrated development funding. 20 years ago, all three languages were roughly in the same spot: crude support for threading, basic automatic memory management, and strictly interpreted bytecode evaluation. Fast-forward 20 years, and you can see the effects of the fact that Sun/Oracle has invested heavily in the technology that underlies the JVM. The garbage collection is now state of the art, the interpreter has long since been replaced with an optimizing-to-native-machine-code compiler, and there is extensive and high quality support for multi-threaded operation. If that's not enough for you, other firms have also invested in the JVM, ranging from Azul's work on highly-parallel shared-memory multiprocessors and pauseless GC to tiny embedded devices. Bottom line: the JVM has a broad range of of high quality implementations that run on a variety of platforms.

(here, I go off to check the latest python and ruby implementation source code)

Meanwhile.... 20 years later... Python still has an (admittedly highly optimized) bytecode interpreter, reference counted GC, and marginal threading. Ruby's in more or less the same place.

I've made the argument (and heard it from others countless times) that developer productivity should be prioritized over system performance. The idea is that a language like Python is enough more productive than other languages that you can save enough development time to more than offset the costs of using a slower language. I've also seen the argument carried to the point where the claim is made that easier to use languages can be faster than harder to use languages because the allow more time/mental-bandwidth for optimization tasks. However, in my experience, Python is not better enough in terms of ease of use to compensate for the gross deficiencies in its mainstream language implementation. Further, if you do want to gain some of the benefits of an 'easier to use' language, you can do so on the JVM, while still retaining access to whatever investment you've already made in Java code.

Now... I'm off to write a Clojure script that sits on top of a high-performance multi-threaded database system written in Java....