|
Roberto Ierusalimschy wrote:
Roberto,There was very good reason for that battle cry.Certainly there was. 40 years ago. At that time, most people used FORTRAN IV or assembler, which do not have ifs or whiles. Most people learned to program without ever seeing proper control structures. Programmers not only had to use gotos; they did not have proper mental models to organize those gotos. Things changed a little since then. -- Roberto It would be nice if you knew the history to which you refer. By 1970, most business programs were in COBOL, whilc scientific or engineering programs were in FORTRAN or assembler, though ALGOL was hanging around in the background and PL/I was being rapidly shoved forward by IBM. By 1974, we had the first of the commercial 4th generation languages like EzTrieve (Pansopic), that initially had if-then-else/elseif and no labels, as the only means of controlling what was executed. There were a lot of "if 1=1" statements in the early code. Even in assembler (through macros) and COBOL, the GOTO was not entirely necessary, as both had constructs that did a fair job of eliminating the classical GOTO. If you wonder how I know, I wrote my first programs in 1966 in Assembler, FORTRAN, and COBOL, proceeding down though the years to PL/I, ALGOL, LISP, MAINSAIL, and at least 30 or 40 others. It turns out that thoughtful programmers have been using proper structure practically since the beginning of computing, while those who are not so thoughtful can manage to produce unreadable garbage in almost any language. What all this discussion and my own fiddling are telling me about lua is that it is a compact, powerful, flexible, and largely write-only language that is sufficiently subtle that I would reeally hate to maintain anyone else's code that was not written with an explicit and documented subset of the language. It reminds me of the comment one of my buddies made about such flexible things...did you ever try to sit in a flexible chair. With all the dynamism in the language itself and splits in the language as well as various weirdnesses between succeeding versions of the language, I would have a hard time recommending it to anyone writing anything but the most transient code. Of the functional languages, it is probably the most straightforward and usable, but that is faint praise, considering the competition. I wish you luck. Everett L.(Rett) Williams II |