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

Go Generate: Quick, Easy, and oh so Powerful

2019-02-24 4 min read Fergus
If you’ve had the misfortune of talking to me about development over the past year, you may well have noticed me evangelising about Go. It’s true: I’ve become guilty of something I previously mocked colleagues for. Perhaps it’s because the book “The Go Programming Language” reminds me of the first ever programming book I picked up - “The C Programming Language” - when I was around 13? Maybe it’s the simplicity and distinct lack of “magic” that the language has? Continue reading

Docker multi-stage builds are awesome.

2018-05-23 3 min read Fergus
I have a new found love of Docker; despite my early frustrations with CoreOS (as it was) in 2015, I have come to love the simplicity and encapsulation that containers provide. Run a single command and whoosh - you now have a completely functional unit that runs whichever package you require, and it’s nice and isolated too: awesome! In contrast though, I have no love for build processes: you’re always one step away from dependency hell, small environmental issues can prove to be show-stoppers, and you end up polluting your development or build environment with various tools and libraries. Continue reading

Utilising the Docker Engine API

2018-04-29 3 min read Fergus
Docker has cemented itself as a mainstream technology, not only for the development and deployment of web services, but also the isolation of Linux applications that need to be ran in a controlled or sandboxed environment. Whilst the docker CLI is brilliant, it can be difficult to expose this to custom utilities, or to present it’s output in a user friendly way - such as the way that Docker Swarm Visualizer does. 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

Having a spring clean, and "washing" my Github account

2018-04-18 5 min read Fergus
I’ve been “active” on Github for about 5 years; and whilst that doesn’t mean I’ve been commiting code daily, nor have I been using their more social features, it does mean I’ve built up quite the collection of.. well, pretty awkward and embarassing code. Over the past couple of months I’ve tried to streamline a lot of my online presence: I have this blog for technical topics, whilst I have musings. 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

The Rise of the Function-As-A-Service

2018-04-03 4 min read Fergus
“Functions as a Service” are becoming quite a common component in complex web services; they allow energy conservation - and thus cost reduction - via only utilising resources when required. The daddy of FaaS providers is AWS Lambda, as it ties nicely in to other AWS services like the AWS API Gateway, SQS and S3. There are other providers though, such as Google’s Cloud Functions or Microsoft’s Azure Functions. Continue reading
Older posts