Rosetta Code:Village Pump/Uses Algorithm Template

Revision as of 11:26, 22 June 2010 by Rdm (talk | contribs) (we should have caution about tasks which specify algorithms?)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

I have often struggled with tasks which specify that a specific algorithm be used.

If someone were paying me to write code, and they asked me to use a specific algorithm, I would typically ask them why they wanted me to use that algorithm. And then I would try and get them to agree that they should specify those reasons, as requirements, rather than the algorithm itself. This approach almost always results in a superior result.

The point here is that if you want good code, technology issues should be factored out of specifications. At worst, you have a specification which specifies an interface to some existing system.

Of course, here at rosetta code we are doing something different -- chrestomathy has an explicit goal of showing how languages relate to each other.

Nevertheless, I am wondering if we should not have a template which cautions people about this issue. An algorithm which offers superior performance in one language might sometimes be suboptimal by factors of thousands or millions in another language. So I am thinking perhaps a "uses a language" template might warn that because the algorithm has been specified it that performance should not be an issue for this task?

--Rdm 11:26, 22 June 2010 (UTC)