Another clean code bullet points to remember
Some thoughts after reading a lot of stuff lately and working on totally diferent things. It is just another clean code bullet points compilation to remember or recall every know and then.
- Complexity is the main problem in software design: Managing and reducing complexity is crucial for creating maintainable software. Three main issues caused by complexity: change amplification, cognitive load, and unknown unknowns.
- Two main sources of complexity: dependencies and obscurity. Dependencies make it hard to understand and modify code, while obscurity hides important information.
- “Deep modules” with simple interfaces that hide complex implementations, reducing cognitive load.
- Strategic & Tactical Programming: Tactical programming (quick fixes) and strategic programming (long-term design). Strategic programming focuses on reducing complexity over time. Critique of Agile: Agile methodologies are encouraging tactical coding over strategic thinking, advocating for a focus on abstractions rather than just features.
- But on the other hand iterative software design is good, where decisions are revisited and refined over time, rather than decided one-time upfront.
- Developers should allocate 10-20% of their time to strategic design to improve long-term outcomes that wshoul be beneficial 99% of time. Encapsulating complexity through modular design allows developers to work on parts of a system without needing to understand its entirety.
- Encourages thoughtful commenting and documentation practices, focusing on clarity rather than excessive comments. Any standard is better then none. Naming Conventions: Choosing meaningful names is crucial; if naming is difficult, it may indicate underlying complexity in the code where a comment might help.
- Reccommendation of code reviews to identify and address complexity issues, ecourage design principles are applied.
- Done not optimize prematurely, suggesting a balanced approach to performance and simplicity.Usually simple approach is always more performant.
- Encourages a philosophical approach to software design, where developers constantly think about and refine their design practices to manage complexity effectively.
- Red flags can look like :
Shallow modules, classes, objects
Information leakage
Temporal decomposition
Overexposure
Pass-through methods
Repetition
Special generic mixture
Cojoined methods
Vague names
Nonobvious code and functions - Define errors out of existence for simplification.
- Comment should describe non obvious things or make a nice highlight of the code
- Put the most important things in the center, hide anything else ( especially the implementation ).
- Remember that You (in general) write the code to make someone else understand it as easily as possible. Including You in one year.
I know that nobody is capable to remember about all of it all the time. God knows it cannot implemented anyways. I love how people dance cause inventing 3 layers of abstraction to avoid simplicity 🙂
Let us remember the most noble truth of them all…
Common sense…
Like a brain, remember to use it.


