Rosetta Code talk:Solve a Task: Difference between revisions

→‎Alternative Solutions: Idiomaticity FTW
(→‎Alternative Solutions: No "proper" method but ...)
(→‎Alternative Solutions: Idiomaticity FTW)
Line 4:
 
: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. --[[User:Paddy3118|Paddy3118]] ([[User talk: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. –[[User:Dkf|Donal Fellows]] ([[User talk:Dkf|talk]]) 19:38, 9 January 2014 (UTC)
Anonymous user