235
votes
Loopholes that are forbidden by default
Using lots of spaces to "hide" code out of bounds, especially in underhanded questions. This isn't very clever or tricky, in my opinion, and yet wins all too often.
Example:
...
Community wiki
146
votes
Default for Code Golf: Input/Output methods
Functions may output via their return value(s)
Community wiki
140
votes
Loopholes that are forbidden by default
Fake random numbers
Pretty much any underhanded challenge involving random numbers will have someone post this one:
...
Community wiki
133
votes
Loopholes that are forbidden by default
Adding input or rules which weren't explicitly mentioned in the challenge
There was recently a case where an answerer claimed
Nowhere does it say the program can't (also) ask the user what the [...
Community wiki
127
votes
127
votes
Default for Code Golf: Input/Output methods
Functions may take input via function arguments
Community wiki
123
votes
Interpretation of Truthy/Falsey
Consider the following pseudocode:
if (x) {
print "x is truthy";
}
else {
print "x is falsy";
}
If it results in a runtime or a compile-time error then <...
121
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 ...
120
votes
Loopholes that are forbidden by default
Zero-length quines
Considering an empty program a quine was original in the 1994 IOCCC.
Over two decades later, if you can answer a question with an empty program and that question is scored by ...
119
votes
106
votes
Loopholes that are forbidden by default
Using a different name for something that's prohibited
The title is not very clear, I know, but this is what it means: if a specific function is prohibited, someone can use a language where another ...
Community wiki
103
votes
Default for Code Golf: Input/Output methods
Programs may take input via GUI prompts
(This is for languages, for which this is the closest alternative to STDIN, like JavaScript's prompt(), Mathematica's ...
Community wiki
98
votes
Default for Code Golf: Input/Output methods
Programs may output by displaying it on screen.
This makes it possible to use languages like Vim script that can't print output directly to stdout.
Example from this challenge:
...
96
votes
Accepted
Default for Code Golf: Program, Function or Snippet?
The default should be "programs or functions"
This includes function-like constructs, including J's verbs and GolfScript's and CJam's blocks.
Community wiki
92
votes
Loopholes that are forbidden by default
Using a non-free language on a Cops and Robbers challenge
Most (currently all) cops and robbers challenges consist of two parts:
A cop submission, where a user posts some secret property of a ...
Community wiki
90
votes
Loopholes that are forbidden by default
Using prior knowledge to circumvent other loopholes
In particular, gaining an unfair advantage by inventing new languages for future challenges that are being sandboxed, discussed in chat, are your ...
90
votes
Default for Code Golf: Input/Output methods
Programs may output using their exit code...
Exit codes are basically a return value for programs. If functions can output using their return values, it makes sense that programs should be able to do ...
84
votes
Loopholes that are forbidden by default
Using MetaGolfScript
MetaGolfScript is a family of programming languages. For example, the empty program in MetaGolfScript-209180605381204854470575573749277224 prints "Hello, World!".
It is similar ...
Community wiki
84
votes
Default for Code Golf: Input/Output methods
Programs may take input via command-line arguments
Community wiki
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
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 ...
79
votes
What are programming languages?
My previous answer was criticised for not drawing a line in a sand, so following some discussion on chat I propose a line.
Executive Summary
A purported programming language should be accepted as ...
77
votes
Default for Code Golf: Input/Output methods
The contents of the tape post-execution may be used as a Turing machine's output
76
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 ...
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 ...
70
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 ...
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....
68
votes
Loopholes that are forbidden by default
Suicidal entries to King-of-the-Hill challenges.
EmoWolf was funny the first time, but it's getting out of hand.
While some not-too-serious answers are often necessary to kickstart a king-of-the-...
Community wiki
68
votes
Default for Code Golf: Input/Output methods
Functions may output via the same methods as full programs
(This depends on how the poll goes, but could be any subset of STDOUT, STDERR and file.)
Community wiki
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
policy × 233discussion × 231
answers × 72
code-golf × 36
defaults × 17
rules × 14
scoring × 10
faq × 10
asking-questions × 8
challenges × 8
tags × 7
close-reasons × 6
duplicates × 5
challenge-quality × 5
chat × 4
new-users × 4
scope × 4
winning-criteria × 4
cops-and-robbers × 4
flags × 3
popularity-contest × 3
noncompeting × 3
specification × 3
contest-type × 3
deleted-answers × 3