Re: Good Use of GOTO
- Posted by c.k.lester <euphoric at ckl?ster.?om> Jun 06, 2008
- 823 views
Derek Parnell wrote: > Kat wrote: > > I gave code for that also. It involved: > > goto exit > > goto retry > > goto restart > > goto next > > goto cleanup&return > > etc. > > > > The only way that's not clear is if you don't read english. > > For example: > Oh hang on, all labels in the scope must be unique. So now I have to > numbering? > them. > So now not only do I have more to type and more to read I also have to create > unique label names. > Then we've got this sort of problem.... > The solution we have chosen is this ... > There is no misleading control flow statements now. They are shorter. They > inform > you of the coder's intentions. And this is already in Euphoria 3.1 As Derek clearly demonstrates, any usage of proposed code must be shown in the context of real code. We have seen that factorial() without GOTO is faster than factorial() with GOTO. Derek has shown that the special branching GOTOs are actually more usable than unambiguous GOTOs for those same purposes. So, while I initially thought Kat's solution was pretty good, I now find it would be cumbersome to maintain, especially in the context of a large program like EuSQL, wxEuphoria, Win32Lib, or BBCMF.