Impressed

Tobias Pankrath tobias at pankrath.net
Sat Jul 28 10:41:39 PDT 2012


On Saturday, 28 July 2012 at 16:55:32 UTC, Kagamin wrote:
> On Friday, 27 July 2012 at 00:57:15 UTC, bearophile wrote:
>> Stuart:
>>
>>> Why does D have GOTO? I haven't used GOTO in over a decade, 
>>> because it's truly evil.
>>
>> Gotos are not so evil. Just use them when they are useful and 
>> they can't be replaced by structured programming. In D I 
>> create finite state machines at compile-time that use gotos, 
>> they are quick.
>
> Do FSMs really need to be spaghetti monsters? I heard, gcc 
> optimizer can tear functions into common pieces and them 
> reassemble the functions back from these pieces, or simply 
> inline them, won't you get the same result?

State machines encoded with goto tend not to be more spaghetti 
than their
specifications (say in regex or graph picture




More information about the Digitalmars-d mailing list