↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

5 clean code techniques you can start doing today

The article presents clean code as code that is easy for another developer to read, understand, and improve. It draws on several definitions of clean code and then focuses on practical habits that help move code in that direction.

Reading notes
#

  • Use meaningful names for classes, methods, variables, and expressions so the code reads more clearly.
  • Keep functions, classes, and modules small and focused on one reason to change.
  • Avoid side effects by separating pure logic from code that changes outside state.
  • Reduce duplication, including repeated information and repeated ways of doing the same thing.
  • Prefer code that explains itself instead of comments, with comments reserved for specific exceptions.
  • Write tests because code without tests cannot be trusted to work.