Writing code is an excellent exercise to strain your brain cells. Programming has become so versatile that engineers from different trades need to code on a daily basis. If you are an engineer, you already know that coding is a necessary skill and should be improved upon on a daily basis.
But did you know that engineers spend 80 percent of their time getting rid of the code they write? Yup, you read it right! Most engineers’ time goes into rewriting or eliminating the code they have written in the first instance. There can be multiple reasons for deleting code. And that’s what this article is all about.
Today, we will go through the reasons Engineers spend 80 percent of their time getting rid of the code they write. We will also cover instances on why they get rid of most of their code. We are covering two different aspects of engineers’ coding habits because they are mutually exclusive.
So without wasting much time, let’s learn the reasons!
1. Engineers Write Horrible Code in the First Place
The first reason is nothing to be proud of! But that’s a common issue among engineers who code. Writing code requires logical and spatial thinking, and sometimes engineers are not up to the mark. Most engineers don’t follow the guidelines to write great code! Bad coding skills also make them write horrible code. In the end, they have to rewrite most of the existing code in later stages of the feedback loop.
2. Time Constraints
No project has an infinite timeline. Projects need to be delivered before a particular date, and engineers are always pressured in delivering the finished product before the deadline. This unrealistic deadline creates pressure, resulting in bad quality code. And, guess what, the purpose of saving time, is later haunted by fixing the problems or having bugs in the end product.
3. Writing Human Readable Code
Even though programming is about writing code for machines. It is equally important to write code for other programmers. Software development is an ongoing process as it never ends after the first product delivery stage. It requires constant maintenance, proper documentation, and regular updates to keep it current in the ever-changing market. Engineers can write code that is hard to maintain in the first place. These same engineers, later realizing their mistake, will then rewrite most of the code.
Check Wild, a great programmer from Blekinge, Sweden code an operating system in D programming language. You can see how he manages to write human readable code and do some more amazing things!
4. No Proper Planning
If both time and energy need to be saved, then the engineer must do software planning. But that’s not always the case, leading to poor code management and the overall quality. Poor software design leads to unnecessary code or code that requires heavy changes in the later stages of the project.
5. Agile Development
Agile Software Development is the new mantra for the software industry. The core of the development method revolves around faster development. Engineers who do Agile development know their code need to be changed on a regular basis. In other words, sometimes it is not bad to change code frequently, as in the case of Agile software development. Regular changes are the norm.
6. Copy-Pasting Code
Copy-pasting code to do faster development is also a norm in the software industry. Even though it might look bad on the part of the developer and his skills, it is a good practice to save time.The rule is to understand the code that you are copying and changing it according to your requirement. This approach causes engineers to delete or spend most of their time getting rid of huge chunks of code they don’t need!
7. Change in a Client’s Request
A client’s request is one of the leading factors for engineers to spend most of their time getting rid of the code they write. Even though these types of approaches can be subverted by using the waterfall model, it is no longer a practical approach. A client’s request is inevitable and is part of the overall software development process.
8. A Better Approach
Writing code is not about the total number of lines, but is all about the quality of the code. Most of the time, engineers don’t care about the quality and write a quick solution. Later on, understanding what they did wrong, they rewrite the code in a much simple and succinct way; and this results in the deletion of the code.
“Bill Atkinson, the author of Quickdraw and the main user interface designer, who was by far the most important Lisa implementor, thought that lines of code was a silly measure of software productivity. He thought his goal was to write as small and fast a program as possible.” -- 2000 Lines of Code.
As you saw, there are multiple ways engineers get rid of code they write. It is hard to give an estimate of how much code they delete, but it is a fact deleting code is inevitable.
One approach is to broadcast your project development on Livecoding and document everything you do. Video Code documentation is a new way to tackle most of the problems cited above. Other approaches require careful planning and proper collaboration among team members about the changes made to the project.
So how do you look at the practice of getting rid of code? Do you think this is necessary? Let us know in the Comments section.