Clean Code: Less Clutter, Less Stress.

Writing code that works is one thing; but writing good code is another.

source : perforce.com

This article was written as a submission of CS UI’s software development course’s article task.

“Clean code is code that is easy to understand and easy to change.”

While some developers would argue that that statement doesn’t really say anything at all, I find that sentence as an excellent “in a nutshell’ definition of this idea.

Easy To Understand

Most programmers know what this means by now, as it is pretty much drilled into our heads when we first started programming. “Name variables in a way that succinctly describes the data that it holds”. “Write comments only when it is truly necessary”. However, the importance of these simple practices cannot be understated. Take a look at the following “dirty” code.

Easy To Change

I’ve always struggled to understand this part of the clean code dogma. What does it mean for a code to be “easy to change”? No matter how dirty or bad your code is, doesn’t it take the same amount of effort to change? after all, regardless of code quality, at the end of the day, you type to change it.

Conclusion

Although making clean code requires more thought, time and effort, the difference implementing it makes is staggering. It is very important for us to make easy to understand code, because software engineers, more often than not, work together to solve problems. So naturally, creating more problems would be counter-productive in our endeavour.

Sources

https://garywoodfine.com/what-is-clean-code/

If you're reading an article from me, It's probably a part of my college course.