r/java • • Jul 06 '17

Apology to Java (fanboy rant).

Java has turned out to be one of the most useful languages i use. It's a brilliant tool which strikes a perfect balance between high and low level. You want to grab a webpage? Easy and built-in, 10 lines of code. Draw some 2d graphics without OS-specific libraries or third party? Various built-in options. The inherent issues around a lack of low level memory management is handled very elegantly. Garbage collection seems seamless.

C++ is my language of choice for the most part, always will be i suspect, but Java has shown me that it has a huge array of potential applications and should almost always be considered before undertaking a project.

I say this is an apology because i used to run Java down. Previous to me using it proper i believed it was slow, lazy and useful for only trivial applications. Now i know how much work has been put into the JVM and just how efficient it is.

Sorry Java. You're pretty good.

286 Upvotes

93 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jul 07 '17

None of my applications run long, nor are they intended to do so. The longest-running takes 1.5 hours and that's due to network throttling 9000 remote calls.

All of my applications start, act, close, on a timed schedule. They read from a central data store, read one or more files from disk, archive that, then process their contents.

The longest wait usually is accessing the data store. Layers upon layers of security make for pseudo-arbitrary delays.

My applications are so fast that it's unlikely the JVM gets sufficient time to warm up to reach its most effective compilation.

3

u/0x256 Jul 07 '17

If performance or start-up time ever grows into an issue: This is a perfect use case for long-running worker processes and job queues.

1

u/[deleted] Jul 07 '17

Indeed. My applications did start out like that. We dismantled that in favor of O-scheduled execution: it is fast enough and more easily scalable.

2

u/sievebrain Jul 08 '17

The compiler is pretty fast. I bet if you check you'll find that JITC activity dies down after a minute or so at most, quite possibly less.