Fergus In London

The musings of a man with a keyboard and an internet connection.

Automating Code Generation With Docker

2019-04-11 4 min read

Code generation can be really useful; need to generate some models from an OpenAPI spec or a Protocol Buffer definition? No problem! Unfortunately in a team environment this can pose a few problems though: What happens when new members of staff join the team and have newer versions of the generation tools? Should generated files be checked in source control - and if so, how can you ensure that no manual modifications are present?

Continue reading

Data Transformations for APIs via Struct Composition in Golang

2019-03-11 8 min read Fergus

I enjoy writing Go. It lacks the magic and obfuscation present in other languages, whilst possessing an intuitive syntax that still allows the concise expression of complex ideas. It’s awesome.

What’s less awesome, unfortunately, is that the flexibility of the language often leads to it’s simplicity being overlooked; and this is no more apparent than in data transformation layers. If you find yourself regularly writing convulated transformers, then there’s a good chance that you’re not actually understanding the language properly.

And what’s the point in writing Go if you’re simply going to write Java/C#/PHP?

Continue reading

Add some style to your code

2018-04-25 3 min read Fergus
If there’s one thing developers are renowned for, it’s arguing over the style of their code. The drama inspired by topics such as “tabs or spaces” or “should brackets go on their own line?” is second only to that timless classic of a question - “vim or emacs?”. Beyond the message board arguments and the workplace debates, there exists a very real issue though: write in a poor style and it becomes difficult to read and understand, whilst writing in an inconsistent style simply looks lazy and rushed. Continue reading

Stop with the one function Javascript "libraries", please.

2018-04-12 4 min read Fergus
I get it: you need some CV-filler. The job market is competitive, and getting your name out there is important, but can you not do it by publishing 5 line npm modules, please? You’re actively harming the Javascript ecosystem. Enter the Reddit discussion “When a modulus call is published as a NodeJS package with millions of downloads a day”, and the story of one particular character who has published a number of one-function NPM modules. Continue reading

When "Design Patterns" become "Anti-patterns"

2018-04-07 4 min read Fergus
As a software engineer, learning about design patterns was a kind of “Eureka” moment. It was the moment where I finally began to look at architectural issues, and how to structure a piece of software. I began to think of software as more of a mechanical system, one where different entities and objects could be thought of as cogs, each interacting with eachother to perform a larger task - i. Continue reading