3 Coding Stages: Writing. Avoiding. Deleting.
Tags: programming, webdev, beginners, career
Published: 2019-06-27 09:46:56

---
title: 3 Coding Stages: Writing. Avoiding. Deleting.
published: true
description: Writing code is just the tip of the iceberg
tags: #programming #webdev #beginners #career
canonical_url: http://huseyinpolatyuruk.com/2019/05/13/3-coding-stages-writing-avoiding-deleting/
cover_image: https://cdn-images-1.medium.com/max/800/1*h0LxtUjS0GylMbhDWs5dQQ.jpeg
---

<strong>Iceberg</strong>

This is how I see all the hidden facts that we developers usually forget or tend to ignore when we are excited about writing code or implementing something new.
 
In the form of an iceberg…

The iceberg looks small and beautiful from the outside, so people tend to forget its actual size and what hides beneath the peak. What people see from the outside is actually just the tip.

Writing code is the same thing.

When you start writing code, you are too focused on what you have to write, and you don't focus on how much it may cost you down the road. Or, you ignore it.

As the years pass, all your experience and the mistakes you make teach you that what you used to ignore is actually the most important thing you must consider.
So what are those important facts that, as a developer, you usually forget?

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>

In the beginning, you just see the code. You think, what can go wrong? But actually, it's just the tip of the iceberg.

In a developer's programming life, it takes some time to develop the ability to see the whole of the iceberg. To see that, you have to pass through the three coding stages in your programming life.

Let's speed up time and check each of the stages together.

<h2>1. Writing code as much as possible</h2>

Remember this time? You had just started your programming career as a junior developer. You were hungry, foolish. You were always on the lookout to write some more code lines and for problems to solve. You said yes to every possibility that required you to write code. You were too excited. You spent hours and days on it. You forget about sleeping.

Being too excited and writing code as much as you can in that stage is good. This is how it should be. This is how we learn to program. This is how we practice being a better developer. In the meantime, while we are writing that bunch of code, we make a lot of mistakes too. And that is totally fine. They are just small mistakes. Nothing can stop you from writing code.

After some time, maybe four to five years, you start learning the new programming facts that you didn't know before. You face the reality beyond the code. You have just seen the tip of the iceberg with writing code, and now you are curious to see what is under the sea.

This is the stage where you see that every code has to be read, understood, tested, debugged. You've just understood how important future maintenance is for your software to last longer.

<h2>2. Learning when not to write code</h2>

After you experienced a few programming horror stories, you found yourself thinking about how you can avoid writing unnecessary code, because you knew how much it can cost you.

In this stage, you were learning when not to write code to avoid being a victim of another horror story. You were still excited about writing code, but you were wise enough to know that less code is better. Simplicity is your ultimate guide here. You understood that it's harder to read code than to write it. That's why you started focusing on more readable, understandable, and simpler code.

In this stage, you followed a few simple rules that transformed you into a better programmer.

<ul>
<li>Writing less code.</li>
<li>Keeping your codebase small</li>
<li>Saying yes to what is essential and saying no to rest of it</li>
</ul>

<blockquote>
<i>
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>
</i>
</blockquote>

<h2>3. Deleting code as much as possible</h2>

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

In this stage of coding, you understand exactly what Ken Thompson was trying to say with the above sentence.

You know that the more code you have, the more places there are for bugs to appear. It takes longer checkouts or compiles. It takes longer for a new employee to understand your system. There's more stuff to move around if you have to refactor.

Furthermore, more code often means less flexibility and functionality. You understand it based on your own experience. You know when not to code, but, at the same time, you know that by deleting the unnecessary codes or refactoring complex solutions with simpler, more elegant ones, you can decrease defects in your software.

In this stage, you discovered all parts of the iceberg. You know what is under the sea. The next time you see a new iceberg, you will be more careful, and you will not make the same mistake as the Titanic did.

The key idea of this piece is not that writing code is your enemy. You are a programmer. Writing code is your passion and it will always be. It will cover a big part of your life. I just want you to understand what is behind all of that code writing and that with each line of code you have written, you accept the burden that comes along.

<i>Don't surround yourself with unnecessary codes.</i>