Learn Go by Building a Bus Service

Go is a pragmatic language. It’s about getting stuff done. This allows for a more direct coding style that I personally find to be a relief from the “classic” object-oriented coding styles with their proliferation of class hierarchies. With Go, we can still take advantage of many relevant design patterns without getting distracted by having to write getters, setters, factory classes and complex class hierarchies. Design patterns are fundamentally just recipes - or best practices - for how to approach certain classes of problems. [Read More]

How to Learn a New Programming Language

Want to pick up a new programming language? Great! I personally think that the landscape of programming languages has never been more exciting than it is now - there are a multitude of languages to pick from, and a true professional is polyglot (from Wikipedia: Polyglotism or polyglottism is knowledge of several languages, consisting of the ability to understand, speak, read, or write these languages). I won’t help you pick a language from the pile - that is entirely based on your coding level, language skills, ambitions and the direction that you’d like to take your career in. [Read More]

The Flyweight Pattern in Go

Definition: In computer programming, flyweight is a software design pattern. A flyweight is an object that minimizes memory usage by sharing as much data as possible with other similar objects; it is a way to use objects in large numbers when a simple repeated representation would use an unacceptable amount of memory. In the following, I’ll demonstrate the Flyweight Pattern with two examples in Go. First, I’ll optimize two memory-based caches that rely on the same underlying data, and then I’ll optimize another cache that contains repetitive data. [Read More]