-----BEGIN PGP SIGNED MESSAGE-----
Moin,
On Monday 12 December 2005 18:59, Phil Boswell wrote:
"Phil Boswell"
<phil.boswell(a)gmail.com> wrote
in message news:dnk5ht$8e6$1@sea.gmane.org...
[snip]
... My personal bug-bear is {{qif}}, mainly
because I cannot for the
life of me see what it can do that {{if}} cannot.
Now that I have taken another look at it, I think that it is actually
doing something extremely clever. The wikicode is:
[snip a lot]
While clever, that doesn't mean it is good. Not every thing you can do,
you also should do. :)
Takes me back to my (admittedly brief) functional
programming days and
the dreaded lambda calculus :-)
So whether this template is more efficient than {{if}} basically boils
down to whether the Template Syntax code can perform the
transformations detailed above quicker than the extra fetch which the
slightly-simpler {{if}} requires, relying on the trick whereby if you
specify two parameters with the same name, Mediawiki discards the first
and uses the second, passing parameters to a supporting template named
{{show1}}.
I'm betting on the code beating the fetching by a long margin. So until
we can persuade some kind developer to implement the "if" functionality
in Mediawiki, I'm championing {{qif}}. It would be nice if we could
retire the current version of {{if}} and re-use that name, but the nice
thing about a wiki is that you can take things just about as slow as
you like, provided nobody jogs your elbow.
I you thought that script languages like Perl, PHP, phyton, etc were slow,
then this system has to beat them hands down. I can't even imagine how
much CPU cycles must be burned for such a thing. Thank god it is only
executed on rendering the page, once, and not for every view.
I can see it now:
* After {{{qif}}, somebody implements loops.
* Soon lexial scoping, the switch statement and subroutines follow.
* 5 days later the wiki-template system is turing-complete.
* 2 days later a careless placed "{" triggers an endless loop and
brings wikipedia down for 2 3/4 hours, until the bug is fixed.
* 1 hour later JoeCleverProgrammer posts his brainfuck-interpreter, done
entirely with "clever" templates in wikitext.
* a week later the first page consisting only of curly braces, the pipe
symbol, spaces and newlines is spotted. When viewed in a browser, it
renders as "kilroy was here", due to a clever abuse of templates,
variables, bugs and some unrelated accident involving a pound of butter,
a slippery server room floor and an unfortunately placed button.
Joking aside, IMHO, if that sort of (ab)use of templates continues, soon
the only people qualified to edit pages will be programmers. The
wikisyntax is a success because it is so easy and maintainable/readable
by mere humans. Crafting "clever" systems on top of it will merely make
normal humans go away as they will not be able to understand this stuff
even after staring on the curly mess for an hour.
Case in point is that regular contributors to smaller wikis already
struggle with the table syntax or even simple templates. Variable
substitution and conditional template inclusion will break their little
minds.
Best wishes,
Tels
- --
Signed on Mon Dec 12 21:27:19 2005 with key 0x93B84C15.
Visit my photo gallery at
http://bloodgate.com/photos/
PGP key on
http://bloodgate.com/tels.asc or per email.
"Elliot, Sie Schwachkopf!"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iQEVAwUBQ53gKncLPEOTuEwVAQHdJwf/SHDGdF2RyhRgSPRfnLbs9MLxHa4z0plw
XT/5i0altlsK/lAMbjh0Y+n23fN9191B0KniKRFcsDuUE1nPPpfDoLvoYgLAIelC
XVbw7UCtdGstEzD6QG96t/gG5rb0GPbsaSe0Il3f3X10gC5gl27xfn17vzJWQPnS
MYFOFQuDUGB4V71O8pSaLGCclqHEKhDyDKYBkKt/LBN4sD5rK587fZFGOfnXGQSQ
NfJJhT/BQCeKC4aMIBulVTuLNTN79gOFCv7dgkuexfdmCcboahtoD3qtOabYAYuF
jEWrtXnpuK35t/hQDsRvZtc6VSvPmIRDa43cTKskmWQC5RQIEyDSVw==
=Emng
-----END PGP SIGNATURE-----