Live data from Hacker News

Java 16

jdk.java.net

291–300 of 327 posts

Re: Java 16

#291

Earlier quoted context omitted.

There's no portability requirement to being on Maven Central. Maven Central regularly hosts non-portable bytecode - like every AndroidX library. And, again, none of those libraries run on Windows, Android, iOS, and web - the 4 major platforms by market share. At best you get half of those, but typically you don't even get that, and that's still only libraries . None of them are portable applications. It's trivial to…

Now you're being intentionally obtuse and moving the goal posts from your original claims just to score points. You're not arguing in good faith. Feel free to stick with your invalid views on portability, the rest of us JVM developers will keep enjoying the portability that this wonderful technology provides us.

Me: You can't write a portable Java app that runs on the 4 major platforms (windows, android, ios, web)

You: But !

Me: But it doesn't do that?

You: moving goalposts! obtuse!

Re: Java 16

#292
post #274
post #196

Earlier quoted context omitted.

Not considering async/await (because I'm not really a fan), they're neck-and-neck in my opinion. I don't think C# has been as careful with its abstractions and the general aesthetic of the language to the degree that Java has; but in many cases you can almost compile a block of Java as C# and vice versa. I think the primary differentiator is what toolchain/ecosystem you prefer, and I'm solidly on the Java side of tha…

What do you think is more elegant in Java than C#? I like both but I think things like LINQ, delegates, reflection, nullabity and even properties are much cleaner in C# vs streams (exceptions?), consumer (weird names. accept? not invoke?), erasure and then just in general its not as nice, Optional (its nullable?!), and getters/setters (I don't want to code gen this away).

> What do you think is more elegant in Java than C#?

Broad availability of third-party libraries? Java Flight Recorder? IntelliJ? Multiple build system options including first-class support for Bazel, Gradle, and so on. (Msbuild gets old quick...)

That said, personally I prefer TypeScript over all of the above if performance isn't an issue. ;-)

Re: Java 16

#293

Earlier quoted context omitted.

> For a couple decades, x86 was absolutely dominant On the desktop and servers, maybe. But there is more in heaven and embedded than is dreamt of in your philosophy.

I work in embedded. Embedded Java has always been a huge set of tradeoffs, which is why it never took off outside of application platforms like mobile phones and set-top boxes. If you wanted the full fat SE Sun/Oracle JVM you were pretty much stuck with power or ARM, and even then you had to be careful. Remember the portability disaster that was symbian and Java ME? These ISAs weren't exactly the low end of the embed…

> Remember the portability disaster that was symbian and Java ME?

Don't forget Java Card in that list. Which Oracle still tries to claim as a Java portability win, even though it doesn't support basically anything. And I don't mean missing standard libraries, I mean like it doesn't support char, double, float, and long, or multidimensional arrays. Support for int is even optional. Doesn't support exceptions and you can't even assume it has a garbage collector. Among many other limitations.

Re: Java 16

#294
post #230
post #157

Earlier quoted context omitted.

The problem (as I see it, anyways) is that the 'big boys' that I referred to in my initial comment have been around a long time (2000 for C#, 1995 for Java) and over that long history, have had a slew of language changes. They are starting to suffer from the same problem that C++ suffers from, where every shop defines their own subset of the language with which they use. Meanwhile, the languages that they graft featu…

But that’s the great thing about java, it is still a pretty lean language even with its age.

And even C#, which has grown a lot, tends to have pretty orthogonal features, so that you don't end up too often in C++'s problem that every feature interacts with every other feature and complicates it.

Re: Java 16

#295
post #274

Earlier quoted context omitted.

What do you think is more elegant in Java than C#? I like both but I think things like LINQ, delegates, reflection, nullabity and even properties are much cleaner in C# vs streams (exceptions?), consumer (weird names. accept? not invoke?), erasure and then just in general its not as nice, Optional (its nullable?!), and getters/setters (I don't want to code gen this away).

> What do you think is more elegant in Java than C#? Broad availability of third-party libraries? Java Flight Recorder? IntelliJ? Multiple build system options including first-class support for Bazel, Gradle, and so on. (Msbuild gets old quick...) That said, personally I prefer TypeScript over all of the above if performance isn't an issue. ;-)

You'd love Kotlin then

Re: Java 16

#296
post #240

Earlier quoted context omitted.

There are no GC pauses issues practically now and for years. Language startup is also not all that much issue.

I'd say they're at a point where they're not a problem for most use cases, but if you're trying to get p9999 latency down, you might have to start looking at them.

The default GC has ridiculously good throughput with modest latency (10ms for quite large heap sizes), but there are also alternatives like ZGC and Shenandoah that optimize for latency instead, and they promise Also, for very different use cases like soft real time, there are specific JVMs with real time guarantees.

Here is a great post about it: https://jet-start.sh/blog/2020/06/09/jdk-gc-benchmarks-part1

Re: Java 16

#297

Do you think the "Run anywhere" marketing behind Java is rarely important? Java programs normally sit on a server, or many servers of the same arch. The decent thing is that someone can build a JVM for a new architecture and lots of /other/ languages that target the JVM work. But this seems different from "my program can runs on lots of architectures".

> Java programs normally sit on a server Or an Android smartphone or media streamer (Android TV). However, those programs won't run anywhere; they need Android. Java has turned into C. Java programs need a platform-specific set of libraries just like C needs POSIX, or Win32, or VXWorks or ThreadX or whatever. This is pretty much inescapable.

Java apps are pure Java for the most part, they basically contain no native code, unless for some very specific OS API call (in which case portability is a non-goal) — and the JVM will run any class file thrown at it.

Android is special because it has many many special APIs, so I don’t see your point. Just look at the (unfortunately not too numerous) desktop java apps. The exact same jar from n years ago will just run on all three main OSs.

Re: Java 16

#298
post #228

Earlier quoted context omitted.

I used Java a lot and like some aspects. But I think C# is way ahead in some important ways and Java is playing catch-up

Java is really conservative language-wise while C# is pretty much add everything you see, reminiscent of C++. Also, a significant part of Java development happens at the runtime level, where I would wager the catch-up is in the opposite direction, in some areas by quite large margins.

C++ had shoddy foundation where adding more stuff is far from trivial.

Re: Java 16

#299
post #274

Earlier quoted context omitted.

What do you think is more elegant in Java than C#? I like both but I think things like LINQ, delegates, reflection, nullabity and even properties are much cleaner in C# vs streams (exceptions?), consumer (weird names. accept? not invoke?), erasure and then just in general its not as nice, Optional (its nullable?!), and getters/setters (I don't want to code gen this away).

> What do you think is more elegant in Java than C#? Broad availability of third-party libraries? Java Flight Recorder? IntelliJ? Multiple build system options including first-class support for Bazel, Gradle, and so on. (Msbuild gets old quick...) That said, personally I prefer TypeScript over all of the above if performance isn't an issue. ;-)

We're talking about language design choices not ecosystem.

Even still, libraries are not a problem. Nothing you can't do in C#. You should check out Rider. Bazel and Gradle are cross platform as well.

Flight Recorder is good. I'll give you that. The .NET debugging tools are top notch...on windows. JFR wins out handily until the Linux tools reach parity. Though, again, this is all ecosystem and not language design.

Re: Java 16

#300

Earlier quoted context omitted.

I can only comment on C# / F#. The C# versions of F# features tend to be pretty clunky compared to the F# versions. This is because F# was designed for them from the beginning, rather than having them tacked on. Functional programming is getting easier in C#, no question about that, but honestly, it still kind of sucks. And the OOP-minded C# devs on your team still won't be able to make sense of your code that levera…

What fancy features won't we understand? I think some things about functional programming make code feel cleaner, but I don't like it enough to use F# or Haskell.

If you do stuff like this: https://weblogs.asp.net/dixin/category-theory-via-csharp-7-m...

(Note this is horrible because C# does not support this style well, in F# it's idomatic)

Post reply on HN