-3
\$\begingroup\$

I recently stumbled upon this challenge where the OP gives a non-golfed reference implementation in C++. This makes it a no-brainer to solve the challenge with C++ by just golfing the reference.

Is it a good idea to ban C++ from that challenge, or the language X from a challenge Y where Y gives a reference implementation written in X?

\$\endgroup\$
7
  • 3
    \$\begingroup\$ Last time I gave a reference implementation, I gave a very non-golfy, and readable version. Sure, Answers could have removed whitespace, and shortened variables, but even then the algorithm isn't great for golfing. Good code-golf is less about minimizing the code, and more about picking the right algorithm. \$\endgroup\$
    – DJMcMayhem
    Jul 11, 2016 at 19:47
  • 5
    \$\begingroup\$ If you find yourself asking "should language X be banned," note that regardless of the reason, the answer will almost always be no. \$\endgroup\$
    – Alex A.
    Jul 11, 2016 at 20:23
  • 1
    \$\begingroup\$ @AlexA. "Redefine the grammar of your language to make it interpret Brainfuck code." At least possible in GolfScript, and 0 bytes in Brainfuck. \$\endgroup\$
    – jimmy23013
    Jul 11, 2016 at 22:09
  • 1
    \$\begingroup\$ @jimmy23013 Hence almost always. ;) \$\endgroup\$
    – Alex A.
    Jul 11, 2016 at 23:39
  • \$\begingroup\$ Could the downvoters please explain themselves? This is valid question, it is not badly written, and downvoting is not a way to say "No". If you disagree strongly, feel free to upvote answers, but don't downvote the question. \$\endgroup\$ Aug 12, 2017 at 20:37
  • \$\begingroup\$ @Challenger5 It's OK to downvote things on Meta just because you disagree with them. \$\endgroup\$ Aug 12, 2017 at 21:29
  • \$\begingroup\$ @dorukayhan I was under the impression that that only applied for answers. (I find myself wanting a meta-meta right now...) \$\endgroup\$ Aug 12, 2017 at 23:07

3 Answers 3

10
\$\begingroup\$

No

While I agree with the conclusions of the two existing answers – that you neither have to nor should ban a language just because you've written a reference implementation in it – I disagree with some of the minor details.

Submitting a golfed version of the reference implementation is perfectly acceptable in my opinion, as long as the source of the original code is credited in the answer. Just as it makes no sense to ban a specific language because it was used in the reference implementation, it doesn't make sense to ban a specific approach.

A few more things to consider:

  • Write a non-golfed reference implementation. Try to make your code as efficient and understandable as possible.

  • Consider posting a golfed reference answer instead. Self-answering your own challenge is perfectly acceptable.

\$\endgroup\$
4
\$\begingroup\$

No, it's a bad idea to ban such languages.

The voters will vote mainly based on whether or not it is well golfed, and on the amount of effort that was put into it. it should be obvious if someone just took the reference implementation and golfed it slightly. While doing this is allowed, it is discouraged behaviour. It's also highly discouraged to explicitly ban a language, especially when more interesting and golfed solutions may still arise.

Whenever I write a reference implementation, I usually write it such that it uses a long-winded approach, such that a real golf in the language would use a different approach. While not all challenge writers do this, it's still often the case that the latter implication holds.

\$\endgroup\$
3
\$\begingroup\$

Don't disallow a language just because it's used in the sample implementation

It's fine to use the language used in the reference implementation, but, come up with your solution independently and golf it, rather than referencing the OP's sample implementation.

If your solution, that you came up with independently, and the OP's coincide, put a significant effort to golf it.

The community does not react well to banning specific languages whether intentional or not.


If you're the question poster:

Don't make a well golfed sample implementation and make it as un-golfable as possible. Additionally you can golf your reference implementation and post it as an answer to your own question if you'd like. This would avoid any confusion.

\$\endgroup\$

You must log in to answer this question.

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