More vibrant Go in 3 moves

January 25, 2014 Abhijit Hiremagalur

Move 1: Describe interactions with roles

Go’s interfaces are satisfied implicitly, making it incredibly easy to create role interfaces.

Describing new roles as we implement a method lets us postpone deciding how we’ll meet its needs. Conveniently, our method is specific about what we know and open to what we might learn.

Move 2: Extend existing code with adapters

The humble adapter finds new utility in existing code without modifying it. Leaving existing code unmodified also avoids rippling changes through its existing consumers.

Adapters turn out to be especially powerful at the boundaries of our applications. They can shift the shape of an open source library and shield the internals of an application from changes to these libraries.

Last Move: Keep creation and interaction apart

When interaction is independent of creation, an implementor can be replaced with another without affecting the interaction.

This lets us change the behavior of our system more easily, has immediate benefits in test isolation, and also leaves room to discover uses our younger selves might not have imagined.

In combination, these 3 simple moves let us reconnect existing dots to draw new pictures. Each picture apt for its time.

About the Author


HCI Connect Podcast with Nina Mehta
HCI Connect Podcast with Nina Mehta

Tucked under warm blankets in below freezing Chicago weather on my birthday, I got on a video chat with tw...

Faraz Khan and Don Goodman-Wilson – Screenhero
Faraz Khan and Don Goodman-Wilson – Screenhero

Faraz Khan and Don Goodman-Wilson of Screenhero give an overview of the engineering challenges involved in ...

SpringOne 2021

Register Now