Coding & Writing: They’re not so different

Danielle Jasper
Jun 20, 2019 · 2 min read

Coding and writing are more alike than you might think. I’ve been writing as a hobby for about 10 years. I’ve only been coding for a short period of time, but I’ve started to notice that being a writer helps me be a better programmer. These two skills are really not so different. Both coding and writing require some creativity, as there are as many different ways to code something as there are to say something in writing. And there are some very important principles that apply to both. I want to dive into the principles of effective writing and how those principles are applied to the skill of programming.

Purpose

One of the most important principles of effective writing is purpose. Know what you want to say before you say it. Have a goal. Writing without purpose is not going to make anyone feel anything. It’s not effective. When coding, purpose is equally as important. You should know what you are trying to accomplish before you code anything. Thinking and planning are a big part of the process. Without purpose, coding can be a long, grueling, irritating process. When you code, knowing exactly what you want to do before you do it, you can get things done quickly and easily.

Brevity

Be concise. It’s a very common piece of advice in writing. You go over your writing again and again, you revise and revise, until it’s short and sweet and to the point. Similarly, you want your code to be DRY (Don’t Repeat Yourself). You want it to be clean, elegant, and minimal. Brevity makes for readable writing and readable code.

Clarity

Be precise. When writing is unclear, you have to read it multiple times to try to understand what it’s trying to say. And the same thing applies to coding — clear and precise variable names, method names, and file names are important. Being precise with your words, both in writing and in programming, helps others understand what you are trying to convey.

Simplicity

The simplest solution is usually the best one. This applies to both writing and coding. When you write, you want your writing to be clear and understandable. You don’t want the reader to have to pull out a thesaurus for every other word. And when coding, your code should be simple. The simplest solution to the problem is probably going to be the best one. If you follow the principle of simplicity, your codebase should be readable and understandable to other coders.

You may be someone who loves coding but finds writing very challenging. Hopefully keeping these four principles in mind will help you to be better at both and eventually even enjoy writing!

Danielle Jasper

Written by

Full-stack software developer, writer, and recent graduate of Flatiron School

The Startup

Medium's largest active publication, followed by +756K people. Follow to join our community.

Danielle Jasper

Written by

Full-stack software developer, writer, and recent graduate of Flatiron School

The Startup

Medium's largest active publication, followed by +756K people. Follow to join our community.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store