3 ms·
Is this not what comments are for? frobnicate(300) // Duration in seconds to do X Sure, change the variable names or whatever as well, but ... kinda seems we
by bennyp101 5y ago
Is this not what comments are for?
frobnicate(300) // Duration in seconds to do X
Sure, change the variable names or whatever as well, but ... kinda seems we already have a way to make less obvious things obvious?
- berkes 5y agoIt helps. Even more so if documented with the function signature so documentation (in your editor or ide) can communicate it. But one better than documenting comments is no documenting comments. Selfdocumenting code is certainly not always feasible. But in this case it's both possible and easy.
- Aeolun 5y agoProblem with this is that you now need to ensure everyone adds that comment everywhere the function is used. If it’s in the parameter name it’s impossible to use it without doing it correct, which is almost always preferable.