Live data from Hacker News

Java at 30: Interview with James Gosling

thenewstack.io

251–260 of 437 posts

Re: Java at 30: Interview with James Gosling

#251

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

I don't know that I'd say "messed up", but I do wish C# had checked exceptions. I strongly believe that they are superior to non-checked exceptions, basically static type signatures but for error handling. It's a real pity that everything after Java seems to have abandoned the idea.

Re: Java at 30: Interview with James Gosling

#252

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'd prefer to use that one as it actually reduces boilerplate and improves correctness, the opposite to the outcome of using checked exceptions.

Reducing boilerplate is not a valuable goal in and of itself. The question is, does the boilerplate buy you something? I think that with checked exceptions it does. Having an explicit type signature for what errors a function can raise improves correctness a great deal because the compiler can enforce the contracts of those functions.

I agree that the Rust approach is good too, though I don't agree it has any strong advantages over the way Java does things. Both approaches are equally respectable in my view.

Re: Java at 30: Interview with James Gosling

#253
post #87
post #41

Earlier quoted context omitted.

The language has/had some rough edges that have been improved over the years, but the developer experience of using a strongly-typed, object-oriented language within a sturdy IDE like Idea is just second to none. The debugging process is so very straightforward. Java became synonymous with enterprisey bloated systems for good reason, but there is no pile of mud Java system that can't be stepped through cleanly with a…

I find these discussions have an interior split between the folks who are more concerned with getting the feature out now versus the folks who have had to keep a thousand ancient features running.

True, but it's also true that code spends 99% of it's lifetime in maintenance. That's the reason I am never impressed by tools that make it fast and easy to bootstrap.

Re: Java at 30: Interview with James Gosling

#254
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…

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

I write Java to pay bills and my eyes and fingers thank me everyday for sparing them from a sea of if err != nil. I won't even go(!) into the iota stupidly compared to Java's enums.

Re: Java at 30: Interview with James Gosling

#255
post #96

Earlier quoted context omitted.

> syntactically compatible with C++ Not. And certainly not semantically.

That’s just obtuse. Compare Lisp, Forth, APL, Prolog, Ada, or Fortran. Java is just C++ with a few twists. You can literally write code that will compile in both.

That's exactly how I meant it. Another alternative to Java at the time was Smalltalk, with different syntax. Choosing C++ syntax for Java was clearly a marketing move (as it was for C++) - we shouldn't underestimate network effect of familiar syntax.

I think Java succeeded for the same reasons C++ succeeded - built on familiar syntax, reasonably free and "supported by" a large company. Java being a decent language is a consequence of its success more than of its original design.

Re: Java at 30: Interview with James Gosling

#256

Earlier quoted context omitted.

For syntax, maybe this general Lisp advice will help: consider a normal function call, like f(a, b). To make this into a Lisp function call, drop the unnecessary comma (whitespace is enough to separate tokens) like f(a b), and then move the function name inside the parentheses, like (f a b). Applying operators that are considered "primitive" in other languages are syntactically treated the same as functions. So imagi…

it also has the threading operator or macro. i am not a clojure or lisp expert, just saying.

Clojure style threading macros are readily available for common lisp and scheme. Probably emacs lisp too.

Re: Java at 30: Interview with James Gosling

#257
post #102

Java is a great success story. Though, to be fair, James Gosling was the spark but has not been the steward. Even as early as Java 1.1 and 1.2 he was not particularly involved in making runtime, library, or even language decisions, and later he wasn't the key to generics, etc. Mark Reinhold has been the hand's-on lead since 1.1, first integrating early JIT's, HotSpot, the 1.2 10X class explosion, and has been running…

> dynamic language like Kotlin and Clojure,

Kotlin is not a dynamic language, it's statically typed, just like Java.

Re: Java at 30: Interview with James Gosling

#258
post #96

Earlier quoted context omitted.

> syntactically compatible with C++ Not. And certainly not semantically.

That’s just obtuse. Compare Lisp, Forth, APL, Prolog, Ada, or Fortran. Java is just C++ with a few twists. You can literally write code that will compile in both.

> You can literally write code that will compile in both.

An example, please.

Re: Java at 30: Interview with James Gosling

#259
post #229

Earlier quoted context omitted.

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

I use pipenv and it kind-of-works. Will try uv or poetry though - which one would you recommend?

Re: Java at 30: Interview with James Gosling

#260

Earlier quoted context omitted.

That’s just obtuse. Compare Lisp, Forth, APL, Prolog, Ada, or Fortran. Java is just C++ with a few twists. You can literally write code that will compile in both.

> You can literally write code that will compile in both. An example, please.

int fibonacci(int n) {

    if (n 
}

...if only the return type was "Crow" then you could .eat() that...

Post reply on HN