Modern mode
Notes
Home | Portfolio
- Loading notes...
- Loading note content...
Modern mode
Home | Portfolio
February 4, 2026
Tags: Clean Code, Best Practices, Software Engineering
Clean code isn't about following rigid rules — it's about communication. Code is read far more often than it's written.
Bad:
const d = new Date();
const fn = (a: number, b: number) => a + b;
Good:
const currentDate = new Date();
const calculateTotal = (price: number, tax: number) => price + tax;
Each function should have a single responsibility:
// Bad: does too many things
function processUser(user: User) {
validateUser(user);
saveToDatabase(user);
sendEmail(user);
logActivity(user);
}
// Good: each function does one thing
function validateUser(user: User): ValidationResult { ... }
function saveUser(user: User): Promise<User> { ... }
function sendWelcomeEmail(user: User): Promise<void> { ... }
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." — Martin Fowler
Clean code is a practice, not a destination. Continuously refactor and improve.