segunda-feira, 14 de abril de 2025

Prefix your booleans

 Clean Code tip: Prefix your booleans.

Here's a simple cheatsheet I follow:

• IS for simple states
❌ active
✅ isActive

• HAS for ownership
❌ subscription
✅ hasSubscription

• SHOULD for expected behavior
❌ retry
✅ shouldRetry

• CAN for capabilities
❌ edit
✅ canEdit

Your IF statements should read like plain English.

Write code for humans to read, not just for machines to execute.



dicas para otimizar seu java

 


Começando um novo projeto