Re: goto: it's conceded
- Posted by Derek Parnell <ddparnell at ?igpo?d.com> Jun 01, 2008
- 714 views
David Cuny wrote: > Sorry for coming in late on the conversation, but please allow > me to add my own grumpy two cents worth. Hi David, its so nice to hear from you again. Hope things have been going well for you. > I can't see the harm of adding GOTO to Euphoria. It adds real value > for some people, and it doesn't (as far as I know) harm anyone by adding > it. > Of course, I'm assuming the reason for not having a GOTO isn't technical. Your right about that. The reason we haven't got GOTO as I write this is because everything takes time and nothing happens just by saying "I want". > There's this odd idea that adding features to a language will cause > it harm. This concept baffles me. Just because you can get by > without a feature, or you can add a workaround to do without it, > doesn't mean the language is better off without that feature. It appears that you haven't caught up with current developments yet. For some reason, it appears that if passionate discussion occurs it is also assumed that the status quo will always hold out. It baffles me as to where this idea comes from, because if one actually follows both the conversations AND the actual work being done, it can lead to a much better understanding of where things are really going with v4.0. There will be a GOTO in the forthcoming v4.0. It is currently being worked on and, as I understand it, it is mostly completed. I believe it will allow transfer of control to any point (forwards and backwards) within a routine, except into and from a loop. It will not be allowed at the topmost execution level and you can't jump into a loop or out of a loop, but you can jump around inside a loop. > Here's a feature I found in Python: an 'else' clause for loops. > The 'else' is triggered if the loop is exited without a 'break' > being encountered. > For example: > > -- look for my name in a sequence > for i = 0 to length(s) > if equal( s[i], "my name") then > printf("got a match") > break > end if > else > printf("no match found") > end for > > Although this is just syntactic sugar, it's really, really useful. > But I can't see this ever getting implemented in Euphoria, because > the language purity police will argue that you can do the same thing > without the 'else' clause. Adding it would only bloat the language. Firstly, this looks like a handy thing to have. I don't remember having seen this construct before. I assume the index value is still in scope for the 'else' block to use. Secondly, who is this "language purity police" you talk of. I haven't come across them yet. And if they do exist, they are exceptionally ineffectual because there are quite a few neat syntax sugarary bits coming our way. Maybe not all in v4.0 but I can't see them being unnecessarily delayed. > From my perspective, this need to keep Euphoria spartan creates a language > which isn't any fun to use. When I'm looking to code a solution, I look for > the tool that will allow me to get something done, not for the one that > enforced the maximum amount of B&D pain. I think you'll like some of the new ideas being implemented. > To choose not to implement a feature because someone *might* misuse it, > reminds me of the definition of a Puritain as being someone that worries > that> somewhere, someone might be having fun. This sounds like you might have been misinformed or misunderstood my personal position on the GOTO debate. Kat (excuse me for talking about you) does not seem to fully understand what I have been saying and at times she appears to misrepresent my words. I hope its me that has misunderstood her. My position is simple. I believe GOTO, by necessity, adds to the maintenance overhead of any program it is used in. The amount of increase varies but it is always an increase. Therefore, if I am ever being asked to work on maintaining such code, I will need to have the use of GOTO justified to me before I could be comfortable with it. The most obvious justification would be in the area of performance, such that by using GOTO the improved performance is practical, necessary and can only be achieved via GOTO usage. I have publicly stated that if one wants to use GOTO in their own personal code they should be free to do so. I actually argued for a GOTO in Euphoria that had no limitations whatsoever, just like assember. > If the feature isn't going to do any damage to you, but will > be truly useful for someone, how do you justify not implementing it? Ok, there are limitations to that concept but in general, I agree. For example, having built-in matrix operations ala FORTRAN would be useful to quite a few people, but that might have to wait awhile before getting in Euphoria. In the meantime, a library solution will be used. > OK, back to lurking. I'd rather you didn't. You skills are needed in helping improve Euphoria. Why don't you join us in working on the beast. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell