DEV Community

Discussion on: Your code should tell a story: Tips for writing code for others to read

Collapse
 
endavid profile image
David Gavilan

I think userPassedCourse should be called userFailedCourse. Or at least, having a low mark suggests or low attendance suggests failure. But then, you switch passing false to passing true from one example to the next, so even if you are trying to refactor it to make it more readable, I'm getting really confused by the example.

Collapse
 
collinstommy profile image
Tom Collins

Changed to:
user.result > 40 && user.attendance > 50