in reply to Re^4: Where to place POD
in thread Where to place POD
If I came across that code in my own code while browsing for something, I would likely correct the case #2 comment to reflect the code, assuming that I had copy/pasted it from a similar comment elsewhere (e.g. the Case #1 snippet) while forgetting to adjust it to match the actual code. I might, or I might not--depending on my mood, change both of them to the shorter form of $i++ and $i-- respectively. This might depend on whether I thought it more readable in its explicit form, or whether or not I might have arrived at that equation from something else, which might again need tweaking later, such as $i = $i + 2; (which of course could be written as $i += 2; as well, but, again, this may be less readable, depending on the context).
My habit for a comment of that nature is just to remind myself of what the code is doing; less often do I intend for the comment to be prescriptive...and my comments are far more likely to be out-of-date than the code itself when I have returned and made adjustments.
If, however, I found that in someone else's code, I would scrutinize that more carefully to see what it should actually be doing and whether the code, or the comment, should be corrected.
Blessings,
~Polyglot~
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Where to place POD
by eyepopslikeamosquito (Archbishop) on Jan 16, 2024 at 05:45 UTC | |
by Polyglot (Chaplain) on Jan 16, 2024 at 06:05 UTC |