Rosetta Code:Village Pump/Uses Algorithm Template

Revision as of 12:39, 22 June 2010 by MikeMol (talk | contribs) (My thoughts)

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)

I would agree that such a template is desireable, but for my own reasons. Ultimately, I'd like to move away from MediaWiki to a more reorganizable system, and being able to tag examples with the presence of a template like that is easily high on my desirability list.
The other thing I'd suggest is that rather than use Template:Uses algorithm as a warning, use something like Template:Unidiomatic. Additionally, for any task that specifies "Use technique X to accomplish Y", you could generalize that to "Accomplish Y". For any "Do Y" task that exists where a "Use X to do Y" task's example exists, you can link over to that example. (You could also try transcluding an example page to both positionsm, but the hackary and difficult-to-edit nature of that is exactly the reason I want to move away from MediaWiki.) --Michael Mol 12:39, 22 June 2010 (UTC)