cleancode.in

What is clean code?

Code the next person can read, change and trust without asking you. It comes from clear names, small functions, comments that say why, and one layout.

What does clean code look like?

  • Names that explain: elapsed_days, not d. Naming
  • Small functions: each does one thing. Functions
  • Comments that say why: the code already says what. Comments

What else makes code clean?

  • Errors handled early: the main path reads straight down source.
  • One layout: set by a formatter. Style guides
  • Tests: they show what the code should do.

How does each language define it?

Each language has its own guide, and they disagree on details: function names are snake_case in Python and Rust, camelCase in Java, Kotlin and Dart, PascalCase in C#.

Is this the book?

Clean Code is also a book by Robert C. Martin; SAP’s Clean ABAP says it adapts it source. This site does not retell it: the writing is ours, the guides are quoted. The book: its publisher’s page.

Where do I start?