On The God File

The mouse wheel flicked, and the page scrolled down. Into the depths of the page the sidebar slid, until finally, silently resting at the bottom.

2,000 some lines of code in a single file. Untested code sitting static and dead. It only came alive when someone would press a button on the website, and it only came alive in pieces.

If the person was logged in and if the person was an editor and if they were on the home page and if they were in edit mode and if and if and on and on. A line was indented, then the next indented some more, and the next indented some more until the code looked like a series of Christmas trees sprouting from the right side of the screen. Code was copied from sections into other sections, with a couple of words changed. An unknown legion of bugs was lurking and crawling around inside its rotten core.

The larger the file got, the harder it was to make sense of it all. The God File, we called it. It was a Frankenstein of our own making, born from the hands of inexperienced web developers with little oversight. We had no code reviews, no pull requests, no unit, integration, performance tests, or software delivery pipelines.

We had The God File, and we worshipped The God File. No one was to touch it, for fear of its wrath. As weeks went on and deadlines came and went, what was once a fun project turned into a nightmare. Every fixed bug seemed to cause two more. A Hydra of bugs. A Bug Hydra.

A decade later, it still haunts my dreams. When I learned the hard way, it stuck. If I could do it all again, I’d have little baby files with cute unit tests. I’d create tiny fluffy functions that do one thing and do it well. I’d create small, sunny islands co-existing peacefully.

Jared Porcenaluk Handshake Protocol Cover

Leverage my ten years of software engineering experience to find a tech job that matters, get hired, and get paid what you deserve.

It’s all in my book, Handshake Protocol – the step-by-step guide to getting hired as a software engineer.

↓ I'll get a dopamine hit if you share this post