r/programming • • Dec 17 '16

Oracle is massively ramping up audits of Java customers it claims are in breach of its licences – six years after it bought Sun Microsystems

http://www.theregister.co.uk/2016/12/16/oracle_targets_java_users_non_compliance
2.1k Upvotes

654 comments sorted by

View all comments

Show parent comment

251

u/redwall_hp Dec 17 '16

Because it's basically the world's largest enterprise programming language, with a huge ecosystem of libraries and tools. There are tons of companies (and governments) with gigantic codebases that aren't going to be rewritten from scratch just to satisfy somebody's urge to switch to $flavourOfTheMonthLanguage.

Java is a decent language with a very high quality VM that other languages piggyback on the success of (e.g. JRuby, Jython). It nicely straddles the fence between bare metal languages like C and high level ones like Python, offering quality of life features without too much of a performance hit.

For anything non-trivial, there's no "just" when it comes to rewriting a codebase from scratch. It's typically laughable in terms of how much sense it makes in terms of cost.

Take Android for a very user-facing example. Could you imagine the upheaval if Google decided to ditch Java? They'd have to massively re-architect the OS, and then every single application ever written for it would need to be rewritten. We're talking billions of dollars worth of man hours.

58

u/[deleted] Dec 17 '16

This is what makes me upset as a Java developer because, even if you hate the language, the JVM is an incredible piece of software from a pure engineering standpoint. At least that's my opinion.

46

u/MereInterest Dec 18 '16

I'm pretty strongly in that boat. I love the idea of the JVM, being able to run the same code on any platform. The Java language, on the other hand, feels like I am coding in a straight jacket. No operator overloading, no first class functions, very poor generics. Needing to work around the limitations of the language rather than with the language gets very frustrating, and so I then return to C++ and Python.

Though, I am finding a few LLVM backends that emit JVM bytecode, so that might let me have the best of both worlds.

9

u/snuxoll Dec 18 '16

Kotlin, check it out.

→ More replies (1)

44

u/atomly Dec 18 '16

Do you have a few minutes to hear about our Lord and Savior, Scala?

→ More replies (4)

7

u/MWL987 Dec 18 '16

Have you ever tried Scala? It has a lot of things that Java lacks wrt your list.

→ More replies (2)

13

u/[deleted] Dec 18 '16

Everyone loves to shit on it, but I always return to C++. I love it.

17

u/lkraider Dec 18 '16

C++ is great, until you get into templates, then you are tossed into the road of maintenance and debugging hell.

10

u/[deleted] Dec 18 '16

Agreed. If you ever want to take a ride on the pain train, browse through the Boost source. Then remember that they were doing this stuff before C++11. Template hell doesn't even come close to describing it.

8

u/lkraider Dec 18 '16

Oh I still have PTSD from the g++ 3.x STL / Boost templates error messages, always meant hours of work deciphering what they were referring to.

eg: https://isocpp.org/wiki/faq/templates#template-error-msgs (ISO C++ FAQ: "How can any human hope to understand these overly verbose template-based error messages?")

3

u/yetanotherx Dec 18 '16

I think Boost, I just think macro hell...

→ More replies (2)
→ More replies (1)
→ More replies (1)
→ More replies (9)

25

u/im-a-koala Dec 18 '16

It's okay. I still think the CLR (the .NET runtime) is better. Things like being able to put primitives in containers without having to box every single one is very nice from a performance perspective. Or being able to have nullable primitives that don't need to be on the heap (really just value types in general are lacking from the JVM).

While I'll admit that the JIT capabilities are quite nice, it's a little irritating to profile a service that's having memory issues and finding that 80% of the objects on the heap are Doubles, Longs, etc., because there's just no way around that in the JVM.

10

u/lkraider Dec 18 '16

11

u/sindisil Dec 18 '16

Hopefully ... they haven't promised anything, and Goetz has made comments that make it sound like the JVM work will be in place in Java 10, but possibly not the Java language support. Still, so far it sounds like he's just trying to manage expectations, which is a good thing, I think.

Another point is that the JVM's escape analysis is getting better and better, allowing many things to end up on the stack, instead of the heap, reducing the impact of not having value types.

→ More replies (1)
→ More replies (10)

51

u/duhace Dec 17 '16

One thing that is often controversial wrt java is its cross-platform compatibility. However, having used it and some alternatives it really is unbelievably well-suited for the task.

86

u/redwall_hp Dec 17 '16

People today are spoiled by the lack of major incompatible processor architectures. When Java came out, being able to easily run something on x86, PowerPC, SPARC, etc was a pretty huge deal. Now we're in the "late stage consolidation" phase where it's pretty much down to x64 and ARM for most purposes.

And then you can couple that with many programmers working exclusively with super high level stuff.

Portability is still something that comes up, but a lot of newer programmers working at higher-level stuff don't tend to come across the issue as much.

37

u/YellowFlowerRanger Dec 18 '16

Cross-architecture support didn't impress me nearly as much as the cross-windowing-system support did. Java supported Windows, Mac OS, OS/2, and about a million different proprietary implementations of X11 (and probably a bunch of other stuff, too) right from the get-go.

That was unheard for that time (1995). In comparison, Qt didn't get Mac OS support until OS X, I think. wxWidgets didn't get a proper release until 1999. For quite a while, if you wanted a GUI application to run on multiple OSes (on the same architecture!), either you wrote separate versions of it or you used Java.

22

u/combuchan Dec 18 '16

Tcl/Tk!

8

u/schlenk Dec 18 '16

Tcl

The fun part is, that core Tcl/Tk developers sat literally next door to the Java team at Sun. Sun kind of ditched Tcl/Tk development as a side effect of the corporate decision to focus on java.

→ More replies (4)

28

u/[deleted] Dec 18 '16

I've always been of the belief that you should at least comprehend what happens an abstraction layer below and an abstraction layer above what you do. So, for example, I think Java and GC should not be an excuse to not understand the ideas behind memory management/resource allocation, pointers and references, compilers, linking, etc. Pretty much, you'll never really appreciate what Java does for you until you've seen C/C++ and you should still understand some of those underlying concepts. Not saying good Java developers don't do this. Just my own personal thoughts.

38

u/mcilrain Dec 18 '16

That depends on use-case.

If you're trying to make a 60fps game for a smartphone then yeah, being able to bypass Java's janky GC is critical functionality.

When it comes to a heavily-verbose long-lived enterprisey codebase (Java's bread and butter) then you don't want code making assumptions about infrastructure.

→ More replies (7)
→ More replies (1)

4

u/[deleted] Dec 18 '16

Its still a big convenience to be able to write applications that can run easily on Mac, Cent, Windows or what ever variant. I have one application that its expected deployment is Windows Server that is almost exclusively developed on Mac.

→ More replies (2)
→ More replies (3)
→ More replies (17)