Clean code
  • Overview
    • Introduction
    • Why is clean code so important?
    • What Is Clean Code?
    • How to write clean code?
    • Conventions
  • The key principles of clean code
    • Meaningful Names
    • Functions
    • Classes
    • Comments
    • Error Handling
      • Exception handling best practices
    • Unit Tests
    • Formatting
    • Objects and Data Structures
    • Simple Design Rules
    • Concurrency
    • Code Smells
  • Building Maintainable Software
    • Write Short Units of Code
    • Write Simple Units of Code
    • Write Code Once
    • Keep Unit Interfaces Small
    • Write Clean Code
    • Automate Tests
  • Bonus
    • SOLID Principle
      • SRP - Single Responsibility Principle
      • OCP - Open-Closed Principle
      • LSP - Liskov Substitution Principle
      • ISP - Interface Segregation Principle
      • DIP - Dependency Inversion Principle
    • LoD Principle
    • YAGNI Principle
    • DRY Principle
    • Fail Fast principle
    • Hollywood Principle
    • Library vs Framework
    • Coupling and Cohesion
    • AOP - Aspect-Oriented Programming
      • Building an AOP framework
    • OOP Design Pattern
    • Technical Dept
    • How to learn software Design and Architecture - Roadmap
    • Microservcies
      • Defining the scope of a microservice
      • Step-by-Step: How to Identify Over-Scoped Microservices
      • Benefits of Grouping or Consolidating Microservices
      • A practical step-by-step plan to consolidate microservice
Powered by GitBook
On this page
  • About the Clean code book
  • About the gitbook
  • About me
  • References
  1. Overview

Introduction

Clean Code - A Handbook of Agile Software Craftsmanship by Robert C. Martin (Uncle Bob)

Even bad code can function. But if code isn’t clean, it can bring a development organization to its knees. Every year, countless hours and significant resources are lost because of poorly written code. But it doesn’t have to be that way.

Writing clean code is what you must do in order to call yourself a professional. There is no reasonable excuse for doing anything less than your best.

The code is clean if it can be understood easily by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility, and maintainability.

About the Clean code book

You are reading this book for two reasons. First, you are a programmer. Second, you want to be a better programmer. Good. We need better programmers.

Clean Code is divided into three parts:

  • The first describes the principles, patterns, and practices of writing clean code.

  • The second part consists of several case studies of increasing complexity. Each case study is an exercise in cleaning up code—of transforming a code base that has some problems into one that is sound and efficient.

  • The third part is the payoff: a single chapter containing a list of heuristics and “smells” gathered while creating the case studies. The result is a knowledge base that describes the way we think when we write, read, and clean code.

Readers will come away from this book understanding:

  • How to tell the difference between good and bad code.

  • How to write good code and how to transform bad code into good code.

  • How to create good names, good functions, good objects, and good classes.

  • How to format code for maximum readability.

  • How to implement complete error handling without obscuring code logic.

  • How to unit test and practice test-driven development.

About the gitbook

In the book, Robert C. Martin introduces the disciplines, techniques, tools, and practices of true software craftsmanship.

In this Gitbook, I summarize the key principles and strategies in the book "Clean Code" and give some examples to make the principles more clear.

The Clean Code book is mostly written from a Java perspective.

About me

References

NextWhy is clean code so important?

Last updated 11 hours ago

This is my summary of the book - A Handbook of Agile Software Craftsmanship by Robert C. Martin (Uncle Bob).

Also, I summarize some guidelines from the "" book by Joost Visser that helps to write cleaner and more maintainable code.

Linked in:

GitHub:

Blog:

Clean Code
Building Maintainable Software
https://www.linkedin.com/in/gpcoder/
https://github.com/gpcodervn
http://gpcoder.com/
Clean Code: A Handbook of Agile Software Craftsmanship
Building Maintainable Software