# Should we combine answers where the same code works in many different languages?

Take this recent challenge for example. There are many languages where the shortest solution is simply *. Likewise, for other trivial challenges, the same 1-byte program and/or function works in many different languages.

Should we combine these answers into one?

• Info: This answer for a different question suggests to keep even answers with identical code that only works in a single language. It has a bunch of upvotes. – nimi Jan 9 '17 at 17:31
• @nimi, I don't think there's any evidence to suggest that people reading and voting on that answer were thinking about its application to 1-char programs. IMO the best solution would be to delete the question as too trivial, but it seems that the site has become too infantilised for that to be a popular opinion. – Peter Taylor Jan 11 '17 at 8:54

I think the idea is right, but needs to specifically target the problem case of built-in-does-it answers.

Trivial challenges invite many trivial answers that are just a built-in. There is an overwhelming temptation to get loads of rep and attention with an answer that takes little time or skill. Some users race to post the trivial answer in multiple languages within minutes before others even see the question.

All this gets the trivial question on top of the Hot Network Question page where a horde of alleged non-sentient voters upvote the trivial question and answers. Some people (including me) think that this is the biggest quality problem with our site.

Combining trivial just-a-built-in answers into a single CW answer is the best solution I've heard to this problem.

• It removes the perverse incentive to rush out trivial answers by denying such answerers rep for it, while maintaining a comprehensive list of golfed answers.
• It stops trivial challenges from getting onto HNQ just for being easy, and so from giving SE the impression we're about cheap, trivial challenges.
• It declutters the answer page so that answers that took real work don't get lost in the crowd.
• It gives a compact list of "languages that have the built-in" all in one place.

This should only target answers that are trivial in that a single language feature basically solves the problem. These are usually one-byte answer or just a built-in, perhaps with some boilerplate for I/O.

It should not apply to answers that turned out identical only because of convergent evolution in golfing. Or, to not-trivial answers that happen to be polyglots because more than one language supports its component operations.

(Another option would be to have this apply only for challenges that get on HNQ, but I'm not sure how practical that would be to track and enforce.)

• This is actually not a bad idea. However, we should probably settle on a fixed format for this and make the leaderboard aware of a post like this, so that these challenges can still act as useful repositories of shortest-solutions-per-language. – Martin Ender Jan 10 '17 at 8:10
• @MartinEnder Good idea. I don't know leaderboard parsing works, so I'd defer to what is convenient for an expansion of it. – xnor Jan 11 '17 at 0:11
• I have made my answer to that challenge CW. I believe this is the best idea out of the 3 current answers here. – Fatalize Jan 11 '17 at 7:46
• The cons of not combining trivial answers that you've outlined, to me, seem like the XY Problem. It seems to be a combination of other problems that have had questions on meta about ppcg in general. – Poke Jan 25 '17 at 14:37
• – ბიმო Dec 14 '17 at 15:51

# No

The only value of extremely trivial tasks like adding/multiplying a pair of numbers is that the thread serves as a catalog repository of the shortest solution per language, which should be aided by including a Stack Snippet to easily find the shortest solution in a particular language. At least the current form of Stack Snippet leaderboard cannot cope with more than one language per post, meaning that combining answers in different languages in one post strips the thread from its only redeeming value.

Also, we always emphasize the importance of per-language competition. What does or does not happen in languages Y and Z shouldn't affect a post in language X.

Finally, this is inconsistent with our recently reached consensus regarding duplicate answers. As it is, we'd even allow multiple answers with identical code in the same language.1 2 Disallowing identical answers in different languages is incompatible with that consensus, and we don't need yet another pair of policies that contradict each other.

1 I'm not perfectly happy with that consensus, but it is what it is.
2 Even if allowed, all but the first answer would probably be downvoted.

• I don't necessarily disagree with the gist of this answer, but I think it's a bit of a stretch to suggest that these trivial challenges could serve as a useful repository of any sort. – James Holderness Jan 22 '17 at 13:03
• As a primarily Java-answerer I strongly agree with the "per-language competition" part of your post here. I think it's neat to be able to see different approaches to solving the same problem in the same language even though one answer may be shorter than another. In this challenge Geobits ended up beating me but we had a nice back and forth in chat during our golfing which was highly enjoyable – Poke Jan 25 '17 at 14:41
• I might be okay with this, if it weren't for the fact that no matter how trivial an answer, it still attracts a lot of upvotes, despite taking little to no effort. Because of this, and the fact that many are the same, I think it's much easier to have a single answer with code for multiple languages where the answer is trivial. – mbomb007 Mar 7 '17 at 22:10
• @mbomb007 I agree that's a problem, but I don't see it as justification for placing a subjective line between what is permitted to have upvotes and what is not. Unless a challenge explicitly disallows certain built ins, I think they should be treated the same as any other answer. – trichoplax Jun 9 '17 at 11:16
• In short, I don't like the idea of penalising an answer for a problem with the challenge. – trichoplax Jun 9 '17 at 11:19
• If it's a trivial answer, maybe it shouldn't have been posted. Find a language where the solution actually takes effort. – mbomb007 Jun 9 '17 at 15:40

# Post a community wiki for the purpose of attracting trivial answers, not combining ones that were already posted

Every now and then we get a question which is formulated in a way (either intentionally or unintentionally) that will allow a large number of trivial answers in a range of languages. Especially in cases where it's unintentional (and the trivial answer is an "exploit" of the question), having a large number of duplicate trivial answers is just noise that a) makes it hard to find the more interesting answers, and b) discourages the posting of more interesting answers that don't use the exploit, in a language where the exploit works.

We can also see that there are answers on the page in some of the languages where the trivial solutions work; some of them are longer, but much more interesting. Without the community wiki, that may well not have happened (as people typically scroll through the list of languages to see if theirs is listed, if there's a shorter one shown already, they may well just not bother).

The big advantage of doing things this way is that we aren't retroactively penalising users, but rather encouraging them to help keep the thread clean via giving a push in advance.

Note that this typically only works in questions which have some sort of exploit (literal-only answer, zero-byte answer, syntax errors being a valid solution in many languages, and the like). If the question is one which is expected to be solved via a trivial, non-exploit answer, then the best approach is probably just to downvote the question and post answers separately per language, so that it can have some sort of value as a catalog; the thread's likely to be unusable in that case anyway, and there's no benefit in encouraging the posting of less trivial answers as there'll be nothing differentiating them from the trivial one but the lack of golfing.

• The problem I see with this is that users are incentivized to rush out their trivial answer within minutes to get in before the CW answer is posted. And that's exactly what we want to avoid. – xnor Jan 28 '17 at 4:49

# Yes, we should combine them into a single Community Wiki answer

Having many answers that are essentially identical other than the language name benefits nobody. It makes finding the solutions that actually required work much harder. Plus, having many similar answers in a single CW answer has been done before. It's not that much of a stretch to combine many existing identical answers.

Note that I say "many" - 10 or so languages where the exact same code would work is a decent threshold for combining answers.

Some people may complain because they won't get the reputation from their answers. To me, this isn't a problem. We encourage voting up solutions that require work, rather than solutions that just use a trivial builtin. How much reputation do you think you are really losing out on here?

• For anyone in doubt ... I also don't think it's particularly uncommon for people to comment identical answers too, like what happened on my answer here. To me, this indicates that people usually would rather not have identical solutions in different languages (what's the fun in that?). – redstarcoder Jan 9 '17 at 17:23
• If someone chooses to make their answer CW so others can add to the list of languages the code works in, fine. But forcing someone to make their answer community wiki just because their code happens to work in more than one language is all different kinds of wrong. – Dennis Jan 9 '17 at 17:29
• @Dennis Having hordes of answers that are identical aside from the language name isn't very good, either. – Mego Jan 9 '17 at 17:32
• I keep seeing people justify posting their identical trivial answer by saying it's just there to be comprehensive. If they really believe this, they should no problem with foregoing the rep and putting it into a collective answer. – xnor Jan 9 '17 at 17:32