DEV Community

Cover image for Code is for Humans not for Computers
ikbal arslan
ikbal arslan

Posted on • Updated on

Code is for Humans not for Computers

if it works don't touch it
When I started learning programming the first rule I learned was "if it works don't touch it "Then I just realized that %70 of our time spent coding is spent reading the code. That first rule looks like has some issues.

A couple of days ago I watched a presentation related to this topic and the content in it was opposite what the first rule says. Here is a brief overview.

If you don't know why your code works, you have no hope of fixing it when it breaks. 

When you don't understand how the code works and need to fix it.

An idea will come which is it'd be faster if I just rewrote it. This will fix the problem but if any more bug exists in the code base again since you don't understand the code base you need to rewrite it again and again.

This slows down the development progress. because of that most of the code bases are rewritten hundreds of times. if your code has to be rewritten to be fixed. improved, or extended, you failed. the only way to ensure your code survives is to make sure it's readable.

The problem is we are writing our code primarily for the computer. Not for humans but instead the code should communicate ideas with other people. Readability directly impacts your ability, and that of everyone else, to do their job.

Readability isn't just a good idea or nice to have. it's the whole point.

The one thing we will always be better at than the computer is empathetic communication with other people.

I am leaving the link for the presentation here it is worth checking it out.

Top comments (0)