📜 ⬆️ ⬇️

The Clean Programmer Manifesto or a brief synopsis of Robert Martin's Clean Code book

This article is a synopsis of Robert Martin’s Clean Code book and my understanding of how Clean Code should be. There are no sections on testing, TDD, what should be the architecture, etc. Here everything is only about what the Pure Code should be.





Yes, it is possible that the Clean Code theme has already been banned, but nevertheless, not everyone is familiar with it and, all the more, I have not met any analogues of the content contained in my article.


General


There is no true way and solution. There is one that is best suited for solving a particular problem.


When solving a task, try to reproduce absolutely all cases that can affect this task and implement the task with regard to absolutely all cases.


Also, when solving a problem, try to go from the opposite. Understand what results in the end you want to get and build on this basis the algorithm for which the task will be performed.


Before you send a task to release - check if it works correctly. Are there any errors in it? This applies even to those commits that are sent to your thread. The most ideal scenario is the one in which no one could find errors in the functionality that you developed.


Always think about how to make your code simpler, cleaner and more readable.



Clean Code


How to write clean and good code? It is like writing a book. First you make a draft and then comb it to the state in which you would be pleased to read it. Always remember that your code must tell the story of what is happening so that the reader can understand it.


An entity is understood as an interface, class, method, variable, object, etc.



Names and divisions



Functions



Comments



Formatting and rules



Objects and data structures



Classes



Error processing



Boundaries



Afterword


This article provides only recommendations for writing Clean Code. Of course, they can be neglected. You just need to understand that any of your decisions should have arguments in favor of it.


')

Source: https://habr.com/ru/post/424051/


All Articles