Photo by Jason Rosewell on Unsplash

Ever wondered how a sampled wave gets turned back into an analog wave for your speakers? The answer is not as simple as you may think.

In doing my own research I ran into a lot of maths and explanations that took me some time to fully understand and appreciate. The goal of this article is to explain one method for reconstructing a waveform from samples, presented in a way that should be consumable by someone that doesn’t have a heavy maths or engineering background.


I am not an expert by any means, but I do intend the scientific information…

Photo by Michael Dziedzic on Unsplash

V is a language I’ve been playing around with very recently and I’ve been looking for a new project to get stuck into. So I thought it was time to build another SQL database to get a feel for the language, but also provide a worthy database for the V community:

Really, another SQL database… is that really necessary? Well, yes, I think so. The goals are (all of which are implemented):

  1. vsql is written with in pure V with no dependencies, including V dependencies.
  2. vsql can be embedded (like SQLite3) with the entire database stored in a single…

Photo by Nick Fewings on Unsplash

I’m a big fan of TDD. BDD has always been a bit elusive to me in the sense that I wish I could use it more often. However, I always seem to end up struggling to express the same nuances through BDD that come effortlessly through a standard test case.

Truth be told, I have’t touched BDD in a while. However, this question has been bouncing around my head lately:

Why is it often so difficult to express simple systems through BDD?

Code based tests are really good at describing how we complete a task. BDD is really good at…

Photo by DDP on Unsplash

Go’s error handling is very explicit. It can also be very verbose compared to other languages. I want to talk about how we can minimize the need for explicit error handling by separating what are expected and unexpected errors.

Expected Errors

An expected error is generally something you can test/check/verify ahead of time or that would not have a detrimental effect on the system. Some examples of expected errors are:

  1. Validating an email address from an input.
  2. Verifying that a user has access to a certain part of the system.
  3. Retry on a known flaky or slow API endpoint.

Expected errors should…

Photo by Javier Allegue Barros on Unsplash

Go does not have any concept of enums like some other languages. There are arguments for and against this approach which I won’t go into here. However, there are times when you want to check that switch statements contain all enum values. Especially if you intend to add new enum values in the future and want to catch existing code that now needs to be updated accordingly.

For this, I developed a tool called switch-check. It’s a zero dependency, zero configuration CLI tool for doing just that. You can try it right now with:

go get -u


Photo by John Schnobrich on Unsplash

It’s a common scenario — for me at least — to be building a CLI tool (main package) that has CLI options (flags package) that I want to add unit tests to.

Here’s a simple example of a CLI tool that adds or multiplies some input numbers:

Let’s try it:

5 + 7 + 9 = 21 — great… But wait! 3 * 2 * 5 != 0…I’ve put a deliberate bug in the command. Something that we will catch and fix with a unit test.

Don’t Try This At Home Kids

Let’s write a unit test that uses the same CLI arguments so…

Photo by Jonah Pettrich on Unsplash

An ordered map (also called a linked hash map in Java) is a data structure that allows amortized O(1) for access and mutation just like a map, but the elements maintain their order.

For this I created the package. Here is some basic usage:

m := orderedmap.NewOrderedMap()// Keys and values can be any type.
m.Set("foo", "bar")
m.Set("qux", 1.23)
m.Set(123, true)
m.Delete("qux")value, exists := m.Get("qux")

The most important feature of the *OrderedMap is that the order of the keys is maintained, so that we can iterate them in their creation order:

for _, key := range m.Keys() {…

Photo by Florian Steciuk on Unsplash

Go ships with great tools for runtime performance monitoring. However, for one of the projects I am working on I needed tailored metrics around three channels that do the primary communication between the larger components of the processing service.

I wanted to be able to print realtime stats on movement and blocking of these channels only each minute. So I created ChannelPerf :

How does it work?

For the most part it is a drop in replacement-ish with how you would normally use a channel:

// ch := make(chan interface{}, 1)
ch := NewChannelPerf(1, "Some name")
// ch <- "foo"
// next…

Photo by Franck V. on Unsplash
display "Hi, I'm bento."

What is bento?

bento is a forth-generation programming language that is English-based. It is designed to separate orchestration from implementation as to provide a generic, self-documenting DSL that can be managed by non-technical individuals.

Wow, what a mouthful… That’s a bunch of fancy talk that means that the developers/engineers can setup the complex tasks and make them easily implementable by non-technical people through (almost) plain English.

The project is still very young, but it has a primary goal for each half of its intended audience:

For the developer/engineer: Programs can be written in any language (called a…

Elliot Chance

I’m a data nerd and TDD enthusiast originally from Sydney. Currently working for Uber in New York. My thoughts here are my own. 🤓

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store