lua-users home
lua-l archive

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

Your central argument seems to be 'symbols are easier to read than
words'. I think this is simply false. It's not even a case of personal
preference. Here's why:

You have created a set of symbols that are mnemonic for you. Because
you invented them. Anyone else reading your code /even another
symbol-lover/ will have to spend the time memorising e.g. that :cr:
means coroutine.resume, and not carriage return. Likewise, people
writing in your style will have to memorise that math.max translates
to :/\:, and not :>?:, :^:, or any number of equally suggestive

A similar argument against operator overloading I came accross in a
C++ book: suppose we have a class representing sets, and we write 'x &
y'. Does it mean union or intersection? If you follow the mathematical
logic it means intersection, and if you follow the typical English
meaning it sounds more like union. So, even though it seems quite
reasonable to use a symbol for this common set operation, it only
introduces confusion just because peoples minds work in different

Likewise, I've read numerous articles pleading with academics to
define their notation when writing theoretical papers, so I'm clearly
not alone in finding it extremely frustrating when authors just assume
that everyone else understands their made-up notation, or the notation
that they assume is standard because their teachers used it. Even
something as trivial as the order of function composition isn't

So, as long as you are the only person who has to deal with your code,
abbreviate to your heart's content. But don't claim that the result is
more readable since no-one else will find it so. Because if they were
the ones inventing the symbols, they'd come up with a different set.

-- Jamie Webb