Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Definition of 'clean code' [closed]

Robert C. Martin offers in the fist chapter of his book 'Clean Code' several definitions of 'clean code' from differen well known software experts. How do you define clean code?

like image 633
crauscher Avatar asked Jun 05 '09 06:06

crauscher


People also ask

What is your definition of clean code?

Clean code is a reader-focused development style that produces software that's easy to write, read and maintain. Often, you may be tempted to consider your work complete when the application operates as expected. But we're not merely writing code for computer consumption.

What is a clean and readable code?

Here are some of the characteristics of clean code: Clean code is focused — Each function, each class, and module should do one thing and do it well. It should be elegant — Clean code should be simple to read. Reading it should make you smile. It should leave you thinking “I know exactly what this code is doing”

What is clean code approach?

Clean code should be elegant. It should be pleasing to read and it should make you smile. Clean code should be simple and easy to understand. It should follow single responsibility principle (SRP). Clean code should be easy to understand, easy to change and easy to taken care of.


2 Answers

  • Easy to understand.
  • Easy to modify.
  • Easy to test.
  • Works correctly (Kent Beck's suggestion - very right).

These are the things that are important to me.

like image 199
Ree Avatar answered Sep 21 '22 02:09

Ree


Code I'm not afraid to modify.

like image 35
g andrieu Avatar answered Sep 22 '22 02:09

g andrieu