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?

  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – nimi
    Commented Jan 9, 2017 at 17:31
  • \$\begingroup\$ @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. \$\endgroup\$ Commented Jan 11, 2017 at 8:54

4 Answers 4


Combine equivalent trivial answers

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.)

  • 8
    \$\begingroup\$ 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. \$\endgroup\$ Commented Jan 10, 2017 at 8:10
  • \$\begingroup\$ @MartinEnder Good idea. I don't know leaderboard parsing works, so I'd defer to what is convenient for an expansion of it. \$\endgroup\$
    – xnor
    Commented Jan 11, 2017 at 0:11
  • \$\begingroup\$ I have made my answer to that challenge CW. I believe this is the best idea out of the 3 current answers here. \$\endgroup\$
    – Fatalize
    Commented Jan 11, 2017 at 7:46
  • \$\begingroup\$ 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. \$\endgroup\$
    – Poke
    Commented Jan 25, 2017 at 14:37
  • \$\begingroup\$ Relevant. \$\endgroup\$ Commented Dec 14, 2017 at 15:51


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.

  • \$\begingroup\$ 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. \$\endgroup\$ Commented Jan 22, 2017 at 13:03
  • 1
    \$\begingroup\$ 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 \$\endgroup\$
    – Poke
    Commented Jan 25, 2017 at 14:41
  • \$\begingroup\$ 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. \$\endgroup\$
    – mbomb007
    Commented Mar 7, 2017 at 22:10
  • \$\begingroup\$ @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. \$\endgroup\$ Commented Jun 9, 2017 at 11:16
  • 1
    \$\begingroup\$ In short, I don't like the idea of penalising an answer for a problem with the challenge. \$\endgroup\$ Commented Jun 9, 2017 at 11:19
  • \$\begingroup\$ If it's a trivial answer, maybe it shouldn't have been posted. Find a language where the solution actually takes effort. \$\endgroup\$
    – mbomb007
    Commented Jun 9, 2017 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.

If a problem does admit trivial answers in a large number of languages, this will normally be immediately obvious to someone viewing the post early. As such, I'd strongly recommend posting a community wiki for the purpose before the question has too many answers, to encourage people to just add their trivial answer with an edit there rather than posting it separately as an answer. See here, for example; that's a community wiki that I originally posted (thinking of this question when I did so) when the question was new and I realised that a literals-only solution would typically be a valid answer to the question as worded. If not for the community wiki, we might well have made the thread unusable as a result of 19 identical answers cluttering it up; a single answer showing the exploit is interesting, a large number of duplicate answers isn't.

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.

  • 2
    \$\begingroup\$ 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. \$\endgroup\$
    – xnor
    Commented Jan 28, 2017 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?

  • 1
    \$\begingroup\$ 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?). \$\endgroup\$ Commented Jan 9, 2017 at 17:23
  • 5
    \$\begingroup\$ 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. \$\endgroup\$
    – Dennis
    Commented Jan 9, 2017 at 17:29
  • 2
    \$\begingroup\$ @Dennis Having hordes of answers that are identical aside from the language name isn't very good, either. \$\endgroup\$
    – user45941
    Commented Jan 9, 2017 at 17:32
  • 8
    \$\begingroup\$ 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. \$\endgroup\$
    – xnor
    Commented Jan 9, 2017 at 17:32

You must log in to answer this question.