# Should character counts be mandatory?

In code golfing questions it is tedious to copy-paste everyone's solution to see how long it is. Should having character counts for each submission be mandatory?

There are various examples of this all over the site, so I don't want to single anyone out.

• I think one thing needs to be clarified - they should be mandatory iff code size is one of the criteria, we've got some anti-golfs on here as well... – tobyodavies Jan 28 '11 at 15:30
• @tobyodavies: I agree, it would be stupid if it was not a shortness contest. – JPvdMerwe Jan 28 '11 at 19:45

It would be nice if we could get automated character count added as a feature. Then all code blocks could have a character count next to them and it would be irrefutable. It would also allow us to say for example later decide we don't want to consider whitespace in the count.

• This would be much appreciated. – dmckee --- ex-moderator kitten Jan 28 '11 at 0:38
• whitespace should always be considered in the count, otherwise compsoc.dur.ac.uk/whitespace would have an unfair advantage. – ninjalj Feb 5 '11 at 10:06
• @ninjaij That was just an example, one that could work if applied to a language such as C++. That aside, this question has said whitespace is ignored. Which as I commented there I don't believe will work. – moinudin Feb 5 '11 at 18:02
• I made a script for this (/cc @dmckee) – Doorknob Sep 25 '13 at 21:18

I think they should be mandatory, because in the process of writing a shorter program you are constantly checking its size, so passing this information to the reader is not a big issue.

Additionally, I think a template for submissions could be in order, eg:

## $LANGUAGE -$CHARS characters

\$rest_of_post

• This would make my UserScript work better. – Nathan Osman Feb 6 '11 at 23:09

I think it's really important to include a character count. There have been many occasions with tight races between perl/python/ruby etc. And it's nice to be able to quickly check if you are still in the lead