GodForsakenSoul Posted February 13, 2008 Share Posted February 13, 2008 one thing always bugged me about any programing language: why do EVERYONE HATE the goto thing?it works pretty nicely o.Oi never use it to have my dignity though.i don't hate it, but everyone else seems to hate the goto thing and everyone who use it. Link to comment Share on other sites More sharing options...
Nutster Posted February 13, 2008 Share Posted February 13, 2008 The problem with Goto is the ease with which a novice, or even an experienced, programmer can make very convoluted programs which get exponentially more difficult as the program gets bigger. Look up spaghetti code on Wikipedia for some ideas about this. Debugging or maintaining a program full of Gotos is a lot more difficult than one that uses a structured programming language, like AutoIt 3. Because part of our focus was to make a language that was easy to learn, goto's were chucked so that people could more easily debug their scripts. Also, using structured programming allows tools like Tidy (part of the AutoIt SCite editor) to organize the structure and easily find when structures get out of hand.I hope this helps. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
James Posted February 13, 2008 Share Posted February 13, 2008 If you read around you would see that Jon and Team removed Goto ages ago! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Valik Posted February 13, 2008 Share Posted February 13, 2008 Correction, goto was never implemented to be removed. Since AutoIt 3 was a rewrite from scratch, Jon didn't even implement goto. Link to comment Share on other sites More sharing options...
James Posted February 13, 2008 Share Posted February 13, 2008 Yes but it was in V2.. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Valik Posted February 13, 2008 Share Posted February 13, 2008 V2 != V3. V3 is not a superset of V2 like C++ is of C. V3 was a brand new product designed from the ground up. Link to comment Share on other sites More sharing options...
James Posted February 13, 2008 Share Posted February 13, 2008 Fair enough. Works for me. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
AL3X Posted February 13, 2008 Share Posted February 13, 2008 (edited) -- Edited July 2, 2015 by AL3X Link to comment Share on other sites More sharing options...
GaryFrost Posted February 13, 2008 Share Posted February 13, 2008 Juu So you will never add "GoTo" ? :)Nope SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
James Posted February 16, 2008 Share Posted February 16, 2008 - Goto does not exist due to the support of loops and user-defined functions. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Uten Posted February 17, 2008 Share Posted February 17, 2008 one thing always bugged me about any programing language: why do EVERYONE HATE the goto thing?it works pretty nicely o.Oi never use it to have my dignity though.i don't hate it, but everyone else seems to hate the goto thing and everyone who use it.Get a job maintaining RPG code on AS/400. You will probably learn to hate it to.. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
GaryFrost Posted February 17, 2008 Share Posted February 17, 2008 Get a job maintaining RPG code on AS/400. You will probably learn to hate it to..Or over 30,000 lines of Fortran written in spaghetti code. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 17, 2008 Share Posted February 17, 2008 I read somewhere that goto is mostly used to break more than one loop when not being used in a beginner fashion. A real programmer could make sentinels to continue breaking loops if more than one break was needed. Link to comment Share on other sites More sharing options...
Valik Posted February 17, 2008 Share Posted February 17, 2008 (edited) From what I've seen goto is mostly used to jump to cleanup code at the end of a function. However, my experience seeing goto in use is from Microsoft examples or Microsoft generated code. I don't use goto, of course, so I simulate the same idea using a for(; loop which I conditionally break out of on error and unconditionally break out of after one complete loop. The advantage to this is C++ destructors are correctly invoked and it still only requires the cleanup code to be in one place and it's easy to jump to the cleanup using a break statement.Edit: I use the same technique and have shown an example a couple times on the forum, as well. Edited February 17, 2008 by Valik Link to comment Share on other sites More sharing options...
DirtDBaK Posted February 18, 2008 Share Posted February 18, 2008 Goto Reminds me of my days in TI-Basic aha... [center][/center] Link to comment Share on other sites More sharing options...
Nutster Posted February 20, 2008 Share Posted February 20, 2008 I read somewhere that goto is mostly used to break more than one loop when not being used in a beginner fashion. A real programmer could make sentinels to continue breaking loops if more than one break was needed.We have implemented multiple level ContinueLoop and ExitLoop to accommodate this. No need for goto here. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 20, 2008 Share Posted February 20, 2008 Well, I was referring to languages with only a static "break" statement. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now