Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    B

    Brian Goetz

    cr.openjdk.java.net/~briangoetz · Personal blog · on HN since 2010

    Brian Goetz, Java language architect at Oracle, publishes design documents on Java features like records, pattern matching, and Valhalla.

    Visit blogHN submissions
    Languages & CompilersProgramming
    What HN says

    HN links it for authoritative explanations of Java language design, such as why records were chosen over tuples and how specialization addresses erasure.

    Stats for nerds
    53HN people shared it
    26linked in comments
    1.1Kstory points
    Oct 2022last shared
    2014people per year2022

    Top posts on HN

    1. 1
      Pattern Matching for Java
      8 people · 371 points · first shared 2017 · 146 comments on HN
    2. 2
      Data Classes for Java
      15 people · 268 points · first shared 2017 · 205 comments on HN
    3. 3
      The Road to Valhalla
      7 people · 143 points · first shared 2019 · 81 comments on HN
    4. 4
      State of the Specialization: Generics over primitives in Java and JVM
      2 people · 83 points · first shared 2014 · 1 comments on HN
    5. 5
      Background: how we got the generics we have (2020)
      1 person · 68 points · first shared 2021 · 101 comments on HN
    6. 6
      State of the Lambda
      2 people · 65 points · first shared 2011 · 43 comments on HN
    7. 7
      State of the (Java) Lambda
      2 people · 32 points · first shared 2010 · 9 comments on HN
    8. 8
      How Java got the generics it has (by Brian Goetz)
      4 people · 8 points · first shared 2020 · 1 comments on HN
    9. 9
      Towards Better Serialization in Java
      4 people · 7 points · first shared 2019 · Discussion on HN
    10. 10
      Language Model for Inline Classes in Java
      3 people · 4 points · first shared 2019 · 1 comments on HN

    What HN people wrote when they linked it

    • signal11Feb 2018

      > Sun could have (and should have) copied them in Java, and I don't know why they didn't.

      I had always assumed that, initially, Sun was distracted by the Oracle acquisition. But there's also a philosophical / design principle in Java which tends towards being conservative about what features they add, for instance see this discussion thread [1,2] about adding a Pair class into java.util. Given the wide deployed footprint of Java across platforms, one can even sympathize with this.

      There is also the central Java philosophy (which also influences the Pairs/Tuples discussion) that "names matter"[3]. I would argue that in my experience, in some contexts, especially in the server-side enterprise context where Java is very popular, names don't always matter, which is why developers keep asking for Pairs and Tuples and keep complaining about Java's verbosity -- because Java forces them to care about things they don't really care about (another great example is checked exceptions).

      C# to me is like a "mirror universe" Java, where the underlying philosophy is to add features if they make a developer's life simpler. As a result, C# "feels" nicer to use and in the right hands can result in (subjectively) nicer code. In JVM land, this also explains why so many developers like Kotlin.

      In reality, developers can write unreadable code in both languages. Although my main criticism of Java is that they probably shouldn't be that dismissive of Lisp, there are some good ideas there, as…

    • adriaanmJul 2014

      I agree with most of your comment. Thanks for writing it down!

      First, the agreement:

      Yep, structs are a VM thing. We are very excited about Project Valhalla (http://cr.openjdk.java.net/~briangoetz/valhalla/ etc).

      Refactoring in a dependently typed language is hard. There's room for improvement. Scala-refactoring is a great example of community contribution.

      Scala style checking is on our roadmap for 2.12. I'm procrastinating reviewing the first PR for the tool (abide) right now.

      Finally, I would like to clarify we are doing everything we can think of to encourage the community to help shape the design and implementation of Scala. We publish roadmaps, review (and even rework) community PRs, do most of our team comms publicly (we are a distributed team), solicit proposals for language changes (e.g., http://docs.scala-lang.org/sips/pending/42.type.html). We spun out library modules that are now being maintained by the community. I spent last year simplifying the core build, so that we can move to a standard sbt build this year, which should also make it easier to contribute. As a first step towards updating the [spec](http://scala-lang.org/files/archive/spec/2.11/), we converted it to [markdown](https://github.com/scala/scala/tree/2.11.x/spec).

      That said, I think it's only natural that the Scala committers on Typesafe's payroll are more inclined to work on customer support issues / internal Typesafe support. We always try to strike a fair balance to give back to the…

    • dtechMar 2018

      I really like (and work in) Scala, and Scala native is an interesting project.

      However, its use cases seem to be encroached on all fronts.

      If you want native, performance and don't need the JVM ecosystem, Rust and go both take very different but good approaches to that problem. I would have a hard time recommending Scala Native over Rust.

      If you want browsers, Javascript is rapidly evolving and becoming a better lanuage. Typescript adds an excellent type system given the constraints its working with. Webassembly opens the door to use your own favorite. I would have a hard time recommending Scala.js over Typescript.

      If you want JVM, Java is adopting traditional Scala killer features at a glacial pace, lambda's in 8, pattern matching in 11+ [1], Data/Case classes in ? [2], but adopting them nonetheless. Kotlin has succesfully performed a Blitzkrieg maneuver on Scala's "better Java" territory and has full support from Google in Android. It's also much more approachable for Java devs. I have a hard time convincing JVM devs that Scala is a good choise over Kotlin. At the place I work in all new projects are Kotlin, and Scala is used for the projects that were started in it.

      Python and R are mainstays in the data science world, with Spark serving as a sort of Scala bastion.

      I like scala, and follow its developments and 3.0 (Dotty) version somewhat, but I am slowly seeing it dwindling into irrelevance.

      [1] http://openjdk.java.net/jeps/305
      [2]…

    • kasperniFeb 2020

      That is by design (https://cr.openjdk.java.net/~briangoetz/amber/datum.html)

      Why not "just" do tuples?

      Some readers will surely be thinking at this point: if we "just" had tuples, we wouldn't need records. And while tuples might offer a lighter-weight means to express some aggregates, the result is often inferior aggregates.

      Classes and class members have meaningful names; tuples and tuple components do not. A central aspect of Java's philosophy is that names matter; a Person with properties firstName and lastName is clearer and safer than a tuple of String and String. Classes support state validation through their constructors; tuples do not. Some data aggregates (such as numeric ranges) have invariants that, if enforced by the constructor, can thereafter be relied upon; tuples do not offer this ability. Classes can have behavior that is derived from their state; co-locating state and derived behavior makes it more discoverable and easier to access.

      For all these reasons, we don't want to abandon classes for modeling data; we just want to make modeling data with classes simpler. The major pain of using named classes for aggregates is the overhead of declaring them; if we can reduce this sufficiently, the temptation to reach for more weakly typed mechanisms is greatly reduced. (A good starting point for thinking about records is that they are nominal tuples.)

    • kjeetgillOct 2022

      Hey, sorry if it came across as condescending, I really didn't mean it to be. All I wanted to say was I don't think the choice is obvious and leave a few googleable buzzwords for anyone interested to go read up more on it.

      I don't think I took a stance pro/anti erasure other than to say I think it's way more complicated a topic than it might seem (maybe not to you, but likly to others!) and it's worth reading up on. AND I didn't want to dig up old HN comments/posts to confirm what I'd read about it, so I was necessarily vague.

      Edit 1:
      For instance, I vaguely recall that Scala head trouble porting to C# because of erasure related stuff. But I'm not genius enough to remember the details so I didn't get into it.

      Edit 2: So I dug one up: https://cr.openjdk.java.net/~briangoetz/valhalla/erasure.html
      And posted here https://news.ycombinator.com/item?id=33171832

      Edit 3: Other good conversations on it: https://news.ycombinator.com/item?id=18679684
      https://news.ycombinator.com/item?id=13051594

      Again, my only stance is that it's a surprisingly deep topic — Not making any claims!

    • pronJan 2020

      I meant that it's worked out pretty well for Java. ML -- one of my favorite languages, alongside Java and a couple of others -- has also managed to avoid being used by anyone, really. But look at Java now: it has generics and higher-order functions, and it's getting a uniform treatment of types (Project Valhalla), and pattern matching [1]. And so while ML introduced those features in a research context, Java is the language that has made and will make the world actually use them. Being ahead of your time is often just as much of a mistake as being behind (as far as product design goes).

      As to the question of "holding programming back," it is yet to be seen how much of an impact these features have in practice. Same goes for what ML "lacked." I personally like some features more and some less, as do you, but I don't think anyone knows which programming language features really push programming forward.

      [1]: https://cr.openjdk.java.net/~briangoetz/amber/pattern-match.html

    Related

    Inside Javainside.java66 people

    Strings Just Got Faster

    Inside Java
    Company · last shared 2026
    Ron Presslercr.openjdk.java.net/~rpressler40 people

    State of Loom

    Ron Pressler
    Personal · last shared 2022
    Mark Reinholdmreinhold.org21 people

    Project Jigsaw: Complete

    Mark Reinhold
    Personal · last shared 2022
    codecentric Blogblog.codecentric.de70 people

    String Deduplication – A new feature in Java 8 Update 20

    codecentric Blog
    Company · last shared 2023
    Gunnar Morlingmorling.dev56 people

    The One Billion Row Challenge

    Gunnar Morling
    Personal · last shared 2026
    CodeFXblog.codefx.org22 people

    What Future Java Might Look Like

    CodeFX
    Personal · last shared 2019
    John Rosecr.openjdk.java.net/~jrose29 people

    Value Types for Java – A sketch of proposed enhancements

    John Rose
    Personal · last shared 2021
    Herb Suttergotw.ca84 people

    Ritchie, Stroustrup, and Gosling interview

    Herb Sutter
    Personal · last shared 2026