Volver al glosario
Code Review y Calidad

Clean Code

Code that is easy to understand, simple to modify, and clearly expresses the intent of the programmer. A philosophy popularized by Robert C. Martin.

Definicion

Clean code follows principles from Robert Martin's book "Clean Code": meaningful names, small focused functions, clear intent, minimal dependencies, and no duplication (DRY). Clean code reads like well-written prose — each function tells a story at its level of abstraction. The Boy Scout Rule says to always leave code cleaner than you found it.

Por que es importante

Developers spend 10x more time reading code than writing it. Clean code reduces this cognitive load, making maintenance faster and less error-prone. Studies show teams with clean code practices have 50% fewer bugs and onboard new developers 3x faster.

Ejemplo

Instead of: function calc(a,b,c) { return a*b-c/2; } — clean code would be: function calculateDiscountedTotal(subtotal, discount, tax) { return subtotal * discount - tax / 2; }

Terminos relacionados

clean codewhat is clean codeclean code principlesRobert Martin

Automatiza Code Review con diffray

Sistema de IA multi-agente para code review. Encuentra bugs, vulnerabilidades de seguridad y problemas de arquitectura automaticamente.