The most important skill a programmer can learn
Tags: programming, webdev, beginners, career
Published: 2019-05-18 10:49:04

---
title: The most important skill a programmer can learn
published: true
description: The best code is no code at all.
tags: #programming #webdev #beginners #career
canonical_url: http://huseyinpolatyuruk.com/2019/05/03/the-most-important-skill-a-programmer-can-learn/
cover_image: https://cdn-images-1.medium.com/max/1200/0*XG0c4KW0GKI5h3Sq
---
<strong>No, no, no, no, and no. And no.</strong>

A big NO. Clear as that.

All you have to do is to bring those two letters together and say the word.

Now, let’s say it together. NOOOOOOO!

Good start.

But wait a minute. Say NO to what and when?

Well, this is the important point where most of the programmers (even seniors) get easily confused.

As a programmer, writing code is the biggest part of your job. In your programming lifetime, you will have to deal with different kinds of code requests. Each request will force you to make difficult decisions. That all is OKAY. Nothing wrong with that. This is what everyone expects from you, as a programmer: Writing code. However, here is a question: Should you write all the code that is requested from you?

This question brings us to the most important skill a programmer can learn:

<blockquote>
<em>
Knowing when not to code is possibly the most important skill a programmer can learn. — <a href="https://www.amazon.com/Art-Readable-Code-Practical-Techniques/dp/0596802293" target="_blank">The Art Of Readable Code</a>
</em>
</blockquote>

I couldn’t agree more. Why is that?

Programming is the art of solving a problem. So naturally, programmers are problem solvers. As programmers, when we have a new problem in front of us ready to be solved or any other reason that needs from us to write code lines, we get excited.

And that is okay because we are programmers. We love writing code.

However, getting too excited about writing code makes us blind. It causes us to ignore some important facts that can cause bigger problems we will have to deal with in the future.

So, what are those important facts that we tend to ignore?

Every line of code you write is:

<ul>
<li>code that has to be read and understood by other programmers</li>
<li>code that has to be tested and debugged</li>
<li>code that will increase defects in your software</li>
<li>code that probably will introduce new bugs in the future</li>
</ul>

As Rich Skrenta wrote, <a href="http://www.skrenta.com/2007/05/code_is_our_enemy.html" target="_blank">code is our enemy</a>:

<blockquote>
<p>Code is bad. It rots. It requires periodic maintenance. It has bugs that need to be found. New features mean the old code has to be adapted.</p>

<p>The more code you have, the more places there are for bugs to hide. The longer checkouts or compiles take. The longer it takes a new employee to make sense of your system. If you have to refactor there’s more stuff to move around.</p>

<p>Furthermore, more code often means less flexibility and functionality. This is counter-intuitive, but a lot of times a simple, elegant solution is faster and more general than the plodding mess of code produced by a programmer of lesser talent.</p>

<p>Code is produced by engineers. To make more code requires more engineers. Engineers have n² communication costs, and all that code they add to the system, while expanding its capability, also increases a whole basket of costs.</p>
</blockquote>

It’s so true, isn’t it? The programmers who inspire you with their productivity and coding mentality are those who know when to say no and when not to code. The software that is easy to maintain, that lasts long and keeps helping their users is the one that doesn’t contain any unnecessary code lines.

<blockquote>
<em>
The best code is no code at all, and the most effective programmer is the one who knows when not to code.
</em>
</blockquote>

<h2>How can you know when not to code?</h2>

It’s natural to get excited when you’re working on a project and think about all the cool features you’d love to implement. But programmers tend to overestimate how many features their project needs. Many features go unfinished or unused or simply make the application overcomplicated. You should know what is essential for your project to avoid making this mistake.

<blockquote>
<em>
Understanding the purpose of your software and its core definition is the first step to know when not to code.
</em>
</blockquote>

Let me give you an example. Let’s say you have software that has only one purpose: managing emails. And for that purpose, sending and receiving emails are two essential features to your project. You can’t expect that software to manage your to-do list as well, can you?

So you should say NO to any possible feature requests that are irrelevant to this definition. This is the moment you can be exactly sure that you know when not to write code.

<blockquote>
<em>
Never expand your software’s purpose.
</em>
</blockquote>

Once you know what is essential for your project, you will be conscious next time when you evaluate possible code requests. You will exactly know your requirements to write code. Which feature should be implemented? Which code is worth to write? You will question everything because you will know exactly how unnecessary code can kill your project.

<blockquote>
<em>
Knowing when not to code keeps your codebase small.
</em>
</blockquote>

<img src="https://cdn-images-1.medium.com/max/800/0*FXiJvr_jr-a-J4ss.png" />

There are only two or three source files when you start your project. All looks so simple. It takes just a few seconds to compile and run the code. You know where to find exactly what you’re looking for.

Then, as the project grows, more and more source files fill your directory. Each code file contains hundreds of code lines. To organize them all, you will need multiple directories soon. Remembering which functions call other functions is more difficult, and tracking bugs requires a bit more work. Managing your project becomes difficult, and you need more programmers to help. <a href="https://en.wikipedia.org/w/index.php?title=Communication_overhead&action=edit&redlink=1" target="_blank">Communication overheads</a> increase as the number of programmers increases. You get slower and slower.

In the end, the project becomes huge. Adding new features is painful. Even making small changes takes hours. Fixing present bugs always introduces new bugs. You start missing deadlines.

Now, life is a struggle for you. Why?

Because you didn’t know when not to code, you said YES to every possible feature request. You were blind. Coding something new caused you to ignore essential facts.

It’s like a horror movie, right?

This is what will happen if you keep saying YES to everything. Know exactly when not to code. Eliminate all unnecessary code from your project. This will make your life easier and make your software last longer.

<blockquote>
<em>
One of my most productive days was throwing away 1000 lines of code. — Ken Thompson
</em>
</blockquote>

I know that knowing when not to code is so hard. Even for senior programmers. Perhaps what I wrote in this article is hard to understand for junior programmers, and that is okay and understandable.

I know you have just started your programming journey and you want to write code. You are so excited about that. This is good. Never lose this excitement but also never ignore the important facts. We learned them by making our own mistakes. You will make mistakes as well, and you will learn from them as well. But at least you can be more conscious if you can learn from our experience.

<blockquote>
<em>
Keep coding but know when to say no to coding.
</em>
</blockquote>