DEV Community

Discussion on: Don't be afraid to expand your code for readability

Collapse
 
pbeekums profile image
Beekey Cheung

A friend of mine had an interesting practice.
Instead of calling functions with boolean parameters:
myFunction(argument1, true)

he made a variable solely for documentation:

shouldThisBeTrue = true
myFunction(argument1, shouldThisBeTrue)
Enter fullscreen mode Exit fullscreen mode

Much quicker to read than relying on IDE hover hints or having to go to the function.