A few challenges that requires the program to output something at a specified length, and a bunch of answers well... uses built-in error messages that's generated by the interpreter rather than the program itself.

Say for example, this program outputs a total of 20 bytes (not counting trailing newline)


with output

@: command not found

Of course this message will not appear in STDOUT, but STDERR instead (without redirection).

Should this count as a valid program that outputs something as long as 20 bytes?

  • \$\begingroup\$ @Sanchises Go post an answer, please. \$\endgroup\$
    – iBug
    Commented Aug 15, 2017 at 1:12
  • \$\begingroup\$ I do not believe this is a duplicate. Yes, STDERR is a default, but the OP has pointed out a situation in which it doesn't make a good deal of sense for it to be so. Rather than blindly follow the defaults maybe we should have a discussion about this particular case. \$\endgroup\$
    – Wheat Wizard Mod
    Commented Aug 17, 2017 at 18:15

2 Answers 2


Leave it to the writer of the challenge.

For some challenges, it may be acceptable, for some it may not be. We don't need an official meta consensus on this.

Note: this was first written as a comment, receiving 8 upvotes.

Edit: In general, you may also output to STDERR as a standard method of input/output, but keep in mind that writers of a challenge may want to deviate from the standards if they have good reason to do so. When in doubt, ask the OP.

  • \$\begingroup\$ We don't need an official meta consensus on this - thing is, we already do: codegolf.meta.stackexchange.com/a/2451/65836 \$\endgroup\$
    – Stephen
    Commented Aug 15, 2017 at 15:38
  • \$\begingroup\$ @StepHen Good find (although it's just shy of a 2/3rd majority at this time, so it's hardly unanimous) \$\endgroup\$
    – Sanchises
    Commented Aug 15, 2017 at 15:48
  • 1
    \$\begingroup\$ @StepHen The difference is that "output length" isn't a term we have defined. We've defined "output", but we haven't defined "output length". This may seem pedantic, but there are lots of forms of output we allow. Do we include STDERR or the exit code? If I return a function, how do we measure it's length? \$\endgroup\$ Commented Aug 15, 2017 at 18:15


Outputting to STDERR is currently permitted under our standard I/O methods.

Note, though, that this may be overridden on a per-challenge basis by the challenge author.


Not the answer you're looking for? Browse other questions tagged .