lua-users home
lua-l archive

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


On Wed, Jul 24, 2013 at 2:45 PM, Fabien <fleutot+lua@gmail.com> wrote:
> Fancy syntaxes tend to improve your ability to map your own thoughts onto
> code, but make your code more impenetrable by anybody else.

This is very true. Lua, sometimes controversially, chose to use
keywords instead of symbols to delimit blocks ('then', 'end' etc.) and
for boolean operators ('and', 'not' etc.), and has so far resisted a
short-form/"lambda" syntax for function definitions. Whatever you
think of this, I think the intention is clear: encourage code that is
more immediately readable to people who are not already very familiar
with the language (or perhaps code in general), at the expense of
information density.

Now, some people think it's worth slacking off a bit on this
philosophy, but this suggestion is a complete reversal: it encourages
code where, not only do you have to be familiar with the language to
make sense of what a chunk of arbitrary Lua code is doing, but you
have to be familiar with the author's personal set of favourite custom
operators. (Also, what happens when you get to the situation where you
want to use two third-party Lua libraries, written by two different
people, each with their own ideas about what the same operator symbol
should do...?)

-Duncan