These questions involve the practice of commenting on another user's answers to suggest a shortening of the code.

Which of these are polite? Which are best practices?

  • Commenting on an answer to indicate that a shorter solution in the same language has been posted (for example, this Perl 5 answer to FizzBuzz has more votes than this one despite being longer)
  • Giving credit to a user who suggests an optimization (e.g. in my answer here):

Pyth, 21 20 bytes

-1 byte by Dennis

  • Upvoting an answer because one suggests an optimization for it, to 'cancel out criticism'

2 Answers 2


It's nice to include an edit in the post, referencing the user

Since comments tend to get removed by the user (or by a moderator) after they've been addressed, it is good practice to include a reference to the user for their suggested improvement(s).

  • Thanks to [user] for golf help!
  • -x bytes by [user]
  • etc...

Upvotes are optional, of course, but giving credit may make the user more inclined to give you one.

Don't comment on an answer pointing to another answer that's shorter unless it really matters (like if there can only be one answer per language.) It seems rude.


I'm not sure to understand point 1.

If I find a way (or many ways) to shorten an existing answer, I'll put that in a comment. When (and if) my suggestion is accepted, I will probably upvote the answer just for the pleasure of vote for myself.

But if I find a different way, I'll post an answer

  • \$\begingroup\$ I was referring to pointing out someone else's shorter answer. \$\endgroup\$
    – lirtosiast
    Sep 27, 2015 at 14:43
  • 7
    \$\begingroup\$ @ThomasKwa clearer now. I'd say no if the other anser is mine - blatant self-promotion \$\endgroup\$
    – edc65
    Sep 27, 2015 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .