Live data from Hacker News

Java at 30: Interview with James Gosling

thenewstack.io

221–230 of 437 posts

Re: Java at 30: Interview with James Gosling

#221

Earlier quoted context omitted.

> they are heavily discouraged throughout Java code That's so ignorant. Read the article please.

Let's revisit past conversations: - https://news.ycombinator.com/item?id=43226624 - https://news.ycombinator.com/item?id=43584056 - https://news.ycombinator.com/item?id=36736326 And more. I'm not sure what you found in (checked) exceptions. If you'd like explicit error handling, we have holy grail in the form of Rust which beautifully solves it with implicit returns, error type conversions and disambiguation between…

> I'm not sure what you found in (checked) exceptions.

I could copy/paste the entire article here... but it would be easier if you could take a gander: https://mckoder.medium.com/the-achilles-heel-of-c-why-its-ex...

Summary:

Crashy code: You have no compiler-enforced way to know what exceptions might be thrown from a method or library.

More crashy code: If a method starts throwing a new exception, you might not realize you need to update your error handling.

Dead code: If a method stops throwing an exception, old catch blocks may linger, becoming dead code.

Re: Java at 30: Interview with James Gosling

#222
post #215
post #7

Java performance isn't the fastest, that's ok, a close 3rd place behind C/CPP ain't bad. And you're still ahead of Go, and 10x or more ahead of Python and Ruby. Java syntax isn't perfect, but it is consistent, and predictable. And hey, if you're using an Idea or Eclipse (and not notepad, atom, etc), it's just pressing control-space all day and you're fine. Java memory management seems weird from a Unix Philosophy POV…

Java is not ahead of Go, they're on part but often Go is faster while using 2-10x less memory. Value type makes optimization much easier in Go. The fact that you specifically mention Go explains a lot. btw c# is faster than Java, so not third place, it's more a 5th~ https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Doing what?

Benchmarks aren’t all that useful since usually the bottleneck is File IO, external api calls, db calls, user latency or a combo of the 4.

Go’s main advantage in this matchup would be conciseness.

Go code looks so clean and nice, Java doesn’t.

I personally don’t care for Java, but I have bills so it’s always in my back pocket. Things happen , sometimes you need to write Java to eat.

“Fred, you really should just take the job.”

“Martha you don’t understand, it’s Java with an Oracle DB.”

“Fred, I know it’s bad, I know you still have nightmares about the 4 types of string in Java 8, but it’s not just us now.”

With a tear in his eye , fear in his heart.

“Martha, if I must… I’ll open Eclipse once more.”

Re: Java at 30: Interview with James Gosling

#223

Earlier quoted context omitted.

Personally I think C# is miles ahead of Java and in meaningful ways (like a drastically better implementation of generics, not to mention value types have existed for eons at this point and an FFI system that doesn't hate you for using it) But nobody seems to talk about or care about C# except for Unity. Microsoft really missed the boat on getting mindshare for it back in the day.

One area where C# really messed up is exception handling. See https://mckoder.medium.com/the-achilles-heel-of-c-why-its-ex...

Java streams and a lot of other APIs are extremely ugly because of checked exceptions. Conversely, LINQ and delegates and a lot of other syntax is far cleaner in C#.

Your linked blog is pretty wild. Only throw RuntimeExceptions to crash? Why not just Exit if that's the proper thing to do?

If you treat all C# exceptions as RuntimeExceptions, then it satisfies the blog anyhow.

Re: Java at 30: Interview with James Gosling

#224
post #215

Earlier quoted context omitted.

Java is not ahead of Go, they're on part but often Go is faster while using 2-10x less memory. Value type makes optimization much easier in Go. The fact that you specifically mention Go explains a lot. btw c# is faster than Java, so not third place, it's more a 5th~ https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Doing what? Benchmarks aren’t all that useful since usually the bottleneck is File IO, external api calls, db calls, user latency or a combo of the 4. Go’s main advantage in this matchup would be conciseness. Go code looks so clean and nice, Java doesn’t. I personally don’t care for Java, but I have bills so it’s always in my back pocket. Things happen , sometimes you need to write Java to eat. “Fred, you really shou…

Go code is far from concise. Java is more expressive than Go in almost every way.

Re: Java at 30: Interview with James Gosling

#225
post #49

Earlier quoted context omitted.

I can run basically any Perl code back to Perl 4 (March 1991) on Perl 5.40.2 which is current. I can run the same code on DOS, BeOS, Amiga, Atari ST, any of the BSDs, Linux distros, macOS, OS X, Windows, HP/UX, SunOS, Solaris, IRIX, OSF/1, Tru64, z/OS, Android, classic Mac, and more. This takes nothing away from Java and the Java ecosystem though. The JVM allows around the same number of target systems to run not one…

> I can run basically any Perl code back to Perl 4 (March 1991) on Perl 5.40.2 which is current. Yes, but can you _read_ it? I'm only half joking. Perl has so many ways to do things, many of them obscure but preferable for specific cases. It's often a write-only language if you can't get ahold of the dev who wrote whatever script you're trying to debug. I wonder if modern LLMs could actually help with that.

>Yes, but can you _read_ it?

Java was marketed (at least in its early days) as a WORA language - WRITE ONCE RUN ANYWHERE.

Perl was unmarketed as a WORM language - WRITE ONCE READ MANY (TIMES). ;)

jk, i actually like perl somewhat.

but I think Larry and team went somewhat overboard with that human-style linguistics stuff that they applied to perl.

Re: Java at 30: Interview with James Gosling

#226
post #223

Earlier quoted context omitted.

One area where C# really messed up is exception handling. See https://mckoder.medium.com/the-achilles-heel-of-c-why-its-ex...

Java streams and a lot of other APIs are extremely ugly because of checked exceptions. Conversely, LINQ and delegates and a lot of other syntax is far cleaner in C#. Your linked blog is pretty wild. Only throw RuntimeExceptions to crash? Why not just Exit if that's the proper thing to do? If you treat all C# exceptions as RuntimeExceptions, then it satisfies the blog anyhow.

> Why not just Exit if that's the proper thing to do?

Because you won't get a stack trace.

Re: Java at 30: Interview with James Gosling

#227
post #18

Earlier quoted context omitted.

> Java memory management seems weird from a Unix Philosophy POV, till you understand whats happening. Again, not perfect, but a good tradeoff. The GC story is just great, however. Pretty much the best you can get in the entire ecosystem of managed-memory languages. You have different GC algorithms implemented, and you can pick and tune the one that best fits your use-case. The elephant in the room is of course ZGC, w…

I'm honestly amazed people say this about Java, because the language almost couldn't be worse at giving you tools to use memory efficiently. There's no value types (outside primitives) and everything is about pointer chasing. And surely if there was less pointer chasing it'd be easier to do the GC work at the same time.

When people talk about GC performance they’re not talking about using memory efficiently. They’re talking about how fast the GC can allocate and how long it will stop the world when it needs to collect. In both of these areas you won’t find GCs better than the ones provided by HotSpot. Even with what you mention, pointer chasing and lack of structs, they still outperform other implementations.

Re: Java at 30: Interview with James Gosling

#228
post #45

Earlier quoted context omitted.

I often run into problems running Python code under Linux. I don’t know if it is a me problem or if I’m missing the right incantations to set up the environment or whatever. Never had that much problems with Java. But I’m a Java and Ruby person so it might really be missing knowledge.

It's not you. Python packaging has regressed into a worse mess than it was 20 years ago. I limit myself to simple scripts that only rely on builtins. Anything more complicated goes to a more dependable language.

what languages do you use for the latter?

Re: Java at 30: Interview with James Gosling

#229

Earlier quoted context omitted.

It's not you. Python packaging has regressed into a worse mess than it was 20 years ago. I limit myself to simple scripts that only rely on builtins. Anything more complicated goes to a more dependable language.

I rarely run into issues when using Poetry. If you use pip, add packages to requirements.txt willy-nilly and don't pin versions then you are asking for trouble.

i like poetry though i've moved to uv - both work really well

Re: Java at 30: Interview with James Gosling

#230

Earlier quoted context omitted.

The reason I prefer the Go ecosystem to Java is cultural, rather than technical. Sure, the JVM is very impressive and the language has been evolving, but the culture around Java seems to encourage needless complexity. Of all the languages I've had to work with trying to get to know unfamiliar code-bases, it's the Go codebases I've been quickest to grok, and yielded the fewest surprises since as the code I'm looking f…

The don't embrace that culture. Embrace a simpler culture. Strive for simplicity. Push for fewer dependencies. Simple example, JAX-RS running on top of Java SE. I agree, JAX-RS is not what one might call "simple". It IS complex, or I should say, it CAN be complex. But Happy Path, staying in the middle of the road, it's pretty sweet for knocking out HTTP backed services. The Jersey reference implementation will do mos…

You've made the project yours, nice! How many others work on it?

It's an uphill battle to convince my co-workers to do things my way.

Post reply on HN