0
\$\begingroup\$

This question already has an answer here:

Suppose one answers a code-golf challenge for a language with a solution which is ill-formed according to the spec of the selected language.

"But it works nonetheless with all major interpreters".

Is the answer considered valid?


Exemple:

Challenge: print this text: Hello, World!.

Solution: HTML, 19 bytes: <html>Hello, World!

Discussion: Most (all?) browser would indeed print the exact text Hello, World!, even though the code snippet is not a valid HTML file. Should OP accept this answer?

\$\endgroup\$

marked as duplicate by user62131, mbomb007, Wheat Wizard, 0 ', Blue Apr 27 '17 at 17:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    \$\begingroup\$ We define languages by their implementation. An answer is valid if and only if it works with a pre-existing implementation, so programs that violate the spec but work is practice are accepted, while program that adhere to the spec but do not actually work (interpreter bug, etc.) are considered invalid. \$\endgroup\$ – Dennis Apr 27 '17 at 14:37
  • 1
    \$\begingroup\$ More specifically, it doesn't need to "work with all major interpreters" as long as you can find a single interpreter where it works. \$\endgroup\$ – Martin Ender Apr 27 '17 at 19:15

Browse other questions tagged .