Rosetta Code talk:Solve a Task

Revision as of 19:38, 9 January 2014 by rosettacode>Dkf (→‎Alternative Solutions: Idiomaticity FTW)

Alternative Solutions

Is there a proper method for adding alternative solutions for a particular language for alreadys-solved tasks? Binki (talk) 15:23, 9 January 2014 (UTC)

No "proper" method, but I usually only consider adding another solution if it is sufficiently different from what is there. This could be using a different algorithm (if the task allows), or a different style of programming if your language allows say functional and OO styles and the two forms of solution look sufficiently different. We try not to have another example in the same language just because someone else has managed to solve the task, and you really need to ask if you could improve an existing solution first. Looking at most tasks examples, hardly any have multiple solutions in the same language. --Paddy3118 (talk) 16:25, 9 January 2014 (UTC)
Occasionally, I'll write two solutions. Not very often though, and then only usually when there's really two different ways to go about it. Most tasks don't have that many options, given that I always strive to be idiomatic in my solutions too; they've got to be how I'd want others to solve them. Where a task has two or more idiomatic solutions, it's usually because the language draws more distinctions than the task author thought of. –Donal Fellows (talk) 19:38, 9 January 2014 (UTC)
Return to the project page "Solve a Task".