Pseudocode in the wikipedia
Terry Reedy
tjreedy at udel.edu
Fri Apr 1 14:23:31 EST 2005
<bearophileHUGS at lycos.com> wrote in message
news:1112362451.848227.208120 at z14g2000cwz.googlegroups.com...
> The free wikipedia is adopting a standard pseudocode:
> http://en.wikipedia.org/wiki/Wikipedia_talk:Wikicode/Specification
>
> MShonle says something nice:
Calling a feature 'baggage' is not especially nice. Neither is getting
facts wrong.
> I support the idea of wikicode. Basically I think we should present
> code in a Python-like language that doesn't carry so much baggage. For
> example, we can use English sentences (or sentence fragments) instead
> of requiring the reader to understand some obscure Python library.
> (Further, Python has the baggage that there are no block-terminators:
Python does too have block terminators. They are called dedents. In doing
so it follows standard English outline formatting and the practice of many
algorithm pseudocode writers. (I roughly estimate around half or more.)
Two examples I have handy: Jon Bently in Programming Pearls and Steven
Skiena in The Algorithm Design Manual.
> i.e., no "}" or "end"s or "fi"s or "repeat"s.
So add #whateve-ender-you want, but leave the code executable if at all
possible.
> By adding such terminators, we can make it a lot less ambiguous to all
> readers.
Dedents are unambiguous. Be adding additional redundant terminators, one
adds the possibility of mismatch and ambiguity.
Terry J. Reedy
More information about the Python-list
mailing list