Lazy Providers in Dig

If you haven't yet read my previous post on depedency injection in Go, please do so first. This post describes a simple technique to make dig's DI container even more powerful. All values provided by dig's container are singletons. The provider is called the first time the value is required…

Dependency Injection in Go

I recently built a small project in Go. I've been working with Java for the past few years and was immediately struck by the lack of momentum behind Dependency Injection (DI) in the Go ecosystem. I decided to try building my project using Uber's dig library and was very impressed.…

Promises as Values

I was recently working on a small JavaScript project in which I needed to perform several asynchronous operations sequentially. I had a collection of images on a page and I needed to fade each of them out one at a time. I ended up with a nice technique using Promises.…

Elixir's Secret Weapon

I recently began using a new(ish) feature of Elixir that completely transformed the way I build programs. I'm talking about the special form with. It can feel unfamiliar at first, but it is extremely powerful and flexible. This article will explain how with works and how it can be…

Another Perspective on Promises

I spent 9 months of this year working on a project using Java 8 and enjoyed it much more than I expected. Specifically, the addition of Optional made my code feel cleaner, more functional and less error prone. I had Java 8 on the brain when I tackled a small…