Earlier quoted context omitted.
That’s not an oops. You’re comparing pointers.
Still, coming from other languages, it is all too easy to write this and this silently fails without any warning. This is consistent with the rest of the language, but I'd bet one rarely wants referential equality when comparing strings. People commenting "yeah but that's because you are a newbie / you are comparing references and you should know better" miss the point I think. I can easily see myself making this mis…
Java 18 / JDK 18: General Availability
51–60 of 304 posts
Re: Java 18 / JDK 18: General Availability
#52Earlier quoted context omitted.
That’s not an oops. You’re comparing pointers.
Still, coming from other languages, it is all too easy to write this and this silently fails without any warning. This is consistent with the rest of the language, but I'd bet one rarely wants referential equality when comparing strings. People commenting "yeah but that's because you are a newbie / you are comparing references and you should know better" miss the point I think. I can easily see myself making this mis…
Basically the tooling around Java is very evolved and Java static type system helps the IDEs a lot. One of the main reason enterprises prefer Java. Also majority of the tools and IDEs is free for commercial use.
Re: Java 18 / JDK 18: General Availability
#53Earlier quoted context omitted.
Oracle's builds of Java are open source as well. The OpenJDK codebase is shared across all of the vendors that provide builds.
"Open Source" but not free to use as you wish. The Oracle builds require a commercial license.
Oracle also has their own build of the JDK which is not GPL. That is free to use in commercial software as well, under their "No-Fee Terms and Conditions"
Re: Java 18 / JDK 18: General Availability
#54This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.
The competition includes languages like Rust, Go, Haskell or Erlang. Most of these lack the languages that you'll find on the JVM, so it really is a question of what you are trying to do. Go is certainly interesting in some places, especially if you want a binary that is entirely self sufficient. Each of these languages is interesting, though of course one has to wonder about hiring, whereas finding developers who've worked on the JVM is easy enough.
Re: Java 18 / JDK 18: General Availability
#55Is there a reason to use Oracle's closed-source Java implementation instead of the opensource implementations? Asking as someone who's ignorant about Java. edit: per comments below, Oracle's Java is open-source too these days.
Re: Java 18 / JDK 18: General Availability
#56This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.
Re: Java 18 / JDK 18: General Availability
#57Earlier quoted context omitted.
Oracle's builds of Java are open source as well. The OpenJDK codebase is shared across all of the vendors that provide builds.
"Open Source" but not free to use as you wish. The Oracle builds require a commercial license.
For reference I double checked here: https://www.oracle.com/java/technologies/downloads/
Re: Java 18 / JDK 18: General Availability
#58Earlier quoted context omitted.
Thanks! So why would I pick Oracle's implementation?
Ignorance of the Supreme Court decision that Java API copyrights are not enforceable. https://en.wikipedia.org/wiki/Google_LLC_v._Oracle_America,_... .
Re: Java 18 / JDK 18: General Availability
#59Earlier quoted context omitted.
The language is simple. Reasonable performance, lots of opportunities to tune that performance without changing code. Great error handling. Works across all platforms in most cases. The tooling has a long standing reputation for being incredible, given what Eclipse and Jetbrains have done for the community. It integrates nicely with native code, and is easy enough to interface with (compared to e.g. Node.js and pytho…
Great error handling? What does that mean? Checked exceptions seem cool at first, but are really just nonsense… as your only real way of dealing with this is: 1. Catch, log and rethrow, or 2. Wrap as a runtime exception (so you don’t have to change every method signature up to main()) Sure, there’s option 3: catch and handle… but this is used 1/50 times, and the ergonomics of (2) overwhelm the utility of this. BTW, v…
This is not as useless as it sounds. You can analyse the logs and find out why these exceptions are occurring. A lot of times these lead you to subtle bugs which you might not have noticed otherwise.
Re: Java 18 / JDK 18: General Availability
#60This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.