Posts in clean code

Reducing Code Complexity

I have already covered what I picked up from Steve McConnel’s Code Complete and Robert C. Martin’s Clean Code on packaging and labeling blocks of code and simplifying their inputs. Now I intend to cover what the two volumes offer in regards to reducing the complexity of the shape of, and relationships between, code segments. As is consistently emphasised through McConnel’s Code Complete, the author of a piece of code is beholden to its reader and should write for readability and maintainability, as if often ends up being the same person or a colleague.

written in clean code, code complete, complexity, simplification Read on →

Ordering and Labelling Code

Reading Steve McConnel’s Code Complete and Robert C. Martin’s Clean Code, I encountered a subject that I previously hadn’t given much thought to but is of great importance. McConnel talks of reducing the cognitive load of reading and understanding code by writing for humans first, computers second; where the reader of a piece of code should be the author’s highest priority - if not only because these often end up being one and the same. An important part of this is facilitating quick code navigation to allow the reader to find what they need, and providing useful levels of abstraction so the reader need not concern themselves with irrelevant details.

written in clean code, code complete, naming, ordering Read on →