Skip to main content
51 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.
Downgoat's user avatar
  • 29k
33 votes
Accepted

Case Sensitive Strings

Unless specified otherwise, strings are case-sensitive. More generally, unless specified otherwise, strings are just sequences of characters with no semantics attached to any specific characters. ...
Martin Ender's user avatar
32 votes

A proposal to combat Meta Bloatâ„¢: The Big Consensus Freeze

I propose that each commonly-used language have a separate explanation of the rules that most pertain to it, with code examples. I think this is more digestible that a big general FAQ, especially to ...
xnor's user avatar
  • 145k
32 votes
Accepted

How should vim answers be scored?

vim answers can be run from the command line as such: ...
Doorknob's user avatar
  • 71.5k
21 votes

Default policy for output in decision problems

Truthy/falsy using your language's convention (swapping allowed), or two distinct values to represent true/false respectively You can choose to output truthy/falsy using your language's convention (...
Bubbler's user avatar
  • 76.7k
20 votes

Should language-specific code golf challenges be explicitly disallowed?

No (with caveats) -- Language-specific challenges are on-topic Challenge authors are allowed to add other arbitrary restrictions (banning built-ins, banning capital letters, requiring out to be base-...
AdmBorkBork's user avatar
  • 43.4k
18 votes

Are bots allowed in The Nineteenth Byte?

Chat bots (that post messages) have no place in TNB. Since TNB is for discussion of code-golf and PPCG related topics, having bots in the room would be distracting and obnoxious, and would overtake ...
DJMcMayhem's user avatar
  • 59.2k
17 votes

Should language-specific code golf challenges be explicitly disallowed?

Only allow challenges to restrict languages indirectly via requirements The one good reason for a challenge to restrict languages is that the spec makes sense only for languages with certain features ...
xnor's user avatar
  • 145k
17 votes

New users' guides to golfing rules in specific languages

Haskell Basic IO In Haskell, a valid answer is usually a function, unless a full program is required by the challenge. Even if a challenge requires you to output an infinite stream of data (like all ...
16 votes

If we find a programming language in the Library of Babel, can we use it?

The language would have been created on the date at which the book was bookmarked for the first time The Library of Babel is basically an encoding scheme: any possible string will exist somewhere in ...
ais523 - high effort answers's user avatar
15 votes
Accepted

Codegolf rules and boundaries

Answers that use a language (or a feature thereof) that postdates the challenge should be labeled non-competing. From Can I ever answer with a language invented after the challenge was posted?: These ...
Dennis's user avatar
  • 210k
15 votes

Should answers have to handle invalid inputs?

By default valid input is guaranteed If it's not, some behaviour should be specified: Any behaviour (but why specify this when it's defeult?) Handle it in some way and produce a specific value ...
Qwertiy's user avatar
  • 3,009
15 votes

What outputs should I allow for decision problems?

One consistent, and one non-consistent The thing I like about Truthy and Falsy is that often you may do things like output 0 for falsy and everything else for ...
Wheat Wizard's user avatar
  • 98.8k
14 votes
Accepted

If your answer is acts differently depending on context, how safe do you have to be?

Our defaults say that submissions have to be full programs or functions. REPL "programs" are also allowed, but they have to be labeled as such, and still have to conform to the defaults regarding ...
Dennis's user avatar
  • 210k
14 votes

Can We Make 0-NAND OR Gates in [logic-gates] Challenges?

It depends on the question. logic-gates is a tag for challenges about logic gates. It doesn't, and shouldn't, come with special rules like this. If the person that poses the challenge wants that to ...
Wheat Wizard's user avatar
  • 98.8k
13 votes

New users' guides to golfing rules in specific languages

Python General I/O Your submission should be a program or a function. It should print the output or return it. These example submissions compute the factorial in Python 2: ...
13 votes
Accepted

Should graphical-output challenges accept straight up image files by default?

The thing is that not all image formats are created equal. Some are just straightforward uncompressed streams of pixels, and there is basically nothing you can do to golf those down. However if your ...
Wheat Wizard's user avatar
  • 98.8k
12 votes
Accepted

If code fails to compile, but runs anyway, does that count as executing without error?

In my opinion, yes. Typically, anything that happens during the compilation stage is ignored. For example, a C/C++ program that produces warnings doesn't make any difference as long the executable ...
DJMcMayhem's user avatar
  • 59.2k
12 votes

What is the consensus on built ins?

If most languages have a builtin, then the challenge is too simple There are some exceptions, for example I like the existence of the Add Two Numbers challenge as a "language showcase", but ...
Kamil Drakari's user avatar
12 votes

Using resource exhaustion with a semi-deciding algorithm

No, that doesn't satisfy the rules In many code-golf questions there are infinitely many inputs, which may be arbitrarily long. And, unless otherwise stated, your code should be able to handle every ...
12 votes
Accepted

Functions throwing exceptions: an exception to the rules?

Functions throwing exceptions should be allowed based on this brief chat conversation As long as the exceptions can be caught, this seems like a perfectly legitimate way of producing output or ...
Rydwolf Programs's user avatar
11 votes

On-topic to ask for help with an pre-existing code golf challenge from another site?

Attribution First and foremost, I have no idea why one of the comments suggested editing the attribution out. If a challenge is taken from elsewhere (with minor modifications), full attribution is ...
Dennis's user avatar
  • 210k
9 votes

New users' guides to golfing rules in specific languages

JavaScript This answer is highly based on the Python answer, so thanks to @xnor for setting that up. Your submission should be a program or a function. It should print the output or return it. These ...
9 votes

If there is "a winner for every language" in a code golf challenge, does competitiveness matter?

PPCG code-golf should not be considered an individual competition. Because PPCG solutions are publicly displayed, many users peek at solutions by others in their language. Suppose Alice, a Jelly ...
lirtosiast's user avatar
  • 21.5k
9 votes

What is the point of unicode gibberish?

I'm old school. I like bending real multi purpose computer languages like Python, Perl, Ruby... to their knees until the single last useless ascii char in the code is removed. Even languages that are ...
Adám's user avatar
  • 30.3k

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