CleanCode

Table of Contents

Introduction

(…) the natural entropy of systems is towards a ball of mud. – DHH

The system should be easy to understand and easy to change. This will lead to being able to add new features and correct bugs without wasting time, energy, and money.

Good examples

Understandability

Any fool can write code that a computer can understand. Good programmers write code that humans can understand. – Martin Fowler

Naming

Modularity

Code smells

If you are, or you know someone, who is very attentive to spelling, and punctuation, and grammar. And you show them a page that's full of errors. Everything that ends in S has an apostrophe, whether it needs it or not, maybe even two apostrophes. The word incredible is spelled with three d's in the middle. And capitalization is almost random. And as they read it, you watch their face. – Simon Allardice

Smells are generally introduced by developers when enhancing existing features or implementing new ones. As expected, smells are generally introduced in the last month before a deadline, while there is a considerable number of instances introduced in the first year from the project startup. Finally, developers that introduce smells are generally the owners of the file (i.e., they are responsible for at least 75% of the changes made to the file) and they are more prone to introducing smells when they have higher workloads. – blog.ieeesoftware.org

Switch statements

Good practices

Technical dept

Miscellaneous

Coding standards

  • should be consistent across the project
  • consitent naming scheme
  • see Checkstyle
  • should following the usual coventions of the respective language

Literate programming

A communication-oriented programming method. Literate programs, while difficult to maintain, remind us how much there is to communicate. – Extreme Programming Explained

SearchImpressum