Design Patterns Handbook
  • Introduction
  • Creational Patterns
    • Builder
    • Factory
    • Abstract Factory
    • Factory Method
    • Prototype
    • Singleton
    • Object Pool
    • Revealing Constructor
  • Structural Patterns
    • Adapter
    • Composite
    • Proxy
    • Flyweight
    • Facade
    • Bridge
    • Decorator
    • Private Class Data
  • Behavioral Patterns
    • Template Method
    • Mediator
    • Chain Of Responsibility
    • Observer
    • Strategy
    • Command
    • State
    • Visitor
    • Memento
    • Interpreter
    • Null Object
    • Iterator
    • Middleware
  • Clean Code Patterns
    • Extract Method
    • Clarify Responsibility
    • Remove Duplications
    • Keep Refactoring
    • Always Unit Test
    • Create Data Type
    • Comment to Better Name
    • Consistent Naming
    • If-else over ternary operator
    • Composition over Inheritance
    • Too Many Returns
    • Private to Interface
  • Anti Patterns
    • Big Ball of Mud
    • Singleton
    • Mad Scientist
    • Spaghetti Code
    • It Will Never Happen
    • Error Codes
    • Commented Code
    • Abbreviations
    • Prefixes
    • Over Patternized
    • Generic Interface over Function
Powered by GitBook
On this page

Was this helpful?

Clean Code Patterns

While creational, structural and behavioral pattern help us to solve specific problems, clean code patterns help us to produce code that is readable, easily understandable and easy to change. Some of them are called low-level refactoring patterns but some are rather ideas and principles to examine and be inspired by.

Clean code patterns are activities that are supposed to be done continuously over the time. Clean code patterns become are supposed to become a good habit, rather than one time solution for a problem.

The more you don’t pay, the worse your fees and payments become.

This category of design patterns is based on the following points:

  1. Remove duplication.

  2. Simplify your code.

  3. Clarify you code’s intent.

-- Ward Cunningham

There is a subtle difference between code which is new, the code which is new and kept refactored and code that nobody every did refactor over many years.

With this chapter, I hope to provide more insight on how to make code that does not rot.

PreviousMiddlewareNextExtract Method

Last updated 5 years ago

Was this helpful?