Answer the question
In order to leave comments, you need to log in
How to achieve "ideal code"?
Hello.
I am a student. I have been programming for about 1.5 years. Recently, I began to notice that the code written by me is hard to read. For example, when teachers write their own code, I understand it well and it is easy to understand it. And in my code there is some kind of chaos. Can you please tell me how to properly organize the architecture of the code? Are there any books or articles on the subject?
Answer the question
In order to leave comments, you need to log in
Learn design patterns. For C++, here is a fundamental book . There are pattern books for every programming language.
Read about Software
Quality
Books have already been recommended. I'll say shit.
Good, correct code:
1. Easily changes itself (within reasonable limits)
2. Easily understands itself
3. In each procedure / function, it operates with a minimum of entities.
4. Speaks for itself (comments are needed, but to the point)
5. Easily tests itself (allows you to write automatic tests)
6. Interacts with a minimum of entities (not to be confused with point 3)
7. ..... Maybe someone else that will add ?
Good code is not written by itself, it is written by people. Practice. If old code (a year ago) seems bad to you, and you want to rewrite it, then you are on the right path of a programming Jedi.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question