8
\$\begingroup\$

From Default for Code Golf: Program, Function or Snippet?, it is clear that the default for is to allow program and function answers.

For function-only answers, it may be advantageous for answers to include a complete test program that calls the function for some examples, so that it is easy for users unfamiliar with the given language to verify the answer.

Should we require this?

\$\endgroup\$
17
\$\begingroup\$

A test program is helpful, but not required. The usefulness of an answer drives the vote score. This should be incentive enough for users to include a test program.

\$\endgroup\$
6
\$\begingroup\$

What should be required, in my opinion, is what the function which solves the problem is called. Since an answer may define many functions, this should be clarified.

This is especially important in languages such as Pyth, where a named function may be defined without using the name anywhere in the program.

\$\endgroup\$
-2
\$\begingroup\$

A test program should be required. Functions are useless to users unfamiliar with the language of the given answer.

\$\endgroup\$
  • 3
    \$\begingroup\$ But even a test program is useless, if I can't figure out how to install the language and compile the program. Should every answer have to provide full installation and compilation instructions for every operation system? \$\endgroup\$ – Ypnypn Mar 25 '15 at 14:01

You must log in to answer this question.

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