Re: Good Use of GOTO
- Posted by Chris Bensler <eu at c?eati?eportal.ca> Jun 06, 2008
- 852 views
Jeremy Cowgar wrote: > > c.k.lester wrote: > > > > It has never been demonstrated that a Euphoria developer needs the ability. > > > > CK, did you actually read any of the links I gave in a previous post? > > > > Those developers (again who are no dummies) decided that goto was far > > > superior. Please tell me why a euphoria developer should not also have > > > that ability? > > > > Because a GOTO in C might increase performance by up to 50%. > > > > Show me similar performance benefits for Euphoria. > > > > Huh? I've said 1,000 times function calls are expensive and *no one* will say > they are not. Goto can avoid many cases of function calls in critical > situations. > > > If you can't, then GOTO should not be added because it's just useless bloat > > and at least won't be around to trip programmers up. > > Trip programmers up? Seriously, I'm kind of getting tired of playing this > game. > I've said a million times (not 1,000) that programmers can abuse if, while, > for, functions, procedures, includes, etc... If a programmer is going to abuse > goto, they have plenty of other things they will abuse as well. I think you > are still paying attention to the document about why goto is bad that was > published > in 1968. Languages have changed a bit since then. > > Can you please spend some time and read the links I posted previously and then > continue to comment if you wish? > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I've read all of those links you posted in entirety. It appears the only really valid uses of goto discussed are for exception handling which does not halt execution but skips instead, and for exiting nested blocks of code easily. One other valid use I can think of is for jump tables, but I don't know if that would be relevant in Euphoria. The other valid argument for goto is optimization, but I have a hard time seeing this as an issue in euphoria. Mainly because if speed is so critical, Euphoria is probably not the right choice regardless of the use of goto. Lastly is pure and simple convenience. IMO this is the greatest reason to include goto. People do deserve the freedom to work in their own fashion. We don't all think alike. The choice to add goto however is not just about what is good for the community but what is good for the language in the long term as well. I've initiated a list of pro's and con's. Feel free to elaborate, comment or criticize. PROS: Ambiguous Flow Control Convenience of Development Potential for Optimization CONS: Ambiguous Code Flow Inconvenience of Maintenance Potential for Abuse Does not Adhere to Euphoria's Top-Down Philosophy Complex Rules of Usage Chris Bensler Code is Alchemy