Clean Code Rules is a proposal of common sense rules. They are easy to follow and can improve quality of your code. Therefore, if you work as a developers and architect, you should be aware of them.
Here is a common use case. You are finished with writing your technical specifications and estimates. Now you need to code this. Yes, you need to make it work.
Final result should be clean code, but it should also fit in your time-frames.
Clean code rules can be summarized is a several simple statements.
Firstly, always follow standard (team defined) conventions. These conventions are created and intended as a standard for each team member. Furthermore, when developer follows a standard other team members can understand his code.
Secondly, there is a “KISS – Keep it Simple Stupid” rule. This rule should be self-explanatory. Don’t over-engineer things. Also don’t over-complicate things. Try to focus on problem at hand and code a solution for it.
Thirdly, always leave the code cleaner than you found it. For example, you can always add missing comments. You can cleanup some complex logic. Maybe write some missing unit tests or simply reduce number of parameters. Make sure that you are not breaking any functionality in a process.
Finally, always try to find a root cause of the problem. By all means, avoid hacking. Avoid making bloated complex code for simple solution. Also avoid making a patches for core instead improving core itself.
Do you like my posts? Help me to spread the word. Make one single share with your favorite social network.
This article is about the code review best practices. It explains code review from the… Read More
API design is an important aspect of modern software development. It allows different systems to… Read More
This article sheds some light related to the question will ChatGPT or AIs in general… Read More
This article provides an overview of new features and deprecations in PHP 8.2. PHP 8.0… Read More
This article is about Automation and Artificial Intelligence in Software Engineering: Experiences, Challenges, and Opportunities.… Read More
PHP is getting more and more features. Enumerations in PHP are one of the latest… Read More