Still No Consensus on Testing Private Methods

Yesterday, while running a session at work on Rust, I offhandedly remarked ‘I think we can all agree that when writing unit tests, private methods shouldn’t be directly tested except in some special situations’ and to my suprise, I had thought wrong. A mini-debate erupted where v … | Continue reading


@jesseduffield.com | 2 years ago

Go'ing Insane: Crazy Conventions

First off, let’s get the standard caveats out of the way: | Continue reading


@jesseduffield.com | 2 years ago

Go’ing Insane: Endless Error Handling

I’ve been using Go for a few years now, mostly in my open source project Lazygit. In my day job I use Ruby and Typescript, and I’ve also spent some time with Rust. Each of those languages have design quirks that can grind a developer’s gears, and although my own precious gears ha … | Continue reading


@jesseduffield.com | 2 years ago

Anti-Pattern of the Day: Type Keys

Say we have a function which creates a user, and handles some specific setup depending on whether that user is an admin or a customer: | Continue reading


@jesseduffield.com | 2 years ago

Ranking the Four Approaches to Compound Components, from Worst to Best

Say we wanted to create an Accordion component that lets us expand and collapse sections within the Accordion, such that only one section can be expanded at a time. This is a good candidate for a Compound Component. Let’s first create an Accordion with three sections, without try … | Continue reading


@jesseduffield.com | 2 years ago

LSD and the Wrong Abstraction

Continue reading


@jesseduffield.com | 3 years ago

Confused about closures and 'this'? Check out my guide to JavaScript scoping

Continue reading


@jesseduffield.com | 3 years ago

Guide To Array Functions: Pick the least powerful tool for the job

Continue reading


@jesseduffield.com | 3 years ago

Beginner's Guide to Abstraction

Continue reading


@jesseduffield.com | 3 years ago

In React, the Wrong Abstraction Kills Efficiency

Continue reading


@jesseduffield.com | 4 years ago