7
\$\begingroup\$

My first ever question Find all integer pairs that produce a given Loeschian number was a straightforward tagged problem. I copied the format from an earlier related question, including the line:

This is code golf so shortest code wins.

In this case it seems that when I'm ready and certain things have settled down, I should simply accept the answer with the lowest final byte count.

If there are more than one answer with the lowest byte count (which appears to be the case now with two at 9 bytes) then I can either refrain from acceptance, or choose one on a secondary criteria of my choosing.

Have I got it right, or are there other things I might consider?

\$\endgroup\$
  • 11
    \$\begingroup\$ Hey there! Afaik in this site we don't usually accept an answer in code-golf contests because there is always the possibility of someone posting an even shorter answer later (sometimes, years later!). Having no accepted answer also motivates users to post their answers. \$\endgroup\$ – RGS Oct 20 '20 at 8:58
  • 1
    \$\begingroup\$ @RGS Oh, whew! I'm relieved to hear it. The pressure is off, thank you. Does that apply to some other types challenge-type questions without the code-golf tag as well, or is it strictly that one tag? \$\endgroup\$ – uhoh Oct 20 '20 at 9:00
  • 1
    \$\begingroup\$ I am not sure, I haven't been a very active member lately and so haven't paid attention to what is going on... My best advice would be to go over the most recent challenges with a specific tag you have in mind and see if they have accepted answers or not. Pay special attention to challenges that were well-received and posted by well-established members of this community :) \$\endgroup\$ – RGS Oct 20 '20 at 9:03
  • 3
    \$\begingroup\$ @RGS ya I understand, got it. I guess there is not a lot of pressure to accept in a rush no matter how it's tagged, and that's all I need to know for now. \$\endgroup\$ – uhoh Oct 20 '20 at 9:06
  • 2
    \$\begingroup\$ @RGS: Also, shortest across all languages isn't always the most interesting thing. A clever answer in a non-golfing language could be more interesting than a short but obvious answer in a golfing language. \$\endgroup\$ – Peter Cordes Oct 24 '20 at 1:39
  • \$\begingroup\$ @PeterCordes Thanks This is my first experience here; can you point me to where I can find out which languages are and are not golfing languages? \$\endgroup\$ – uhoh Oct 24 '20 at 2:08
  • 2
    \$\begingroup\$ @uhoh: If the "source code" is a jumble of non-alphabetic characters, it's usually a golfing language designed to pack as much expressive power into the coding-space of source bytes. Usually also takes input implicitly and implicitly prints / returns output. e.g. Jelly, Pyth, and so on, designed specifically and only for the context of code-golf answers. You pretty much know them when you see them, except for APL which uses a large character set but isn't "just" a golfing lang. There are "esoteric" languages which are weird and mostly have a lot of symbols, like brainfuck or ><> \$\endgroup\$ – Peter Cordes Oct 24 '20 at 2:26
  • 1
  • 1
    \$\begingroup\$ Note that there should not be any pressure to accept an answer on any Stack Exchange site. There is nothing wrong with deliberately choosing not to accept any of the existing answers as a way of saying, "I'm still looking for more/better answers". \$\endgroup\$ – Cody Gray Oct 31 '20 at 1:00
7
\$\begingroup\$

Usually, the practice is that code golf challenges don't accept answers (same goes with and . There are some tags where accepting is kinda expected like king-of-the-hill and answer-chaining, but those usually will state what the single winning answer criteria is). However, whether or not an answer is accepted is up to you. If you do choose to accept an answer (which is totally okay if you do), I would consider the following:

  • Does it look like there'll be a shorter answer? By this, I mean that if there's a 3 byte answer and a good portion of golfing languages have been used, then chances are there won't be a shorter answer. If that's the case, then accepting an answer probably is appropriate. If not (in other words, you feel there's room for answers to be shorter), consider not accepting an answer.

  • Which answer reached the shortest byte count first? Usually, submission time is the tiebreaker when the same byte count has been reached by multiple answers. This is verifiable through edit history.

  • Is there an answer which every other answer has based their solution upon? Oftentimes, people will appropriate an existing answer to another language. This is called "porting", and the answer which has been ported is often credited (note that its possible for multiple people to use the same approach independently).

At the end of the day, which answer you select as accepted is up to you. This is merely a guide on how to approach selecting an answer and is based upon personal opinion and experience.

\$\endgroup\$
  • 1
    \$\begingroup\$ This is just what I needed, thank you! \$\endgroup\$ – uhoh Oct 20 '20 at 10:07
  • 9
    \$\begingroup\$ This really glosses over why answers are not generally accepted here. There are reasons beyond just site culture, here is an answer that explains a bit why. \$\endgroup\$ – Wheat Wizard Oct 20 '20 at 12:03
  • 1
    \$\begingroup\$ Adding on to WheatWizard's comment, Remove the Accept feature is also relevant. \$\endgroup\$ – Dingus Oct 22 '20 at 5:09
  • 4
    \$\begingroup\$ It might also be worth adding that if you are accepting a solution, some people prefer to reward the shortest solution in a particular language rather than the shortest overall. As well as that, there are people who will accept a particularly creative solution that might not necessarily be the shortest in order to award it a bit more rep. \$\endgroup\$ – Shaggy Oct 22 '20 at 10:30
  • \$\begingroup\$ We used to accept answers regularly for code-golf. Just be prepared to accept any shorter answer that is posted later (unless the challenge has an end date/deadline). \$\endgroup\$ – mbomb007 Oct 26 '20 at 15:45

You must log in to answer this question.

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