122 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 ...
user avatar
  • 137k
81 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 ...
user avatar
  • 137k
77 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 ...
user avatar
  • 137k
73 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 ...
user avatar
  • 137k
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 ...
user avatar
69 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....
user avatar
  • 41.3k
66 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 ...
user avatar
  • 137k
60 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 ...
user avatar
57 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 ...
user avatar
53 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 ...
user avatar
  • 137k
50 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 ...
user avatar
  • 35.3k
49 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.
user avatar
  • 28.4k
46 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 ...
user avatar
  • 30.8k
43 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 ...
user avatar
  • 137k
43 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 ...
user avatar
  • 137k
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 ...
user avatar
41 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) ...
user avatar
  • 99.4k
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 ...
user avatar
  • 137k
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 ...
user avatar
  • 65.5k
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'...
user avatar
35 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 ...
user avatar
  • 99.4k
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 ...
user avatar
  • 60.9k
32 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 ...
user avatar
  • 137k
29 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 ...
user avatar
  • 44.7k
27 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 ...
user avatar
  • 137k
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 ...
user avatar
  • 43k
23 votes

Things to avoid when writing challenges

Narrow references Beware of challenge topics that tickle your fancy, but others won't appreciate. An in-joke among friends A reference to a movie you like A task from actual code you wrote A small ...
user avatar
  • 137k
22 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 ...
user avatar

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