You know what they say about sharp-dressed code. Every dev’s crazy about it… More seriously, developers often fail to notice well-written code, but easily recognize and curse poorly written code. Still, some of the greatest minds in our field have a great passion for well-written code (quotes below). Code clarity directly contributes to understandability, maintenance, quality, and more. Here I’ll discuss practical ways to write clean and maintainable code.
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.” – C.A.R. Hoare
There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors. - Phil Karlton Who do we write code for? This question is not often not considered, and so the answer is usually nobody. Thus, nobody is who understands the code.