Clear Code
  • Introduction
    • About This Book
    • Timeline
    • Software Killers
    • Billion Dollar Mistakes
    • Clear Code Overview
    • Clear Code Rules
  • Data Processing
    • Separate Data Collection And Processing
    • Create Data Models
    • Separate Use Cases
    • Data Should Be Immutable
  • Examples
    • Separate Use Cases With Data Model
  • Maintenance Cost
    • Consider the Maintenance Cost
    • The Software Exists In Time
    • Don't Feed the Monsters
  • OOP
    • Separate Data And Procedures
    • Do Not Use Inheritance
    • When To Avoid Inheritance?
    • What Is The Problem With Abstract Frameworks?
  • VARIOUS
    • The Real Single Responsibility Principle
    • The problem with Clean Code's name
    • How To Handle Warnings
    • Do Not Create Constant Collection Classes
  • Externals
    • Links
    • Quotes
    • Funny
  • Technology
    • Git Tutorials
  • Clean Code
    • Clean Code Introduction
      • Origin & Overview
      • Advanced
      • Typical Issues
    • Clean Code Outline
      • Why Clean Code?
      • Clean Code
      • Clean Code Approaches
      • Specification & Design
      • Duplication
      • Refinement & Refactoring
      • Conventions
      • Names
      • Types
      • Methods
      • Nulls and Validity Checks
      • Comments
      • Dead Code
      • Error Handling
      • Classes
      • Code Formatting
      • Unit Tests
      • Special Cases
      • Object Oriented Programming
      • General Code Smells
    • Clean Code Links
    • Clean Code TOC
    • Effective Java TOC
Powered by GitBook
On this page
  • Uncle Bob & The Book
  • Named principles
  • Why clean code?
  • What is bad code like?
  • What is clean code like?

Was this helpful?

  1. Clean Code
  2. Clean Code Introduction

Origin & Overview

Last updated 5 years ago

Was this helpful?

Uncle Bob & The Book

  • Robert C. Martin a.k.a. Uncle Bob

Named principles

  • In the book: SRP, OCP, DIP, (IoC), DI, DRY, LOD, BSR, F.I.R.S.T.

  • Not in the book: LSP, ISP, YAGNI, KISS, S.O.L.I.D.

Coding

  • SRP Single Responsibility Principle

  • OCP Open Closed Principle

  • DIP Dependency Inversion Principle

  • (IoC) Inversion of Control

  • DI Dependency Injection

  • DRY Don't Repeat Yourself

  • LOD Law of Demeter

  • BSR Boy Scout Rule

  • LSP Liskov Substitution Principle

  • ISP Interface Segregation Principle

  • YAGNI You Ain't Gonna Need It

  • KISS Keep It Simple Stupid

  • S.O.L.I.D SRP + OPC + LSP + ISP + DIP

Testing

  • F.I.R.S.T. Fast, Independent, Repeatable, Self-validating, Timely

Why clean code?

What is bad code like?

Readability

  • Spaghetti code

  • Dependencies

  • Fragile code

  • Unreadable

  • Mind mapping

  • Duplication

  • Unexpected

  • Magic numbers

  • Overcomplexity

  • Code smell

  • Antipatterns

  • Technical debt

Functionality

  • Bugs

  • Does not fulfill the specification

  • Side effects

Programmer style

  • Careless

  • Sloppy

  • Lazy

  • Quick and dirty

What is clean code like?

  • Elegant

  • Simple

  • Direct

  • Readable

  • Expressive

  • Carefully written

  • Tested

  • Bugs cannot hide

  • Art

Clean Code book
The real measure of code quality
The total cost of owning a mess