I’ve been coding professionally for around 5 years now and I’ve continued to work on my writing for more or less the same amount of time, although in a much smaller capacity. In this time, I’ve learnt to see some key similarities between the two crafts. Despite how different the two fields seem on the surface, I truly believe that working on my writing skills continues to have a spill over effect on my how I think about code as well.
Although they sit on the opposite ends of the spectrum of how creative/technical they are, at their core, writing and programming are both fundamentally about communication — only with vastly different audiences.
As a writer, I’ve learnt, your job is to communicate your thoughts and ideas in a way that is digestible by a broad audience. You need to lay down your arguments, or construct your story, so that it flows effortlessly from start to finish. Your writing needs to be clear and concise, without too many unnecessary deviations. The golden rule of writing, we’re told, is to keep things simple, and that less is always more.
Programming is quite similar, once you appreciate who your audience actually is. 9 times out of 10, your target audience isn’t a computer but rather the people reading your code. Your teammates. People who will maintain your code years down the line. And as bizarre as it sounds, maybe even your own future self. I’m frankly embarrassed by the number of times I’ve read my own code only a couple of weeks after writing it and completely failed to understand any of it.
A huge part of your job as a software developer is to write code that is easy to understand for someone with absolutely no prior context. Often, your goal is to model entities in the real world through programming concepts and architectures.
Programming languages are, after all, languages. They define a syntax and a vocabulary, just like real life languages. They give you a large set of tools to work with when building your applications. And it is your responsibility to find the best possible constructs and syntax to express your logic every step of the way. Just like you would find the right words when expressing yourself through your writing.
Now, I’m not suggesting that you get Stephen King to write your next Super Scalable Million Dollar App. Nor am I suggesting that software developers should suddenly abandon their careers and pursue becoming a NYT bestselling author. I don’t want to minimize the importance of writing high performant code, architecting and managing complex systems, or possessing specialized technical knowledge — all of which require years, if not decades, of experience. And all of which contribute to being an effective developer.
But I do believe that having a mental model for good code serves as a great foundation. And I believe that writing of any form helps reinforce that mental model. Especially when you’re in the weeds and writing code day in and day out. And often times, high performing code doesn't necessarily equal ugly code. There are usually ways of striking a compromise between the two. But you do have to actively strive towards it.
Ultimately, in order to do either of these two things well, you need to develop clarity in your thought. And that is something that sticks with you, regardless of what you do. I’ve definitely found writing to be a valuable asset for me in a lot of different ways, and I’d encourage more people to dabble with it!
On a semi related note, it’s usually insights like these that make me value diversity in the workforce, especially engineering. We tend to think of engineering as a highly technical profession with little to no room for creativity. But that isn’t entirely true. Folks with creative backgrounds often bring their own unique experiences and intuition and are probably even more uniquely positioned to contribute to the product as a whole.
Unsurprisingly, my go to book recommendation for new developers (but also for programmers of any skill level, really) is Clean Code, by Robert Martin. Highly recommend you check it out.