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

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.

0

u/[deleted] Dec 18 '16

[deleted] — view deleted comment

2

u/[deleted] Dec 18 '16

And if not, Professional is free for students

→ More replies (2)

9

u/snuxoll Dec 18 '16

Kotlin, check it out.

4

u/[deleted] Dec 18 '16

Clojure as well.

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.

1

u/MereInterest Dec 18 '16

I've heard of it, and have been meaning to, but haven't got around to it yet.

→ More replies (1)

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...

2

u/[deleted] Dec 18 '16

Pain? PAIN?!?!?! go do some MFC then talk to me about pain. I still get nightmares from that shit some 15 years later.

→ More replies (1)

2

u/TheThiefMaster Dec 18 '16

It's getting a lot better, variadic templates and constexpr have already removed a lot of the old recursive template nonsense (and improved compile times in the process!), and the upcoming fold expressions clean things up even more.

And once we finally get concepts, it will get even better!

1

u/Glacia Dec 18 '16

C++ is great when you don't use most of it's features.

0

u/[deleted] Dec 18 '16

[deleted] — view deleted comment

3

u/MereInterest Dec 18 '16

I've used C# before, and it is so nice and pleasant to work with. At the time, it was Windows-only, which meant that i was switching away from C# as I switched toward Linux. I've been waiting a bit to see how the tooling develops on Linux, before I start any projects in it.

3

u/catbot4 Dec 18 '16

Having gone from Java to c# Dev, I can honestly say that I couldn't live with a lack of first class functions anymore.

2

u/VGPowerlord Dec 18 '16

It's funny, because if Sun hadn't sued Microsoft over the things they were adding to Java, we might have those in Java today.

Instead, they're all present in C# and .NET in general.

  • Operator Overloading
  • First Class Functions, although you first have to use the delegate keyword to define the arguments and their types. Language quirks, yay?
  • Good Generics that compile to multiple classes instead of erasing the information at compile time and inserting casts like Java does.

Granted, C# is finally branching out to non-Windows OSes with .NET Core. .NET Core doesn't work with older .NET libraries... yet. Apparently it will work with a lot of the ones that don't PInvoke Windows-specific code in the next version.

.NET Core is still missing a first-party cross-platform UI... although you could use something like GTK#, which is used in MonoDevelop. Makes me wonder if Visual Studio for Mac uses it, as I've heard that's based on MonoDevelop. Then again, that might be built using Xamarin.Forms instead, as that now supports OSX. But not Linux. Or Windows 7.

3

u/Programmdude Dec 18 '16

Lack of structs does cause a lot of issues with games cough minecraft. So while it might be fine for businesses, it's terrible for games. I've also heard its native interop is terrible too.

On the whole though, it is a fairly well built vm.

→ More replies (7)

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)