Clean Code


I ended up reading through 2 articles concerning “clean code” practices and both of them have given me some insight one what I should try to do more often, and what I should avoid doing in the future. First off, from the article A Few Principles of Clean Code, it brings up the idea of practicing consistency. The idea of it is that if you decide to do something in a certain way, you should stick to it throughout the entire project. This is something I hope to do more of in the future, as occasionally I will not be consistent and then later on down the road I find that my code is difficult to understand because of it. It’s a simple change that can make a huge difference.

The second article I read was Clean Code: What Makes Programming Code Clean to which one thing they talked about was “readability over conciseness”. This basically means that when for example, you are naming a variable, the readability of the code is more important than its conciseness. This would mean that the name for the variable you are making should be self-describing so that anyone looking at your code can understand what the variable is used for. So instead of naming a variable int t; which doesn’t give you any information on what it represents, you could name it int elapsedTimeInDays;. Now I normally don’t name variables as bad as in the example, but there is always some room for improvement so my goal for the future is to avoid naming my variables in non-descriptive ways.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *