• (nodebb)

    Can't believe I got to make the frist comment!

    Also can't believe there's not a ton of comments already. Maybe comments are "Optional" today?

  • Randal L. Schwartz (github)

    Optional.of(scneod)

  • (nodebb)

    On it's own, it's not bad

    One of those "it's"es is wrong. Shouldn't the Editor-in-Chief know the difference?

  • Hmmmm (unregistered)

    "Buggy" seems a bit off. What's a word for "full of bad/messy practices that are hard to refactor"? How about molasses code?

  • (nodebb)

    Optional is IMHO the worst pattern. It really exists only because Java took forever to "natively" support non nullable types like the Kotlin var? / var! pattern. It's really a bad workaround.

    (And don't get me started with Typescript where it's just sugar and a variable declared as non null can still manage to be undefined at runtime!)

  • A Human (unregistered) in reply to Ralf

    WRONG. Optional is the correct way of expressing this. It is a data structure that allows you to explicitly declare that some place that would normally hold a value may not have a value.

    What's completely mentally insane is treating uninitialized memory not as a bug that will crash the program in the best case, but as a language feature that can be used to idiomatically express a value that is not present, but then because that actually isn't wanted all the time, we create "non nullable types".

    Optional isn't bad workaround for the lack of non nullable types, non nullable types are a bad workaround for null.
    Sincerely,
    a functional programmer.

  • (nodebb)

    Cleared for the option..

  • Chico (unregistered) in reply to keigezellig

    Person @keigezellig is a pilot

Leave a comment on “Always Take the Option”

Log In or post as a guest

Replying to comment #703215:

« Return to Article