3 ms·
I agree with ralph that these comments are annoying because I have to waste time reading them (what if they contain something important?) but they offer me noth
by bobbydavid 14y ago
I agree with ralph that these comments are annoying because I have to waste time reading them (what if they contain something important?) but they offer me nothing (I already know these flags).
If you still prefer putting these hints in comments, I would rephrase your comments in a way that they are easily identifiable as useless, so I can stop reading them right away. For example:
# -s flag: puts curl in silent mode.
# -E flag: puts grep in extended regex mode.
# -o flag: prints only matching text.
curl -s thingy.thing | grep -Eo '[0-9.]+'
An additional win: comments are slightly more future proof. When the comments inevitably become outdated, you'll now see:
# -E flag: puts grep in extendex regex mode.
curl -s thingy.thing | egrep -o '[0-9.]+'
which is better because the comment is now merely irrelevant instead of actively wrong.