GOTO Pros/Cons
- Posted by Al Getz <Xaxo at aol.com> Aug 07, 2003
- 428 views
Hello, I've used GOTO in various languages and this is my summation of my experiances with GOTO. [1] If i am writing a program for the first time, or a complete rewrite, i dont use GOTO. Granted, it would be nice to be able to break out of a deeply nested code section with a GOTO, but it's not too bad to do without it. [2] On the other hand, if i am translating a big program that already has GOTO's in it, it means rewriting the whole thing just about. I had a program once that i really liked which used GOTO's and it ran just fine without any bugs. When i went to translate it to Euphoria, i found out how hard it can be to go from a language that uses GOTO's to a language that doesnt. It took at least three days to get something new up and running. In the end, i can say that the newer version is better, but it did require a complete rewrite. Was it worth the effort? It's hard to say, because the program needs another update now to bring it up to Windows more recent standards. In retrospect, it looks like it would have been faster to be able to translate the program on a 'line by line' basis, rather then have to restucture the whole program completely. (If a language has GOTO's this is possible usually). [Conclusion] In the long run, i'd be 'pro' GOTO if there was a way to limit it's use somehow, or only use it when translating a program written in a language that already has GOTO's. I cant see using GOTO's in new codings because it makes things too hard to follow later on when you go to update the program. The structure of the resulting program usually isnt that great either. Perhaps a translator would be in order here, to take the program that was written in one language and convert it into Euphoria. Is that possibly with a lot of GOTO's in it though? Take care for now, Al