Don't be afraid to make a name long.
A long descriptive name is better than a short enigmatic name.
A long descriptive name is better than a long descriptive comment. ✔️
Use a naming convention that allows multiple words to be easily read in the function names, and then make use of those multiple words to give the function a name that says what it does.
#CleanCode #Tip1
A long descriptive name is better than a short enigmatic name.
A long descriptive name is better than a long descriptive comment. ✔️
Use a naming convention that allows multiple words to be easily read in the function names, and then make use of those multiple words to give the function a name that says what it does.
#CleanCode #Tip1
Unit Tests ✅
Ten years ago this would have raised a lot of eyebrows ! 👁
The discipline of Test Driven Development has made a profound impact upon our industry and has become one of our most fundamentals disciplines.
Dave Thomas :
Code without tests, is not clean, No matter how elegant it is, no matter how readable and accessible, If it hath not tests, it be unclean.
#CleanCode #Tip2
Ten years ago this would have raised a lot of eyebrows ! 👁
The discipline of Test Driven Development has made a profound impact upon our industry and has become one of our most fundamentals disciplines.
Dave Thomas :
Code without tests, is not clean, No matter how elegant it is, no matter how readable and accessible, If it hath not tests, it be unclean.
#CleanCode #Tip2
Which code is better ?
or this ?
Absolutely the second one is more readable and it takes you less time to understand ! ⏰
#CleanCode #DontUseComments #Tip3
// Check to see if the employee is eligible for full benefits
if((employee.flags & HOURLY_FLAG) && (empoyee.age > 65))
or this ?
if(employee.isEligibleForFullBenefits())
Absolutely the second one is more readable and it takes you less time to understand ! ⏰
#CleanCode #DontUseComments #Tip3