Guard Clauses – How to Clean up Conditionals

Guard Clauses - How to Clean up Conditionals

One of the first concepts new developers learn is the if/else statement. If/else statements are the most common way to execute conditional logic. However, complex and nested if/else statements can quickly become a cognitive burden and compromise the readability of a program. Guard Clauses Guard Clauses leverage the ability to return early from a function … Read more

Create a Golang Video Streaming Server Using HLS – A Tutorial

Video Streaming Server In Go Using HLS

In this tutorial, I’m going to walk you through building a Golang video streaming API (this works for other types of media as well!). Don’t worry, its surprisingly easy to build a robust media streaming server, especially if we utilize one of the more modern protocols, HLS. What is HLS? HTTP Live Streaming is an … Read more

Should You Return Empty or Nil Slices in Go?

Empty vs Nil Slices in Go

In Go, we are often returning zero values. Idiomatic Go encourages the use of guard clauses, and guard clauses necessitate the need to return early. When returning early with an error, by convention all other return values should be zero values. The confusion arises with data types like maps and slices… should they be nil, … Read more

Slow Is Smooth, Smooth Is Fast – 25% of Our Time Refactoring

Slow Is Smooth, Smooth Is Fast - Refactoring

My team has been spending less of our “free” time working on bugs and features from the backlog, and more time refactoring our codebases and test suites. As a result, and perhaps somewhat counterintuitively, we’ve noticed a significant increase in our throughput of features and bug fixes. As it turns out, its easy to find … Read more