Live data from Hacker News

Revisiting Java in 2021 – Part II

avanwyk.com

21–30 of 146 posts

Re: Revisiting Java in 2021 – Part II

#21
post #5

> There are ... many well-written books on how to program it effectively Would anyone be able to recommend a good resource for quickly learning modern Java for experienced programmers that already know, let's say, one of {Python,Javascript} AND one of {Go,Rust,C,C++}, but have zero JVM experience? (Ideally the resource would also teach some relevant things about the JVM itself rather than the Java language specifical…

Hmm. Great question. I've always liked Josh Bloch's "Effective Java" because it's targeted toward experienced programmers, and he expressed (correct) opinions about things like immutability. But the book is very old (2001). One way to get into it is to build something real, first on bare bones (e.g. 'javac Main.java; java Main'), then bare bones Maven, then finally pick a great starting project which itself curates s…

The 3rd edition of Effective Java was published in 2017, it's been updated to java 9.

Re: Revisiting Java in 2021 – Part II

#22
post #9
post #7

I use Java every day, but we're stuck with Java 8 because of the confusing and frankly scary licensing around later JDKs. I would love to move to 17 but I need something to show to the C-levels that gives them warm and fuzzies around the license. Does such a thing exist? EDIT: I find it quite depressing that so many want to attack people for being confused around Java licensing. I submit that it is confusing on its f…

OpenJDK: "Oracle’s free, GPL-licensed, production-ready OpenJDK" I don't know what could be more convincing than an explicit open license.

Suing Google for a billion dollars makes people irrationally nervous.

Just sign the license and agree to all the terms and conditions. Nothing will go wrong.

Re: Revisiting Java in 2021 – Part II

#23

The comments about Scala resonated. I've been working in a a large Scala codebase for the past few months. I've become a partial fan of the language, however: there have been multiple conversations like : (in screen share with colleague) "See that double right arrow there? What's that mean? (after attempts to find answer in books, SO, etc, and trying to guess based on the three/four other uses the language makes of d…

Not a scala programmer, but I searched for "scala cheatsheet" and got the answer:

https://docs.scala-lang.org/cheatsheets/

Double arrow seems to have multiple uses - for anonymous functions (like in js) and for pass-by-reference arguments (I guess scala is pass-by-value by default).

(Surprised at how Erlang-y it feels, especially WRT pattern matching)

Re: Revisiting Java in 2021 – Part II

#24
post #11

Earlier quoted context omitted.

Perhaps point out how many non-Oracle commercial JVM vendors exist? They might not trust Oracle to be sane, but Red Hat, Microsoft, SAP and Amazon are all very big names in the industry who offer their own JDK distributions, some of them also offer commercial support.

Do you know what the legal relationship is between Red Hat and Oracle is? I think Oracle v Google has sent shivers of fear through anyone wanting to rely on Java, including through an intermediate, because the strength of the relationship is only as strong as the weakest link in the chain. In other words, what is the risk that Red Hat will be sued by Oracle someday over their use and support of Java?

Google perverted Java. That's what Oracle sued Google for. And that's what Sun sued Microsoft for decades ago. Red Hat is not trying to turn Java into something different, it just builds and supports existing OpenJDK codebase. It's absolutely different thing.

Re: Revisiting Java in 2021 – Part II

#25
post #5

> There are ... many well-written books on how to program it effectively Would anyone be able to recommend a good resource for quickly learning modern Java for experienced programmers that already know, let's say, one of {Python,Javascript} AND one of {Go,Rust,C,C++}, but have zero JVM experience? (Ideally the resource would also teach some relevant things about the JVM itself rather than the Java language specifical…

I'd be surprised if you found any dramas with the language.

What will keep you in the office to all hours is the ecosystem. Now the ecosystem is probably best in class so don't mistake this as a slight, but it's huge and complex.

Learning Gradle (or Maven), understanding how to make building java apps fast (because the default is slow package assembly times), learning some of the large frameworks (if you go down that route) can keep you occupied for years.

If you're fresh to java, i'd probably encourage you to try avoiding the incumbents like Spring and see how you go? Without Spring, Java is actually pretty efficient. A hello-world rest service with spring results in around 6,000 classes being loaded.

That said - spring, used idiomatically, is a productivity boosting powerhouse.

Re: Revisiting Java in 2021 – Part II

#26
Changing companies led me from C# to Java. I feel so much less productive in Java, so much extra boilerplate everywhere. C# is just as mainstream as Java, so learning curves and nicheness arguments don't apply, it's just better.

I wonder if MSFT will ever make C# run on JVM.

Re: Revisiting Java in 2021 – Part II

#27
post #20
post #13

Earlier quoted context omitted.

> OpenJDK: "Oracle’s free, GPL-licensed, production-ready OpenJDK" I don't know what could be more convincing than an explicit open license. lack of enterprise support. And also what javajosh said. Here's a(n arguably biased) corroboration: https://www.mondaq.com/unitedstates/corporate-and-company-la...

what does enterprise support mean in context of a programming language?

It means having a service that you can contact with questions about the platform. For example, if you're having a weird GC problem you can pay Red Hat $300/hr to have a presumed expert (ideally a committer to OpenJDK) look at it with you and help you solve it. There may also be variants of this where you "subscribe" and get a certain number of support hours.

Re: Revisiting Java in 2021 – Part II

#28

The comments about Scala resonated. I've been working in a a large Scala codebase for the past few months. I've become a partial fan of the language, however: there have been multiple conversations like : (in screen share with colleague) "See that double right arrow there? What's that mean? (after attempts to find answer in books, SO, etc, and trying to guess based on the three/four other uses the language makes of d…

I've been a Scala and FP developer since 2009ish and it suffered initially from over-enthusiasm to make it seem 'futuristic' as a rejection of the overly verbose reality of enterprise java codebases.

There's been a lot of sensible work in the core codebase since then to move towards more coherent idioms, unfortunately the 'we can make Scala into Haskell' crowd have since taken up the mantle and everyone has become obsessed with the idea that no boilerplate starter project is complete without cats or similar which perpetuates barely-legible and unnecessary confusion in situations that should be simple.

Re: Revisiting Java in 2021 – Part II

#29

The comments about Scala resonated. I've been working in a a large Scala codebase for the past few months. I've become a partial fan of the language, however: there have been multiple conversations like : (in screen share with colleague) "See that double right arrow there? What's that mean? (after attempts to find answer in books, SO, etc, and trying to guess based on the three/four other uses the language makes of d…

If you can't use an IDE to jump to the definition (or list all possible definitions) of a function, then aren't you missing one of the main benefits of a statically-typed language? If you can't use the static types for static analysis, what's the point?

Re: Revisiting Java in 2021 – Part II

#30

The comments about Scala resonated. I've been working in a a large Scala codebase for the past few months. I've become a partial fan of the language, however: there have been multiple conversations like : (in screen share with colleague) "See that double right arrow there? What's that mean? (after attempts to find answer in books, SO, etc, and trying to guess based on the three/four other uses the language makes of d…

I wonder if clojure codebase found a right balance there. Hickey made it explicit to have short but very obvious nouns except a few macros)
Post reply on HN