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?

asked Mar 19, 2015 at 20:23
\$\endgroup\$

3 Answers 3

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.

answered Mar 19, 2015 at 20:25
\$\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.

answered Mar 21, 2015 at 20:25
\$\endgroup\$
-2
\$\begingroup\$

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

answered Mar 19, 2015 at 20:23
\$\endgroup\$
1
  • 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\$ Commented Mar 25, 2015 at 14:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.