Showing posts from August, 2017

Having fun with Go slices

The fun

Go offers precious few data structures that can be generically typed: queue, map, and slice (including array).  This often leaves developers using slices, particularly ordered slices, for all sorts of use cases.  I thought it might be fun to create some utilities for slice manipulation, starting with a faster stable sort. I hope in Go 2 we can get generics so data structures like binary trees will be safer.

For those that aren't aware, a stable sort is a sort where two elements with the same key retain their same relative positions as they had in the input.  There are several sorting algorithms that support stable sorting, including merge sorts, insertion sorts, and bubble sorts.  Efficient implementations of the ever-popular quicksort are not stable.

I've had several use cases for a stable sort in the past so I thought it might be fun to take the stable sort from the standard library and attempt to make it concurrent to improve performance.  The standard library's so…

Engineering for Offline Workflows

Mobile devices have revolutionized how people use the internet.  Pulling some numbers from Smart Insights' mobile marketing statistics, we see that more minutes are spent on mobile devices than traditional desktop devices when measured globally.  The following image is telling:

However, growing up in a rural-ish area, I've noticed that data coverage is not necessarily commensurate with data requirements.  Even when it is, the cost of the data is often unaffordable.  Even in relatively wealthy countries with modern infrastructure, such as the United States, data rates can be quite high.

This introduces an interesting and important problem for those engineers trying to build applications that target the mobile space.  Users strongly desire to use their applications on mobile devices and using those devices as they were intended to be used is often impossible or unaffordable.  The challenge for the engineer is creating a solution that allows users to seamlessly use these applicatio…