User talk:DanBron/Game of Nim

From Rosetta Code

Code Golf

Given the spirit of friendly competition on RC, I thought it might be fun to introduce a new kind of RC challenge, different from the usual "implement this algorithm" type of task: code golf.

The idea is to have a simple, but not trivial, task, where the challenge is more in whittling it down to its essentials than in innovating in the algorithm or extending functionality.

I've seen some misgivings about code-golf expressed elsewhere on RC, so I'm using this task to test the waters. My hope is that it will be a fun break for established users, draw the attention of new users, and will be invigorating generally. If that pans out, then we could create a class or category for code-golf, distinct from the typical "task" template.

Of course, because code-golf is quantifiable, it's more liable to cause disruptive competition between language camps. To forestall that and keep the competition friendly, I tried to make it clear that code-golf is to be considered a competition _within a single language_ and that it doesn't really make sense to compare _across languages_ (just as it doesn't make sense to compare "the shortest story" in English vs Chinese; English and Chinese have totally different concepts of what a written "word" is).

Anyway, seeing as this is a test case, I'd appreciate your feedback and comments.

--DanBron (talk) 14:21, 27 April 2013 (UTC)

Hi DanBron. How does code golf help to compare languages? The whole idea of golfing seems to be to obfuscate rather than elucidate. I don't think that golfing helps RC myself. -1
--Paddy3118 (talk) 16:56, 27 April 2013 (UTC)
Code Golf is one of the things we do not do here, along with performance comparisons. The problem with CG is that it tends to produce excessively compressed entries, which usually goes against the principle of idiomaticity of example; each example should show a newcomer to the language how they should solve that particular task. (The problem with performance comparisons? Well, apart from nasty code, they also suffer from being impossible to compare except on one particular system; they're just too localized in both space and time.) –Donal Fellows (talk) 07:25, 28 April 2013 (UTC)
There already seems to be a trend on the wiki to publish code examples as compactly as possible, often at the expense of readability and extensibility, explicit code golf challenges will probably only make it worse. Fwend (talk) 09:25, 28 April 2013 (UTC)
I agree that Code Golf doesn't really fit in with RC's mission to help users of one language learn how equivalent tasks may be done in new languages. However, some people (myself included) find Code Golf to be more fun as it provides a bit more of a challenge. If there aren't really any issues with the task itself, can it just be required that submissions contain a "normal" solution, and any Code Golf solutions are optional/bonus points?
--Ooorah (talk) 19:30, 12 June 2014 (UTC)
Hi Ooorah, I think we are more likely at the stage of wanting to remove this task altogether but no one wanting to be the first to take that step and waiting for the task to wither. I don't think golfing adds anything to RC's stated task. It's a million miles from writing idiomatic code by its very definition.
Now you've edited the task and brought it back to our collective consideration maybe it will go? --Paddy3118 (talk) 06:20, 13 June 2014 (UTC)
Other than the explanation being a little confusing at first, I don't really think that there's much difference between this task and Towers of Hanoi, and it's at least slightly more programmatic than Bulls and cows/Player. I can completely understand if you want to cut out the Code Golf part of it, but I don't believe there is a reason to remove the task in its entirety.
--Ooorah (talk) 13:12, 13 June 2014 (UTC)
I'd also like to see the task stay, it's a reasonably well-known game and very suitable for programming (although the computer always wins if it's allowed to make the first move). Fwend (talk) 16:21, 13 June 2014 (UTC)

I think Nim is a valid task. Just remove that "code golf" requirement. --Hajo (talk) 08:00, 25 October 2014 (UTC)