[Home]Algorithms on Wikipedia

HomePage | Recent Changes | Preferences

Showing revision 14
Wikipedia, unlike most traditional Encylopedias, contains detailed descriptions of many algorithm, often with sample implementations.

This is draft of hints for good sample implementations of algorithms for Wikipedia. Further discussion is invited.

The main purpose of sample implementations is to help reader understand the algorithm, not to provide ready-to-use code. Implementations should be easy to read and understand for average programmers or computer science students.

Choosing an appropriate language is important. Suggested languages are Ruby, Python, and, for algorithms that need lower-level features, C. Some algorithms might benefit from using another kind of language. In that case, a language that the average reader is most likely to understand should be used. For example it's usually better to use C++ or Java instead of Smalltalk or Eiffel. Using dialects of Pascal and BASIC or Perl with too much magic is discouraged.

It's good to avoid language-specific constructs in examples. Using iteration? is usually prefered over using tail recursion because this is more popular way of coding and because popular implementations of some languages do not support constant-space tail recursion.

In case when these hints aren't sufficient to make decisions, it's ok to provide more than one sample implementation.

A list of algorithms is available.


/Talk

HomePage | Recent Changes | Preferences
This page is read-only | View other revisions | View current revision
Edited December 14, 2001 5:03 am by Lee Daniel Crocker (diff)
Search: