[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: (kick,ass): => kick( ass ) ::
- From: Mark Hamburg <mark@...>
- Date: Sat, 6 Feb 2010 09:57:46 -0800
On Feb 5, 2010, at 12:49 PM, Majic wrote:
> Personally, I like how verbose Lua is... makes things (at a glance to
> new programmers) pretty self-explanatory. :>
There's an interesting balance between approachability and avoiding having meaning hidden with syntax. Converting syntax into special characters frequently leads to cryptic constructs. On the other hand x.foo is easier to read than x[ "foo" ].
This discussion keeps coming up because if you write code that frequently involves essentially short lambda-expressions, then "function" and "end" start to take up an excessive portion of the visual weight. If you routine pass blocks to be executed, they also become heavy weight. Ruby is interesting in essentially having a standard way to pass a block as a last parameter -- not that I am recommending that for Lua and to make it work one really needs to deal with the fact that the control flow for blocks and functions is not generally expected to be the same. Lua's alternative to Ruby's use of blocks tends to be around constructs like iterators, but there are other tensions there in what can be easily expressed.