lua-users home
lua-l archive

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


On Wed, Nov 01, 2006 at 06:19:58PM -0500, Jerome Vuarand wrote:
> Spaghetti code come from carelessly used unconditionnal jumps (that is
> the bad goto). I aggree that it can complicate code maintenance, but

Unnecessarily complex and hard to understand flow control can be created
with conditionals as well as with goto.

	"Please don't fall into the trap of believing that I am terribly
	dogmatical about [the go to statement].  I have the uncomfortable
	feeling that others are making a religion out of it, as if the
	conceptual problems of programming could be solved by a single
	trick, by a simple form of coding discipline!" 

	- Dijkstra

For those who think goto in all circumstances is "unstructured
spaghetti", how would you feel about the ability of lua functions to
return from deep inside nested loops being removed?

Breaking out of multiple nested loops is useful!

  Knuth - Structured Programming with Goto Statments:

  http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf