Blog

  • Using the Builder Pattern for Elm Components

    I had the opportunity to build some components and quickly found many needed a lot of parameters. Below is a strategy on how to make them less verbose, type safe regardless of order, and it won’t cause existing code to break when you add new features.

    (more…)
  • Avoiding Primitive Obsession in 6 ½ Programming Languages

    Primitive Obsession is problem where you have a function with multiple parameters of the same type. This causes a risk that you’ll get them in the wrong order, it causes readability problems, and can cause compiled languages to “compile” but still result in incorrect code when it runs.

    (more…)
  • Trunk Based Development Retro

    I’ve been testing out trunk based development for a few months, here are some of my initial thoughts. It was inspired by @davefarley77‘s series of videos on building pipelines and his “Don’t Branch”

    (more…)
  • How to use Dependency Injection in Functional Programming

    Dependency Injection is a technique to make the classes in Object Oriented Programming easier to test and configure. Instead of a class instantiating its own concrete implementations, it instead has them injected into it. In Functional Programming, that’s a fancy way of saying “calling a function with parameters”. However, it’s not that these parameters are data, but rather the same thing type of dependencies you’d use in OOP: some type of module or function that does a side effect, and you want to make your function easier to test.

    In this article we’ll show you how OOP uses DI to make the classes easier to test, then we’ll show the same technique in FP using JavaScript for both implementations. Code is on Github. After reading this you’ll understand how to make your FP code easier to test and configure, just like you do in OOP style coding.

    (more…)