25
\$\begingroup\$

Tl;dr: The minor improvements that takes an answer from 44 to 39 are often the most interesting and impressive feat. If you made the improvements, then it should be OK to post it as your answer.


Note: This post is about site culture, not policy making.

I'll use Luis Mendo's comments on one of my most recent posts as an example.

  1. I posted my original answer
  2. Luis Mendo commented and suggested a different approach that saved 5 bytes
  3. I found an approach that saved another byte.
  4. Luis found another different approach that saved 5 bytes
  5. Before I even responded, Luis found a new different approach that saved yet another 9 bytes.

Of course, there are similarities between the solutions, and they're probably based on the idea of the previous revisions, but it's still a different solution. Maybe Luis wouldn't have solved the challenge at all if it wasn't for my post1, but the shorter approaches are still his.


I suggest that:

  • We still post comments suggesting simple improvements ("you can use 1e3 instead of 1000")
  • We post separate answers, even if they're inspired by (and similar to) someone else's. And as always: Give credit where credit's due.

1 Of course he would, but let's pretend he wouldn't.

\$\endgroup\$
  • 3
    \$\begingroup\$ I agree. My feeling is that the culture leans towards commenting. People don't post answers based on someone else's original answer because it goes against the culture and it looks like they're selfish. Everybody else comments, so I should probably do the same... \$\endgroup\$ – Stewie Griffin Mar 7 '17 at 22:07
  • 29
    \$\begingroup\$ Honestly, the generous and collaborative spirit of helping others with their golfing is one of my favourite parts of this community. Ideally, we'd need a CW-like feature where multiple contributors can get rep for a collaborative effort, but unfortunately the SE software doesn't provide such a feature. \$\endgroup\$ – Martin Ender Mar 7 '17 at 22:51
  • 4
    \$\begingroup\$ For me, having two 'competing' answers, each having a mention of the other, is a very good alternative to what @MartinEnder describes. I don't see how a little bit of competition gets in the way of a collaborative spirit on PPCG. \$\endgroup\$ – Sanchises Mar 13 '17 at 7:36
  • \$\begingroup\$ I think the main problem with this is that there is a very grey area between simple improvements to major improvements on the same approach to a whole new approach. With a rule like this you are always going to have a lot of ambiguity. \$\endgroup\$ – TheLethalCoder Mar 21 '17 at 11:20
  • \$\begingroup\$ @TheLethalCoder, I'm not proposing a rule, the question is about site culture. It's very common to comment instead of leaving a new answer. I feel that if I post the first answer in Octave and someone comes up with a shorter approach (even if the approaches are quite similar) then that user should get the most credit for it. Now it's almost a "Fastest gun in the west" culture, where the fastest one will win (per language) even if it's not well golfed, because someone will suggest: -23 bytes for this, -3 bytes for this, -14 bytes for this ... Instead of posting the improved code themselves. \$\endgroup\$ – Stewie Griffin Mar 21 '17 at 12:00
  • \$\begingroup\$ @StewieGriffin I agree with the idea I'm just stating that there is a grey area between minor and major improvements. \$\endgroup\$ – TheLethalCoder Mar 21 '17 at 12:01
  • \$\begingroup\$ I do tend to agree with Martin though... It's just that I feel that if I made a mediocre golfing job and someone finds ways to improve it, then I feel I'm taking the credit for their work (even if I say: -9 bytes thanks to John Doe). \$\endgroup\$ – Stewie Griffin Mar 21 '17 at 12:01
  • \$\begingroup\$ @TheLethalCoder, there is. But the minor improvements are often the hard ones. Golfing something from 20 to 18 might very well be much harder than golfing something from 53 to 20. \$\endgroup\$ – Stewie Griffin Mar 21 '17 at 12:02
46
\$\begingroup\$

Could, but not "Should"

Someone can post a separate answer using a new approach, but they don't have to. I feel like "should" is a bit strong, as it implies that it's wrong not to, which I don't think is the case. If someone feels like giving a comment instead of posting a new answer, it's their choice.

\$\endgroup\$
  • 8
    \$\begingroup\$ "should be OK to post a separate answer" is accurate, I think—not the same thing as "should post a separate answer" \$\endgroup\$ – Greg Martin Mar 8 '17 at 1:24
  • \$\begingroup\$ FYI I think this is heavily based on the consensus we have for duplicate answers. Posting an answer using the same algorithm as a separate one instead of commenting for minor golfing mistakes is duping, and only supported by that consensus. \$\endgroup\$ – Erik the Outgolfer Mar 8 '17 at 11:08
  • \$\begingroup\$ @EriktheOutgolfer The consensus is that duplicate answers are allowed. Though, this is is more because some users post similar answers at the exact same time sometimes, or come up with the same answer independently. It's not an excuse to copy/paste, for example. \$\endgroup\$ – mbomb007 Mar 8 '17 at 14:32
  • 1
    \$\begingroup\$ I have seen lots of times when someone will do something really clever in say Python and then someone will come and post an answer and the only thing they have changed it to port it to say Pyth - they didn't do any original thinking but they have a shorter answer so they get more votes. I consider that more of a dupe than finding a different approach that comes out shorter. \$\endgroup\$ – Jerry Jeremiah Mar 16 '17 at 22:01
11
\$\begingroup\$

Post a new answer if you find a different approach

If you found a different approach then post it as a new answer. As far as I am aware there is no rule against answering a challenge in a language it's already been answered in.

To make myself clear, if I found a shorter way to implement the same method, shaving off a small number of bytes, I would leave a comment instead. If I found a new solution that is fundamentally different than the original I would post a new answer.

\$\endgroup\$
  • 1
    \$\begingroup\$ But to be clear: You're not banning people from submitting the same approach, but shorter, correct? Just saying (which I agree with) it's polite to comment. \$\endgroup\$ – Rɪᴋᴇʀ Mar 7 '17 at 21:18
  • \$\begingroup\$ @Riker don't want to ban anyone from doing anything. I just mean that I would do it that way. I've updated the answer to reflect that. \$\endgroup\$ – Mike Bufardeci Mar 7 '17 at 21:22
  • 1
    \$\begingroup\$ "As far as I am aware there is no rule against answering a challenge in a language it's already been answered in." -- You're on the right track, but more so, there's strong indicators that posting even duplicate answers are encouraged. \$\endgroup\$ – AdmBorkBork Mar 7 '17 at 21:25
  • 4
    \$\begingroup\$ I think "if you find a new approach" is a way too high bar for golfing suggestions to be a new answer. Even most suggestions that change large parts of the code and bring in new ideas do not change the overall high-level approach to something "fundamentally different". \$\endgroup\$ – xnor Mar 7 '17 at 22:06
  • 4
    \$\begingroup\$ The problem is that the difference between different approach and shorter way to implement the same method is often blurred \$\endgroup\$ – Luis Mendo Mar 7 '17 at 23:23
  • \$\begingroup\$ @xnor If you feel that way, why not post it as an answer? Right now the consensus seems to run counter to your opinion. \$\endgroup\$ – Mike Bufardeci Mar 8 '17 at 15:57
  • \$\begingroup\$ @LuisMendo If you feel like you changed it enough, post it as a separate answer. \$\endgroup\$ – Mike Bufardeci Mar 8 '17 at 15:59
  • \$\begingroup\$ "Fundamentally different" is also my determining factor in deciding whether to tip the previous answer or to write my own post. \$\endgroup\$ – Patrick Roberts Mar 16 '17 at 23:11

You must log in to answer this question.

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