Brendan Ang

Search

Search IconIcon to open search

Clean Code

Last updated Nov 8, 2022 Edit Source

# Clean Code - Notes

# Comments

# Explain yourself in code

1
2
//check to see if employee is elgiible for full benefits
if (employee.flags & HOURLY_FLAG) && employee.age > 65

Create a function to describe the comment:

1
if (employee.isEligibleForFullBenefits())