Splitting a String into a Slice in Golang

splitting a lemon

I can’t begin to tell you how often I split strings in Go. More often than not I’m just parsing a comma-separated list from an environment variable, and Go’s standard library gives us some great tools for that kind of manipulation. Split by commas or other delimiters strings.Split strings.SplitN Split by delimiters and retain the … Read more

Backend Developers are UX Designers Too

design notebook

Too often I neglect the idea of UX design in backend work. The goal of user experience design is to give users a product that’s easy to use. In the world of front-end development, that typically means making it obvious how to navigate your site, using commonly-understood icons, or implementing well-contrasted colors for foreground and … Read more

All the Ways to Write for Loops in Go

loop architecture

A for loop executes a block of code repeatedly, and in Golang, there are several different ways to write one. The standard three-component loop For-range loop Range over slice Range over map Range over channel Range over string While loop Optional components loop Infinite loop Break from a loop Continue (skip to the next iteration) … Read more

Naming Variables the Right Way

yelling at computer

I’ve noticed that more and more often that bugs introduced into an existing codebase are due to the poor naming of variables way more often than I think you would expect. Someone uses a rateLimit variable expecting it to be denominated in seconds but instead, it’s in minutes, resulting in a wildly different polling schedule. … Read more