125 votes

Things to avoid when writing challenges

Cumbersome I/O formats Generally, allow flexible input and output formats. People want to write code to do your task of, say, composing permutations, not reading/writing numbers in a particular ...
xnor's user avatar
  • 144k
85 votes

Things to avoid when writing challenges

Rules inferred from test cases Test cases are examples for people to check their understanding of the spec and the correctness of their code. They should not replace an explanation of how the output ...
xnor's user avatar
  • 144k
79 votes

Things to avoid when writing challenges

Making assumptions about language features Unless you're writing a language-specific challenge, avoid terms specific to some class of languages, because these might not make sense for other languages ...
xnor's user avatar
  • 144k
75 votes

Things to avoid when writing challenges

Changing the challenge in the comments If something was unspecified in your challenge, or if you've decided to make a change to the challenge (Such as to close a loophole), don't just leave a comment....
isaacg's user avatar
  • 42k
75 votes

Things to avoid when writing challenges

Bonuses in code golf Digital Trauma wrote an answer about this, but I have harsher views on bonuses, so I'm posting to let people vote separately. Bonuses in code golf say things like "-30% of your ...
xnor's user avatar
  • 144k
74 votes

Things to avoid when writing challenges

Do X without Y This isn't always bad, but it's been a particular trap for beginners, so be careful. In the past, there were popular questions about doing a simple task but with the obvious method ...
xnor's user avatar
  • 144k
71 votes

Things to avoid when writing challenges

Explicitly disallowing or disadvantaging arbitrary (classes of) languages This has become much rarer recently, but the occasional challenge by a new user still includes it, so here as an answer to ...
Martin Ender's user avatar
63 votes

Things to avoid when writing challenges

Putting test cases in a hard to use format Supplying test cases is always a good idea, but people are more likely to use them (and thus have better tested code) if they can easily be copied and pasted ...
Calvin's Hobbies's user avatar
59 votes

Things to avoid when writing challenges

Requiring minimum scores In short, don't post a code golf that says "Your code has to be shorter than 100 bytes" (the same applies to any other winning criterion). The usual motivation is that the ...
Martin Ender's user avatar
57 votes

Things to avoid when writing challenges

Chameleon challenges Chameleon challenges look like they're about one thing but are really about another. In doing the challenge, most of the effort is spent on something peripheral. Fix this by ...
xnor's user avatar
  • 144k
52 votes

Things to avoid when writing challenges

Non-observable program requirements The validity of a program should depend on things that can be observed when the program is treated as a black box. Examples are data written to standard output or ...
feersum's user avatar
  • 31.3k
51 votes

Things to avoid when writing challenges

Don't allow / ask for different things in languages with different capabilities Don't write specs like "Do X. If your language doesn't support X, you can do Y instead". Examples are: Do some math in ...
nimi's user avatar
  • 35.8k
51 votes
Accepted

Should answers have to handle invalid inputs?

No, invalid inputs may result in undefined behavior Requiring input validation only adds extraneous code to the answer and takes away from the challenge.
Downgoat's user avatar
  • 28.9k
45 votes

Things to avoid when writing challenges

"Ideally, your code will..." Avoid recommended features in your spec. If it's not mandatory, answers won't do it. The goal is to write the shortest/fastest/winningest code that still satisfies the ...
xnor's user avatar
  • 144k
44 votes

Things to avoid when writing challenges

Arbitrarily overriding the defaults The default code formats, input/output methods, and other defaults are a product of community thought and discussion. Don't change them just because you feel like ...
xnor's user avatar
  • 144k
44 votes

Things to avoid when writing challenges

Saying you should produce one or several outputs randomly without further specification One random output Say someone writes a challenge about generating a labyrinth of a given size (width and height) ...
Luis Mendo's user avatar
  • 104k
43 votes

Things to avoid when writing challenges

Requiring the use of unnecessarily "complicated" number types A large proportion of our challenges deal with numbers, or lists of numbers. An important consideration is always what sort of numbers ...
Martin Ender's user avatar
37 votes

Things to avoid when writing challenges

Allowing standard loopholes in general Don't say "Standard loopholes are allowed". They ban silly things like making up a language where the solution is a single character or just printing the string ...
xnor's user avatar
  • 144k
37 votes

Things to avoid when writing challenges

The prime numbers We have 226 questions about prime numbers at the time of writing. Almost every single one of these involves some adaptation of the “canonical prime checking code” or the “canonical ...
Lynn's user avatar
  • 68.1k
37 votes

Things to avoid when writing challenges

Formulating the challenge as something and then including a twist that completely changes the task Don't hide information from the reader. Don't enounce the challenge as something that later on it ...
Luis Mendo's user avatar
  • 104k
36 votes

Things to avoid when writing challenges

Most kinds of generalised quines Quines continue to fascinate this community... but we already have a plain quine challenge so we're "forced" to innovate by making quine-related challenges that aren'...
Martin Ender's user avatar
34 votes

Things to avoid when writing challenges

Adding unnecessary fluff See also: Chameleon challenges, Cumbersome I/O formats, Do X without Y What's the main point of the challenge? Try to keep the challenge to just that. Don't go adding frills ...
Sp3000's user avatar
  • 61.7k
33 votes

Things to avoid when writing challenges

Patching out approaches On your challenge, someone posts a solution that's cheap and not at all what you intended. You have the option to change the rules, but do so very carefully as there's many ...
xnor's user avatar
  • 144k
32 votes

Things to avoid when writing challenges

Input Validation This is a subset of adding special cases for completeness that seems to come up pretty often. From a given set of possible inputs, a solution shouldn't have to sort out inputs that ...
Jo King's user avatar
  • 47.1k
28 votes

Things to avoid when writing challenges

Popularity Contests Popularity contests, while allowed, are heavily disfavored by site culture. You're likely better off reworking your challenge to use an objective winning criterion that isn't ...
xnor's user avatar
  • 144k
27 votes
Accepted

The state of the popularity contest tag

Keep It, but... ...we should definitely update e.g. the tag info. The recent discussions have not been unproductive, and I think we have better guidelines than ever before but at the moment they are ...
flawr's user avatar
  • 43.7k
24 votes

Things to avoid when writing challenges

Hidden pattern in the output for code golf challenges You should not post a challenge in which an essential part is to find a pattern in the required output, which is not stated in the challenge but ...
Luis Mendo's user avatar
  • 104k
23 votes

Things to avoid when writing challenges

Bonuses in code-golf This might be controversial - Personally I'm not sure which way to go on this one. In most cases, code-golf scoring is simple - shortest answer in bytes wins. However some ...
Digital Trauma's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible