126
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 ...
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 ...
82
votes
Default for Code Golf: Input/Output methods
Functions may take multiple arguments via currying
For some functional programming languages like Haskell this is actually necessary, because only single-argument functions exist and functions with ...
Community wiki
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 ...
76
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 ...
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....
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 ...
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 ...
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 ...
61
votes
Loopholes that are forbidden by default
Abusing native number types to trivialize a problem
It is common practice to restrict challenges to cases where input, output and/or intermediate values of the algorithm of choice fit into the ...
Community wiki
59
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 ...
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 ...
58
votes
Default for Code Golf: Input/Output methods
For stack-based languages, function's input may be pushed to the stack before calling
Stack-based languages may assume that the input for their function is automatically pushed to the stack.
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 ...
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 ...
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 ...
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 ...
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) ...
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 ...
41
votes
Loopholes that are forbidden by default
URL shorteners / shortened URLs
Every once in a while, we get a challenge that requires fetching some data from the internet. While some of them manage to ban URL shorteners in time, other don't. I ...
Community wiki
41
votes
Accepted
Is it OK to promote my own posts in chat?
Promoting your own posts is definitely OK, but there are some very important guidelines to consider. Promoting your own posts is usually OK if
It's relevant to the topic of discussion.
Hey, have ...
40
votes
Default for Code Golf: Input/Output methods
Programs may take input as the value of the last expression
Using something like TI-84 BASIC's Ans, which is a variable that stores the value of the last ...
39
votes
Default for Code Golf: Input/Output methods
Assembly programs may take input from registers
If there are no I/O devices available, an answer might consist of a subroutine that reads its input values from the machine registers.
38
votes
Loopholes that are forbidden by default
When consistent and distinct values are asked as input, you cannot input complete or partial functions
When I create a challenge and ask for a boolean or two '...
Community wiki
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
faq × 29discussion × 24
policy × 10
support × 8
code-golf × 6
defaults × 5
answers × 4
new-users × 3
winning-criteria × 3
chat × 2
challenge-quality × 2
specification × 2
tags × 1
scoring × 1
asking-questions × 1
rules × 1
sandbox × 1
flags × 1