7
\$\begingroup\$

Take a look at this answer: Produce the number 2014 without any numbers in your source code.

This is the most upvoted answer on our site right now. However, as many have pointed out, by modern standards, this is not a competitive solution because it doesn't take trivial steps to be more competitive as per the challenge's criterion ().

Some people argue in favor of deletion because indeed, this is not competitive, and our policy dictates that answers must attempt to be competitive and should be deleted otherwise.

Others argue against it, because it is a creative approach and has historical significance.

Specifically to quote myself on this dispute:

[...] i think this kind of creativity embodies the whole point of the art side of code-golf but it is technically not competitive and doesn't attempt to take trivial steps to be more competitive (source)

We should have a definitive policy on handling these types of answers. Specifically, answers that are:

  • popular in terms of votes and visibility
  • are not strictly invalid in terms of not solving the problem
  • follow a creative approach but do not even attempt to be competitive

What should we do with these? Leave them be since they predate modern expectations? Lock them? Edit them if the user themselves is inactive / unwilling to do so? Delete them? Suggestions welcome.

There is a specific thing to note about this answer, as pointed out by caird coinheringaahing in TNB. It is not actually the first answer to implement this approach; it is a port of an essentially identical Scala answer which is actually golfed, and the OP has rolled back golfs in the past, meaning they are not inactive, but actively opposing making their post more competitive.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ The answer linked at the top is at exactly 1337 score right now :P \$\endgroup\$ – Bubbler Apr 26 at 2:19
  • \$\begingroup\$ @Bubbler Nice :P \$\endgroup\$ – hyper-neutrino Apr 26 at 2:46
13
\$\begingroup\$

Keep them

...assuming they've shown any sort of effort.

As caird coinheringaahing mentions, a serious contender is one that:

...makes a serious effort towards optimizing the submission's score within the chosen language(s) and other choices (such as algorithm choice or optional restrictions/bonuses taken). [emphasis added]

I would argue that the answer in question had the goal of minimizing size given the voluntary constraint that it derive the number from some sort of relevant phrase.

Consider these possible modifications:

  • print sum(ord(c) for c in 'Happy new year to you!')

    The original, for comparison. Note that figuring out a variation on that phrase that sums to the right number would have required some significant effort.

  • print sum(ord(c) for c in 'ÿÿÿÿÿÿÿå')

    This greatly reduces the size, but only by sacrificing the restriction that makes the answer interesting.

  • print sum(ord(character) for character in 'Happy new year to you!')

    This one could be considered non-competitive and perhaps be deleted. There's an obvious improvement that would reduce the size while retaining the restriction.

  • print sum(map(ord,'Happy new year to you!'))

    Suggested by user2186 in the comments. This is an improvement over the original that maintains the restriction. But we don't delete answers just because someone else is capable of improving them, and while we certainly permit users to improve their answers based on the suggestions of others, if a user prefers the answer to remain the best that they were able to devise on their own, we shouldn't force them to do otherwise.


The key question to ask is, "Are there blatantly obvious improvements that could be made that would not completely change the approach or detract from the answer in other ways?"

Even if an answer doesn't have a clever gimmick like this one, suppose that a question already has a solution in a given language. Someone decides to solve it using a different approach, and it turns out that the approach is a bit longer than the existing one. I would argue that there is still value in posting the answer, even knowing that it can't win, because seeing how well one can do with a specific approach is also interesting.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ As the very least, the original can be blatantly improved as print sum(ord(c)for c in'Happy new year to you!') (removing unnecessary whitespace) \$\endgroup\$ – caird coinheringaahing Apr 13 at 23:02
  • 2
    \$\begingroup\$ @cairdcoinheringaahing True enough, but I'm willing to give the poster the benefit of the doubt and assume that they didn't realize those two spaces were unnecessary. The character vs. c example, on the other hand, is one that nobody could have missed. \$\endgroup\$ – Ray Apr 13 at 23:04
  • 1
    \$\begingroup\$ @cairdcoinheringaahing Why did you delete your answer? Although I disagree with it, both positions should have an argument made for them, and you made some valid points. \$\endgroup\$ – Ray Apr 13 at 23:07
  • 1
    \$\begingroup\$ As I've said in chat, I deleted my answer as I believe that "no opposing answers" conveys the same site consensus as "an opposing answer at +0/-4", especially when the answers are either "Keep them" or "Delete them" \$\endgroup\$ – caird coinheringaahing Apr 13 at 23:10
  • 7
    \$\begingroup\$ I'm not really sold on the rationale of this submission being competitive, but I wouldn't mind keeping it because it's 7 years old, and we have better things to do than removing old answers not fitting modern standards, which we could find tons of if we looked. In this case, the challenge has a disclaimer that it's outdated, and I wouldn't expect people to think they could post such an answer today. \$\endgroup\$ – xnor Apr 14 at 2:33
  • 6
    \$\begingroup\$ I was so happy to find a relevant phrase that added up to 2014 after my third attempt that I just had to publish it. Also, I had no idea that white space could be eliminated. I was and still am a code golf noob, but I enjoyed trying. \$\endgroup\$ – dansalmo Apr 15 at 1:17

You must log in to answer this question.

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