2
\$\begingroup\$

I think we should gather a list of all languages that are, by default, allowed to to do things differently on challenges that do not explicitly disallow it. Every question I write it seems that someone asks if, "Can I do X instead of Y?", or if, "Can I have X different from the specified output, my language doesn't support Y?" This is mostly on , and challenges. I was thinking that maybe we should have a table that people can refer back to in defense of their answers in terms of precision, and other arbitrary language limitations. There's obviously many ways to handle this though, post your thoughts as answers.

Post suggestions for how to solve this problem below.

Examples of Questions on Formatting (See OP Comment Section)

Trailing spaces / newlines examples: 5 Favorite Letters , Kuznetsov's Sequence

Precision examples: Bailey–Borwein–Plouffe Iterations , Compute the Median

Input formatting examples: The Art of Word Shaping , Sort a string, sort of

Indexing (0 vs 1, Mathematica spurred this): Linear Regression on a String

I've seen a lot more but don't have the time to go through each challenge to see which ones people ask about 1-indexing for mathematica, trailing newlines on jelly, arrays of characters in python, non-floating point arithmetic in languages only supporting integers... Etc... It would help to have a catalog of language limitations on languages that have them. It is a small list, to be honest and would be good reference material.

\$\endgroup\$
6
  • 6
    \$\begingroup\$ Do we really want this to be a language-specific thing? Rather than saying "Hey, lets set these values for each of the languages", I'd prefer a meta post saying "We have a problem with precision/whitespace/etc. How do we solve it?" \$\endgroup\$ Jan 11, 2017 at 15:20
  • \$\begingroup\$ I agree with Nathan. This isn't necessarily a bad idea, but it would be better first to talk about how we want to address through problem before just going ahead with a per-language repository. \$\endgroup\$ Jan 11, 2017 at 16:39
  • \$\begingroup\$ @NathanMerrill Updated. \$\endgroup\$ Jan 11, 2017 at 16:52
  • \$\begingroup\$ "Every question I write it seems that someone asks" - so list half a dozen concrete examples to illustrate more clearly what the problem you're trying to solve with this meta-question is. \$\endgroup\$ Jan 11, 2017 at 17:28
  • \$\begingroup\$ @PeterTaylor I've added the more notable ones from the questions I've asked. If you see anyone asking for output stylization clarification due to language limitation feel free to add more. \$\endgroup\$ Jan 11, 2017 at 17:41
  • 2
    \$\begingroup\$ Asking for different things for languages with different capabilities is thing to avoid. \$\endgroup\$
    – xnor
    Jan 11, 2017 at 20:30

3 Answers 3

5
\$\begingroup\$

It seems to me that the real solution isn't to add a few hundred lines of site-wide rules about what answers may do; but rather to try to improve questions, in particular by

  1. Using the sandbox, and encouraging other people to use the sandbox (where "use" means both posting your proposed questions and commenting on other people's questions, and in particular on issues like I/O limitations and unintended language biases);

  2. Checking the list of things to consider when writing a challenge;

  3. Adding answers to that list if there are specific issues (such as the ones mentioned in this question) which frequently trip people up and which aren't already covered;

  4. Being quick to close questions which have genuine ambiguities about things like the range of options for permitted I/O so that they can be cleaned up before they're reopened.

\$\endgroup\$
0
\$\begingroup\$

All of the problems presented by the OP are input/output formatting.

I would argue that all of these issues can be solved using Default for Code Golf: Input/Output methods

These allow us to set defaults that questions can override. However, despite these defaults, it may be a good idea to specify some of them in your question for clarity.

  • Trailing spaces/newlines: Do we allow trailing whitespace on output?

  • Precision: How much floating-point precision should outputs have by default?

  • Input formatting: Some issues with formatting can be "standardized", but on complex input, that really just needs to be specified question by question.

  • Indexing: Defining an index can be tough to do for "defaults", but if we can, I think its also a good candidate for defaults.

I'm not saying that all of issues are solved by having defaults. As Peter said, you still need a well-written question if you want it to be clear.

\$\endgroup\$
2
  • \$\begingroup\$ I'm not sure that precision is really an output issue - it's typically the precision of the intermediate values in the calculation that end up causing problems. \$\endgroup\$ Jan 14, 2017 at 0:39
  • \$\begingroup\$ @JamesHolderness Sure, but lower precision intermediate values means lower precision output values. \$\endgroup\$ Jan 14, 2017 at 4:24
-2
\$\begingroup\$

Create a MetaQuestion Thread where answers are in the following format, creating a repository of language limitations.


LANGUAGE NAME

Language Maximum Allowable Precision

  • [Maximum Precision in Bytes / Largest Numeral Datatype]

Language Whitespace Limitation

  • [Specific Whitespace Limitation]

Language Datatype Limitation

  • [What datatypes do not exist / Default type in place of datatype]

Other Language Limitations

  • [Description of Limitation]
\$\endgroup\$

You must log in to answer this question.

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