[Date Prev][Date Next][Thread Prev][Thread Next]
- From: David Given <dg@...>
- Date: Wed, 20 Sep 2006 22:05:13 +0100
Jerome Vuarand wrote:
> In my opinion, syntax doesn't matter much. It matters in small companies
> and projects for the reason that it's easier to find C programmers than
> smart programmers that could learn a new language.
Syntax should not matter to any programmer with any professionalism at all ---
it takes, maybe, an hour to switch syntax styles provided there's no
underlying semantic changes.
However, one crucial aspect of using a particular syntax is that it raises
even *less* like C or C++ or Java than Lua is, as a matter of fact. Example (I
found out about this two days ago):
var i = 1;
var j = 2;
var j = 3;
return i + j;
What do you think this returns? 3? Wrong! It returns 4. var isn't lexically
keyword, 'let', for defining lexically scoped variables. It never occurred to
me for a moment that such a thing might be needed, because all my training was
encouraging me to believe that 'var' behaved sensibly, and was lexically
scoped. I've mentioned this to some people at work, and have received, without
exception, expressions of surprise and disbelief.
The designers' decision not to make var behave that way strikes me as being
(I suspect, in Lua terms, that each call frame has an environment, and 'var'
declares an entry in that environment; so accessing a variable is actually
doing a table lookup in the environment. Lua's local variables are much more
like C registers.)
I'm not particularly keen on Lua's syntax, simply because it's a bit wordy and
I don't like that. However, I learnt it, and now I'm used to it. The fact that
it *is* different helps me to distinguish it from other languages that behave
differently, such as C++ --- I program in both frequently and hardly ever get
them confused. What's more, now I'm used to it, I'd violently oppose changing
it simply because I *am* used to it. I would much rather the language stayed
as it is so that I can remain productive, than to have it change to follow the
current fashions and require me to relearn things. (I still do most of my
coding in Lua 5.0, for this reason.)
If a company is rejecting Lua simply because it looks funny, well, screw 'em.
If they're not competent enough to judge a tool on its technical merits I
reckon we're better off without them.
+- David Given --McQ-+ "Gaping from its single obling socket was
| email@example.com | scintillating, many fauceted scarlet emerald..."
| (firstname.lastname@example.org) | --- Jim Theis, _The Eye of Argon_ (spelling
+- www.cowlark.com --+ original)
Description: OpenPGP digital signature