3 ms·
When you dogmatically require that every function must have a comment, that's what happens, regardless of whether it makes sense or not. There's even tools like
by userbinator 4y ago
When you dogmatically require that every function must have a comment, that's what happens, regardless of whether it makes sense or not. There's even tools like GhostDoc which will automatically generate useless (and sometimes hilarious) comments for you, just to show how pointless it is, especially when it's only for satisfying another equally useless tool that checks for their presence.
- crazygringo 4y agoFunctions are not usually as obvious as the creator thinks they are. Does get_height() include the optional border width or not? What does it return while the item is hidden? Does it return an int or float? Can it return a string value like "auto" or a null value? Under what circumstances should its value not be relied upon, e.g. while an animation is active? Why was it written as a function rather than a property? And so forth. Requiring a comment is helpful in reminding the author to explain why this code was even separated out as a separate function in the first place, and all of the potential gotchas around it.