Hack Everything ... To Pieces!
Programming is awesome. It is, without question, one of the most enjoyable things you can do with your time. That said, there is one thing you can do to substantially increase your personal joy and happiness while coding: HACK EVERYTHING INTO PIECES!
I’m sure you see where I’m going with this by now :)
I often find myself working on complex software. While I find it incredibly fun and challenging, it certainly comes with risks. One of the greatest risks is over-complication.
It is way too easy to become so engaged in your work that you continue building and building without thinking about the implications of what you’re doing. I find that when I’m building things, I tend to put all my focus into the task at hand, and completely disregard everything around me ‘till I’m done. More often than not, this leads to disaster.
If you’re not analyzing what your overall objective is as you’re hacking, there will be problems!
Over-complication is the worst problem in software development. It causes bugs, confusion, anger, and even death! OK, so you probably won’t die from over-complication, but hey, don’t risk it (especially if you’re writing medical software >:0).
One thing that always bothers me is looking at what should be a simple piece of code, just to find that the author horribly overcomplicated the whole thing. It happens to all of us from time to time, but it can be avoided.
The One True Way
There is only “one true way” to write software: the UNIX way. If you’re an experienced programmer, you’ve probably kept these words close to your heart for a long time. Nevertheless, here they are again:
Write programs that do one thing and do it well.
When you find yourself working on complex software, the best thing you can do is to keep things simple. While there are certainly situations where a brute force mentality is required to make progress, more often than not, it’s a much better idea to break whatever you’re doing down into separate components.
The way I like to do this is by jotting down what the purpose of my software is. If I find myself writing more than one sentence, I often separate the sentences out, and decide to write multiple projects as opposed to a single monolithic one.
Keeping your software small, to the point, and simple is possibly the greatest productivity and happiness hack of all time. Not only does it feel really great to have a bunch of small simple apps, but it makes it exponentially easier to maintain your software, add features, and fix bugs.
Furthermore, by forcing yourself to keep things simple, you inadvertently learn to become a better developer. Small, simple design is one of the primary foundations for greatness in software development. Things like test driven development, clean refactoring, and good documentation is all made much easier when your software is small and simple. Try applying those tools to complex software, and you will be in for a world of pain.
The next time you’re about to dive into some code, take a second or two and analyze what it is you’re about to be doing. Programming is insanely fun, but writing the right sorts of programs is even more fun.
PS: If you read this far, you might want to follow me on Mastodon or GitHub and subscribe via RSS or email below (I'll email you new articles when I publish them).