lua-users home
lua-l archive

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


On 11/08/2011 12.32, Miles Bader wrote:
steve donovan<steve.j.donovan@gmail.com>  writes:
Local-by-default and Significant whitespace raise their heads again...

Gotta wait until all the python programmers are dead I suppose...

-miles


Fortunately I "was exposed" to Lua shortly after I started learning Python (coming from an experience of mostly statically typed languages like Java and C++), so I had a better subject on which to focus my brain :-).

Although I started to appreciate the batteries of Python and its dynamic features, I always hated deeply that "significant whitespace" thing (and was bitten by it several times refactoring code).

It always brings to my mind the stubborness of some old "make" implementation and those old FORTRAN (77?) requirements (the heritage of punchcards, I mean). Ugh! I've never understood why to some people it is a good thing to make the well-formedness or (worse) the semantics of a program (in a general purposes language) depend on something that you cannot even see and that may depend visually on the settings of your current editor (ugh!)!

I can accept to spend hours to find a subtle bug because of my faults in programming (after which I probably know the language better and I'm a better programmer). I cannot accept to spend hours to detect a bug induced by a space/tab idiosyncrasy (after which I haven't learned anything and have only grown the feeling of throwing the workstation out of the window!).

Yes, I know smart editors can make your life better in this respect, but it is a silly exercise if you made your life worse by choosing an ugly syntax in the first place [1].

But as a programming professor told us when I was at the university in early 90s: "...sadly, sometimes ugly and horrible things get widespread, and even famous - so *you have* to learn how to use vi editor on a Unix workstation". 8-)

As for "local by default", I didn't know much at the time. But after learning about closures and upvalues in Lua, I can really appreciate Lua team decision of not doing that (yes - I read many of the old threads on local/global/nothing by default and I find the current alternative the best approach - YMMV).


[1] Maybe I overemphasize a bit, but IMO compared to significant WS, even Java anonymous inner classes syntax looks beautiful (ugh!). At least you *see* something!


-- Lorenzo