220 votes

How can we help users who are put off by the use of golfing languages?

Stop upvoting trivial solutions It's easy to imagine why a new user would be frustrated when the highest-voted answer is a 3-byte solution in a golfing language with a built-in that nearly solves the ...
user avatar
  • 137k
146 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
126 votes

Default for Code Golf: Input/Output methods

Functions may take input via function arguments
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 <...
user avatar
  • 42.8k
119 votes

Default for Code Golf: Input/Output methods

Programs may output to STDOUT
102 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 ...
97 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: ...
user avatar
  • 186
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.
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

Default for Code Golf: Input/Output methods

Programs may take input via command-line arguments
81 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 ...
76 votes

Default for Code Golf: Input/Output methods

The contents of the tape post-execution may be used as a Turing machine's output
user avatar
  • 11.7k
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.)
64 votes

Default for Code Golf: Input/Output methods

Programs may output to STDERR
60 votes

Default for Code Golf: Input/Output methods

Functions may output by modifying their arguments or writing to out arguments Here, "out arguments" refers to arguments that are passed in by reference, so that modifying the value inside the ...
58 votes

How can we help users who are put off by the use of golfing languages?

What SE could do for us... One of the most popular suggestions from "We're not a Q&A site, but what should be done about it?" is to add software support for answer metadata (mainly scores and ...
user avatar
57 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.
user avatar
54 votes

Default for Code Golf: Input/Output methods

Programs may output to a file
53 votes

Default for Code Golf: Input/Output methods

Functions may take input via the same methods as full programs (This depends on how the poll goes, but could be any subset of STDIN, ARGV and file.)
52 votes

Default for Code Golf: Input/Output methods

Programs may combine two or more input methods For example, if the inputs are a string and an int, a function that takes a string as an argument and an int from STDIN would be valid. The input ...
50 votes

Default for Code Golf: Program, Function or Snippet?

Restricting to just programs requires explicitly specifying "full program" rather than just "program" If the question requests a program, this can still be answered with a function. This allows for ...
user avatar
  • 10.7k
49 votes

Default for Code Golf: Input/Output methods

Input for Turing machines may be written to the tape pre-execution The read-write head should start on the leftmost cell of the portion of the tape containing the input.
user avatar
  • 11.7k
49 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.
user avatar
  • 28.4k
48 votes

Default for Code Golf: Input/Output methods

Where applicable, Turing machines supporting multiple halt states may also output via their halt state This is essentially equivalent to programs outputting via their exit code.
user avatar
  • 11.7k
42 votes

Interpretation of Truthy/Falsey

Truthy/Falsey should be taken as strictly defined in the given language. For example, in javascript, the following are always falsey: undefined null NaN 0 "" false And other values are always ...
user avatar
42 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 ...
user avatar
41 votes

Default for Code Golf: Input/Output methods

SQL submissions may take input from a named table which is probably not good enough. But I don't know a better way.
user avatar
  • 35.8k
39 votes

Interpretation of Truthy/Falsey

Some languages have ambiguity in what is considered truthy/falsey. For example in c, zero vs non-zero is always FALSE vs TRUE from the point of view of conditional operators. But many standard APIs, ...
user avatar

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