News for hackers. Stuff that matters.
Re:Java 26 is here, and with it a solid foundation for the f... by oefrha on Tuesday March 17, 2026 @07:17PM (#47419658)
> No immutable types (in Go)

The typical answer is opaque types with only readonly methods exported. Not elegant, but it’s there. I guess it’s arguably not a “good way” to do it.

Re:Java 26 is here, and with it a solid foundation for the f... by joeblubaugh on Tuesday March 17, 2026 @07:42PM (#47419868)
In fact it was “the Java way” for many years and “useless getters” was always a big complaint about Java.
Re:Java 26 is here, and with it a solid foundation for the f... by oefrha on Tuesday March 17, 2026 @07:53PM (#47419977)
Hey it's better in Go. In Java it's getFoo(). In Go it's just Foo(). Saves three bytes, and three keystrokes if you program by hand and don't autocomplete!
Re:Java 26 is here, and with it a solid foundation for the f... by gf000 on Wednesday March 18, 2026 @03:33AM (#47422673)
I do agree to a certain degree, but with getters/setters you could properly hide/set to read-only fields.