[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT and Lua 5.2?
- From: Francesco Abbate <francesco.bbt@...>
- Date: Tue, 31 Jan 2012 12:46:45 +0100
2012/1/31 Miles Bader <miles@gnu.org>:
> Mike's expressed displeasure with some of them (e.g. the details of
> the 5.2 bit library), and approved of others (e.g., "goto").
> I suspect luajit will likely over time add various 5.2 features as
> time and funding allow (and as clients request, of course).
I didn't find anything where Mike was expressing his approbation for
the goto statement. I only found that:
http://lua-users.org/lists/lua-l/2011-06/msg00851.html
Could you give a reference that support your statement ?
Otherwise Edsger Dijkstra made his point a lot of time ago about the
goto statement:
http://en.wikipedia.org/wiki/Considered_harmful
In general the goto statement is considered harmful because it does
encourage bad coding style (the so called "spaghetti code"). There is
a lot of legacy FORTRAN code like that.
It is well accepted in the programming theory and practice that
structured programming without goto statements is a good practice and
use of goto statement should be strongly discouraged.
The C programming language does have the goto statement. This is
sometimes useful since C it is quite close to the machine and the goto
statement can help to produce optimal code. For the other side its use
is acceptable only for some specific patterns like exiting from a
function when an error was produced. In this latter case the goto
statement is actually useful to ensure that resource are correctly
disposed before returning to the caller function. In more high-level
programming languages this is not necessary because exception handling
(with or without garbage collector) offer a better alternative.
For high-level programming languages the goto statement at least
dubious and probably harmful.
Francesco