If You Can Code, You Can Write!
7 ways coding and writing are not that different - an encouragement to start writing
Reading time: 5 minutes
At first glance, writing and coding can’t be more different. Most people see writing as a creative job, and coding as a technical job. Coding is for machines, while writing, fiction or not, is for humans.
The reality is that writing and coding are more similar than we think, and they rely on very similar principles. And not just that, but adopting principles from coding can actually make us better writers in our day-to-day jobs. The reverse is also true.
In today’s article, we explore 7 underrated similarities between writing and coding.
Here we go!
Solving puzzles
Coding is all about solving problems, but so is writing.
All writing is ultimately a question of solving a problem - William Zinnser, On Writing Well
What type of problems you might ask?
For coding, we’re talking about the features or functionalities of a product/system. Writing solves different problems, ranging from sharing knowledge to persuading, entertaining, and reporting.
Finding the right solution for any of these problems is a journey that requires creativity and innovation. This journey usually progresses by revealing insights you might not have been aware of at the beginning, like pieces of a puzzle.
The satisfaction of putting all the pieces together until the image is complete is priceless.
The quest for clarity
Whether it's crafting a narrative or writing code, you want your creation to do exactly what you intend. This process involves critical thinking, experimentation, and a relentless pursuit of clarity.
To achieve a clear output, you have to start with a clear input, which is your thinking.
Clear writing is clear thinking - William Zinsser, On Writing Well
My code can’t be tidier than my thinking. -
, X
Besides ensuring the code does what it’s supposed to do, clarity has another benefit: maintainability.
Code should be obvious: When someone needs to make a change, they should be able to find the code to be changed easily and to make the change quickly without introducing any errors. - Martin Fowler, Refactoring
Always ask yourself if there's a clearer, more direct way to achieve your goal.
Clarity’s best friend is simplicity as we’ll see in the next section. But first, here’s a quick announcement.
Starting 3/18, subscription prices are going up to $10/month.
I’ll be writing weekly (instead of bi-weekly), which is a significant time commitment on my side. This change will allow me to continue creating high-quality thoughtful articles for you!
Besides 4 full weekly articles, the paid subscription is getting a boost:
exclusive access to 🔒 posts and chats
full access to the archive of posts
monthly office hours with me (the details will be sent out soon)
If you want to lock in the old price, click here:
Thank you for supporting my work 🙏🏻
The economy of expression
Good code strives to be efficient, but so does good writing.
Optimal algorithms ensure computational efficiency. But that’s not enough. Textual efficiency is also needed.
Just like programs compete for limited computational and business resources, texts compete for the reader's time and attention. The economy of expression matters. Can we say what we want in fewer words? Can we organize our text so that our building blocks do fewer things?
If a function does too much, it’s usually a sign it needs splitting. The same principle applies to sentences.
Coupling, like the Lego piece in the night, often isn’t obvious until you step on it. -
, Tidy First
The secret to good writing is to strip every sentence to its cleanest components. - William Zinsser, On Writing Well
Being concise and efficient is paramount for both coding and writing. Inefficient work, whether code or text, risks being overlooked or abandoned.
Strive to simplify and streamline your work without sacrificing its essence.
Readability
Writers must therefore constantly ask: what am I trying to say? Then they must look at what they have written and ask: have I said it? Is it clear to someone encountering the subject for the first time? - William Zinsser, On Writing Well
Making sure your code does what it’s supposed to do is not enough if others can’t make sense of it. The root of readability is empathy—putting yourself in the reader’s shoes. Will they understand your code? Do you need to provide additional context? Can you make the code more intuitive?
Readability is also about the efficiency of writing new code.
Indeed, the ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. …[Therefore,] making it easy to read makes it easier to write. - Robert C. Martin, Clean Code
Always code and write with your reader in mind and always seek a clearer, more direct way to say/do what you intended.
Building blocks
Writers don’t just sit in front of a blank page and start writing. They, just like programmers, build and organize their work iteratively. Everybody starts with a plan for assembling their building blocks.
An outline becomes a full-fledged text divided into chapters, headings, and sections. Similarly, pseudocode or a high-level diagram becomes microservices, components, classes, and methods.
To break down complex ideas into manageable, coherent parts, both writers and programmers need structure and process.
Think of your code architecture as the plot of your story—plan it well and your readers will be able to navigate it effortlessly.
The cycle of improvement
Editing is for writing what code reviews are for code. Rewriting is refactoring.
Both coding and writing are iterative processes. The first draft is rarely perfect; feedback and revisions are essential steps toward refining and improving the work.
Embrace the process and see it as an opportunity. Even if it’s time-consuming, it’s worth it!
Tools for impact
Your work, whether code or text, shapes the world.
The ultimate goal of both coding and writing is to have an impact—to influence behavior, decision-making, or understanding. Just like well-designed code can transform a business, a well-crafted text can inspire and move its readers. Both are powerful tools for impactful change.
Create with purpose, knowing that your work has the power to make a difference.
Conclusion
Writing and coding share so much, from problem-solving to creativity, process, and structure. Recognizing this common ground will hopefully improve our understanding and practice of both arts—yes, coding is art.
Over to you: What are your thoughts? Do you agree that writing and coding are similar? What other similarities have I missed?
Until next time,
Your Caring Techie
Ready to grow your tech career with me? Here are 3 ways I can help:
Book a one-hour call where we can tackle your most pressing issues.
Private coaching - I am opening a handful of coaching spots to work with me 1-1, email me at thecaringtechie@gmail.com or DM me to learn more!
Join the next cohort of my course “Impact through Influence in Engineering Teams”.
I've been thinking a lot lately about the parallels to learning a spoken language and learning a programming language.
How you can't first learn to speak in eloquent sentences until you learn basic sentences and words.
It definitely feels so relatable to code, you can't learn how to design and implement the most well architected solutions, without first understanding how to do things end to end.
Great read, thanks for sharing 🥰
Great read! Love the quotes added two new books to my reading list. Writing is a lot like coding, even the research part is pretty similar.