lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Lua list <lua@bazar2.conectiva.com.br> writes:
>I think the real solution is to:
>1) call them examples, not tests :)
>2) fix or replace them to the point where you can be proud
>to call them good, simple examples of Lua code.

Don't call them tests or examples, call them "cliches" (following the
terminology used by the Lego Constructopedia...) The term "patterns" would
also be appropriate but it has already been used in OOP, of course. The
cliches would sometimes be complete programs but would often just be
isolated examples of loops, metatable changes, Lua OOP techniques, etc.

These cliches are perhaps more important for Lua's future than libraries
of routines, especially those written in C rather than Lua. There are
bound to be more people who will use Lua as a scripting language for
well-known products (Lightroom, Baldur's Gate, modo, etc) than for any
other purpose. Relatively few will embed Lua in their own apps or use it
for command line scripting. Extensions written in C can be added to your
own code, but not to modo and Baldur's Gate and most other embedded Lua
interpreters. I would think that non-programmers tinkering with scripting
in these apps/games would be more inclined to copy and paste from a web
page than download complete source files (think of the popularity of
JavaScript code snippet sites). Having a bank of cliches, snippets or
whatever you want to call them would be a huge boost to the main usage of
Lua.

A well-designed cliche bank ("Clicharium"?) would also be interesting in
its own right as it is a relatively underdeveloped approach to coding
practice. We would probably want some kind of simple peer review to ensure
that the cliches really were of good quality. The wiki model lends itself
well to this if we require that contributors *must* be provide an
explanation for all changes they make (ie, reject changes that don't
contain an explanation). However, we should also have some system to let
the user verify that the code actually works. Perhaps an interactive Lua
interpreter running on the web server which could execute code submitted
by a form on the web page? And then maybe syntax highlighting, simple
templating (ie, changing variable names in the sample code to your own
names, etc)...

I imagine at least some of this could not be done with existing wiki
software and would require extra development work. Maybe a direction for
the future, though.

&.


#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared 
by NetIQ MailMarshal.
The Blackpool Sixth Form College.
#####################################################################################