Blog

  • Not a Middy Fan

    I feel like those using Middy, and enjoying it, missed the whole “Promises were invented” thing. Nowadays you can just chain functions together. There is no need for all of this side-effects everywhere, global variables like process.env being passed around, and bizarre “thing piece | void” return values. Just have your handler being a Promise / Result chain.

    (more…)
  • Asking Copilot About Writing a New Programming Language

    Asking Copilot About Writing a New Programming Language

    Jesse: “Yo Copilot, if you were going to write a soundly typed language with managed effects that compiles to JavaScript, which language would you choose to write the compiler in?”

    (more…)
  • 3 Options to Avoid Side-Effects in Web Dev

    Side-effects (aka I/O) can make your code hard to test, understand, and change. In web dev, you have 3 options:

    1. Use languages that don’t have side-effects; Elm for UI, and Roc for API/CLI.
    2. Abstract away the side-effects using Effect-TS.
    3. Use Functional Core, Imperative Shell in TypeScript, which requires you to manually separate pure code from side-effects.
    (more…)
  • Avoid Optional Chaining and Optional Properties

    Functional Programmers learn pretty early that Maybe/Optional should be avoided if possible. While many languages have lifting abilities to make them easier to work with, they end up littering your code with multiple places you have to handle the case where the data simply isn’t there. This is one of the reasons you see “Parse, Don’t Validate” pushed so heavily; you no longer have to write so many unhappy paths in the code, just 1 in the beginning.

    (more…)