# Should the output to STDERR count as output length? [duplicate]

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)

#!/bin/bash
@


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?

• @Sanchises Go post an answer, please. – iBug Aug 15 '17 at 1:12
• 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. – Ad Hoc Garf Hunter Aug 17 '17 at 18:15

# 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.

• We don't need an official meta consensus on this - thing is, we already do: codegolf.meta.stackexchange.com/a/2451/65836 – Stephen Aug 15 '17 at 15:38
• @StepHen Good find (although it's just shy of a 2/3rd majority at this time, so it's hardly unanimous) – Sanchises Aug 15 '17 at 15:48
• @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? – Nathan Merrill Aug 15 '17 at 18:15

# Yes

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.