7
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ 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... \$\endgroup\$ – tobyodavies Jan 28 '11 at 15:30
  • \$\begingroup\$ @tobyodavies: I agree, it would be stupid if it was not a shortness contest. \$\endgroup\$ – JPvdMerwe Jan 28 '11 at 19:45
18
\$\begingroup\$

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.

\$\endgroup\$
  • 2
    \$\begingroup\$ This would be much appreciated. \$\endgroup\$ – dmckee Jan 28 '11 at 0:38
  • 2
    \$\begingroup\$ whitespace should always be considered in the count, otherwise compsoc.dur.ac.uk/whitespace would have an unfair advantage. \$\endgroup\$ – ninjalj Feb 5 '11 at 10:06
  • \$\begingroup\$ @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. \$\endgroup\$ – marcog Feb 5 '11 at 18:02
  • \$\begingroup\$ I made a script for this (/cc @dmckee) \$\endgroup\$ – Doorknob Sep 25 '13 at 21:18
8
\$\begingroup\$

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

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

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

\$\endgroup\$

You must log in to answer this question.

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