Do we require codegolf challenges include example code?
I feel it'd be a good idea to require, or at least heavily encourage, that challenges include an example, ungolfed, readable solution in a non-golf language like Javascript, C, Rust, or Python.
This would augment the challenge's description with a known-working solution contestants can use as a guide, and would make more complex challenges more approachable.
1 answer
Don't require example code
In general, I believe the decision should be on the challenge creator. Requiring it would be useless for certain types of challenges (kolmogorov-complexity or similar), and boilerplate on simple ones.
Furthermore, such an example solution couldn't showcase all options of implementation (e.g. the challenge allows 0- or 1-indexing, allowed surrounding whitespace, different I/O formats, and whatever else the challenge allows to vary), and means that often the fun part of thinking of an algorithm is taken away.
1 comment thread