lua-users home
lua-l archive

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

2012/1/31 Miles Bader <>:
> 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:

Could you give a reference that support your statement ?

Otherwise  Edsger Dijkstra made his point a lot of time ago about the
goto statement:

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.