I would like to refactor a few if statements I've encountered in some legacy code, to make them easier to read.
For example:
if (condition1 || condition2 || condition3 || condition4 || condition5 || condition6 || condition7)
I thought about maybe store the long condition list in a variable, give it a descriptive name and use that variable name in the if statement.
Aucun commentaire:
Enregistrer un commentaire