[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax
- From: Josh Simmons <simmons.44@...>
- Date: Sat, 18 Jun 2011 12:25:57 +1000
On Fri, Jun 17, 2011 at 2:31 AM, Edgar Toernig <froese@gmx.de> wrote:
> David Kastrup wrote:
>> Edgar Toernig <froese@gmx.de> writes:
>>
>> > In my experience, it helps reading and understanding code if the
>> > jump-statement gives a hint about the direction the jump takes,
>> > forward or backward.
>>
>> A common use case for goto is the implementation of state machines. It
>> would complicate the generation of them if you had to specify the
>> direction where the label is to be found.
>
> Hmm... for some definition of "complicate", yes. But at the same time
> you help later readers to find the target state in the code (code is
> read more often then written, so time spent making reading easier pays
> off).
>
> Well, one _could_ add a third variant to jump to nearest label
> (i.e. backto/skipto/goto or goto</goto>/goto), but ...
>
> Ciao, ET.
>
>
You're got more serious issues if your function is so convoluted you
can't find the label matching a goto without being given hints. I
think it's folly to try and fix people's code by making a feature more
complicated, people who write rubbish will write rubbish either way,
and it doesn't really help those that write nice code to start with.
- References:
- [ANN] Lua 5.2.0 (beta-rc1) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Alexandre Erwin Ittner
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Frank Meier-Dörnberg
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, David Kastrup
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Frank Meier-Dörnberg
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Eduardo Ochs
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Frank Meier-Dörnberg
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, David Given
- Re: [ANN] Lua 5.2.0 (beta-rc1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax, Edgar Toernig
- Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax, David Kastrup
- Re: [ANN] Lua 5.2.0 (beta-rc1) goto syntax, Edgar Toernig