Hi, I'm Noel Welsh. I write software and books, and work on other projects in the software space.

Latest Writing

  • Enough: A Review
    14 March 2021

    "I was three when the elephants ate the house next door," opens a paragraph on page 108 of my copy of Enough, the new book by Dr Cassandra Coburn. It encapsulates a lot of what I like about this book: it deals with important issues but it's also a lot of fun.

    Continue reading

  • Techniques for Understanding Code
    29 July 2020

    Building an understanding of code is one of the main tasks in software development. Whenever we want to answer a question about code—what is this doing? why doesn't it work? how can we make it faster?—this is what we're doing. I have found it valuable to consciously surface the strategy I use to answer these questions, and have categorized my approaches into three groups:

    1. reasoning about code;
    2. inspecting running code; and
    3. referring to an authoritative source.

    In this post I will discuss these different ways of understanding code and their benefits and drawbacks.

    Continue reading

  • Scoring Ten-Pin Bowling with Algebraic Data and Finite State Machines
    18 July 2020

    I recently led a training session where we implemented the rules for scoring ten-pin bowling in Scala. It makes for a good case study. It’s small enough that you can pick up the rules in a few minutes, but the dependencies between frames makes calculating the score non-trivial. I decided to implement my own solution which turned into an interesting exercise in algebraic data and finite state machines. In this post I'll describe my implementation and my process for developing it.

    For my implementation I solely focused on scoring the game. I didn't implement any parsing code, as that part of the problem didn't interest me.

    Continue reading

  • What Functional Programming Is, What it Isn't, and Why it Matters
    05 July 2020

    The programming world is moving towards functional programming (FP). More developers are using languages with an explicit bias towards FP, such as Scala and Haskell, while object-oriented (OO) languages and their communities adopt FP features and practices. (A striking example of the latter is the rise of Typescript and React in the Javascript community.) So what is FP and what does it mean to write code in a functional style? It's common to view functional programming as a collection of language features, such as first class functions, or to define it as a programming style using immutable data and pure functions. (Pure functions always return the same output given the same input.) This was my view when I started down the FP route, but I now believe the true goals of FP are enabling local reasoning and composition. Language features and programming style are in service of these goals. In this post I attempt to explain the meaning and value of local reasoning and composition.

    Continue reading

  • Scala with Cats 2
    16 March 2020

    Scala with Cats 2 is underway, with a fancy new website. Go and join the mailing list linked from the site if you want to keep up with the latest developments.

    Continue reading