Good code is like underwear. Simple, short and and a joy to look at #HoskCodeWisdom
Developers write complex code because they don’t have enough time to write simple code. To get to a place to write simple code you need to have understood the key requirements and create a simple design.
When explaining a subject, an expert identifies the key points, the hierarchy of knowledge and can explain it. People who don’t understand a topic jump between points, use 20 words when 5 will do and repeat themselves.
The difference between complex code and simple code is noise; the purpose of the code is unclear with unnecessary steps. Simple code has clarity, it’s concise and written with a purpose. When designing code you create excess because you understand the problem whilst you solve it, the design evolves as with your understanding.
Developers skip the design stage and move straight to writing code, it gives the illusion of progress. The developer learns the solution but the more thought you put into the problem the clearer the solution becomes. Learning the needs half way through leaves you in a dilemma to adjust what you have or start again.
Writers should not publish an first draft of writing, developers should not release an first draft of code. You should release when it’s ready, not what you have.
Simple code is created by developers who care about quality, who care about the developers read, maintain and extend it. Clean code is not written by accident.
Sometimes the most productive day as a programmer is the day you remove hundreds of lines of code and refactor a large confused class into small focused methods
I finish this post with a KISS – Keep it simple stupid