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 ...
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
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.
Addison Crump's user avatar
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.4k
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
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
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 ...
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 ...
DJMcMayhem's user avatar
  • 59.2k
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 ...
NinjaBearMonkey's user avatar
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.
Lynn's user avatar
  • 68.7k
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 '...
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
  • 145k
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.7k
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
37 votes
Accepted

What are our specific abbreviations and terms?

See also Stack Exchange Glossary - Dictionary of Commonly-Used Terms. Abbreviations marked with a star (*) are chat specific. ATO: Attempt This Online; a website similiar to TIO where newer versions ...
36 votes

Default for Code Golf: Input/Output methods

Functions in stack-based languages can leave the output on the stack Mostly for completeness sake. This is the de-facto standard for CJam and GolfScript and probably other stack-based languages.
Martin Ender's user avatar
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
35 votes

Loopholes that are forbidden by default

Outputting an expression instead of a number For example, outputting 3*3 instead of 9, or outputting ...
35 votes

Default for Code Golf: Input/Output methods

Assembly programs may write output to some specified memory location If there are no I/O devices available, an answer might consist of a subroutine that writes its output values to some specified ...
Lynn's user avatar
  • 68.7k
35 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.9k
35 votes
Accepted

How does this site work?

What does "Code Golf" mean? Code golf, (Or Codegolf) as the name suggests, is the art of making programs that are as short as possible that complete a task. What is "Code Golf & Coding ...
ATaco's user avatar
  • 10.8k
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
  • 145k

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