1. 4
    1. 5

      The “Maybe Monad”

      ​​Oliver Steele came up with this method and

      Something about this citation fills me with unease.

      In any case, I feel I’ve read essentially this article a thousand times. The progression from here is typically “well if we’re going to program so defensively, why not use a language with types and a compiler?” Then there’s the usual mud-slinging and some spurious “studies” put forward to argue that types don’t actually help anything (but somehow, an ad-hoc naïve system of type annotation does), a guy will write some Medium thinkpiece in which he quotes himself, and then the classic false dichotomy of types vs tests, as if we’re forced to choose. If you complete this within the time limit, you’re teleported to the bonus boss fight: an old guy who’s adamant that programming is about discipline, and that C++ is a “man’s language”.

      Invariably, go back to square one. Do not pass Go. Do not collect $200.

      1. 1

        Something about this citation fills me with unease.

        Relax. Clearly they mean that Oliver Steele came up with:

        const favoriteBook = ((favorites.reading||{}).books||[])[0]; // undefined

        and not with the “Maybe Monad”.

        In any case, I feel I’ve read essentially this article a thousand times. The progression from here is typically … RANT … (emphasis is mine)

        If you continue reading the article you’ll actually find the natural progression the article is trying to take, also labelled adequately. The last section is literally called “The future: optional chaining”.

        I do understand your dissatisfaction, though I feel this article is a poor fit to pour it on. Compared to many other articles, some of which are even considered legendary, this one is quite opinion-less, and we shouldn’t forget that science shouldn’t be opinionated.

        1. 1

          we shouldn’t forget that science shouldn’t be opinionated

          I don’t disagree, but I also don’t see much science happening in our industry. As Alan Kay said, programming today is mostly pop culture.

          This is relevant because it’s not strictly the article in isolation that’s a problem, but rather the culture around it in our industry. Personally, I jump off around the point of using a “better” language with types and a compiler — I don’t think it makes much sense to invest in making JavaScript or its use better, because I think starting with a more fundamentally sound tool is a cheaper path to go down.

          Ultimately — and unsurprisingly — I think technologies should be used idiomatically. I don’t think trying to reconstruct types and monads in JavaScript is idiomatic. If it’s types and monads you want, use a technology designed for it.

          1. 1

            Fair enough. I find your points quite reasonable, except for

            starting with a more fundamentally sound tool is a cheaper path to go down.

            I’d like to believe that’s true, but I’ve seen no empirical evidence that strongly suggests that.

    🇬🇧 The UK geoblock is lifted, hopefully permanently.