Hot answers tagged

147 votes

Default for Code Golf: Input/Output methods

Functions may output via their return value(s)
127 votes

Default for Code Golf: Input/Output methods

Programs may take input via STDIN
127 votes

Default for Code Golf: Input/Output methods

Functions may take input via function arguments
124 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 <...
  • 42.8k
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 ...
  • 139k
121 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

Default for Code Golf: Input/Output methods

Programs may output to STDOUT
105 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 ...
98 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.
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: ...
  • 186
93 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 ...
91 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 ...
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 ...
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 ...
84 votes

Default for Code Golf: Input/Output methods

Programs may take input via command-line arguments
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 ...
82 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 ...
  • 139k
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 ...
  • 42.8k
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
  • 11.7k
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 ...
  • 139k
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 ...
  • 139k
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 ...
70 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....
  • 41.4k
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-...
68 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 ...
  • 139k
67 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.)
66 votes

Let's allow newer languages/versions for older challenges

Trust the community and add a standard loophole I think the community can handle the add-a-builtin problem (I may be very wrong). I think that if someone adds a feature to their language that is ...
  • 13.3k
63 votes

Default for Code Golf: Input/Output methods

Programs may output to STDERR
62 votes

Loopholes that are forbidden by default

Creating a new compiler for a language after a challenge was posted There is some debate arising from this answer. He created his own compiler for the C programming language that extends the language ...
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 ...

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