Well, my opinion is...oh, never mind. You've heard it before. ;-)
Joe Ganci
-----Original Message----- From: Authorware Professional [mailto:AWARE@listserv.cc.kuleuven.ac.be]On Behalf Of MORALES, RAMON [NCP/1555] Sent: Friday, May 11, 2001 2:17 PM To: AWARE@LISTSERV.CC.KULEUVEN.AC.BE Subject: In Praise of GoTo() (long)
Since it's Friday and since we haven't had a good holy war on the list for at least a couple of days now, I will introduce a heretical position.
The infamous GoTo()is not evil. No more than handguns are evil. It is just a tool that needs to be handled carefully. If it were as useless and dangerous as most people seem to claim, why have Jamil and friends kept it in all the upgrades?
Most of the bad comments revolve around two issues. Most importantly, AuthorWare has a tendency to get lost sometimes when GoTo()s are used as part of a round trip (you go somewhere via the GoTo() and hope to get back when you are done). The other is the ever popular "spaghetti code" issue. If you use too many GoTo()s, the code gets so convoluted that it becomes hard to track down what is going on.
Knowing this, I have successfully used GoTo()s occasionally in my code with no negative consequences. Yes there are alternate ways of doing what I did that I could have used to avoid them, but this way I avoided having to spend additional project time learning about branching issues and decision icons, etc. My code is working and in production and when (or if) I have time, I can go back and learn about better ways of doing what I did. The point is that if it works as well as the alternatives, people shouldn't be so crabby just because the general propaganda about it is negative. See what works and then use it.
For me, I have used GoTo()s successfully by following these rules: 1. Keep the universe of the GoTo()s self contained. If I use them, all their movements (i.e. where they are going to and where they came from) are located in the same map icon. That way it is easy to track what is going on because you have a finite place to look. 2. All my GoTo()s are one way. They are never expected to return. Like if I select a background and move on with the program, never to return. Can't get lost because there is no round trip.
As you can see from the rules, the opportunities for using GoTo()s safely may be fairly limited. There will be times when it could be useful. But you won't find out unless you look around and see what it can do.
I'm going into the bomb shelter now because I can see that the flame throwers are starting up.
____________________________________________ Ramon Morales Software Consultant
"The Difficult we can do today, the Impossible takes a little longer"
New Email Address: ramon.morales@cpkelco.com ____________________________________________
-- Search the Archives -- UPDATED EVERY DAY!! http://www.e-media.nl/aware/search.html
The AWARE List http://www.e-media.nl/aware/index.html
Netiquette: !! Use descriptive subject fields !! Delete all unneeded lines from your reply
- Use subject prefixes (A5 , A5Mac , A5Web , KO , UCD , OT)
-- Search the Archives -- UPDATED EVERY DAY!! http://www.e-media.nl/aware/search.html
The AWARE List http://www.e-media.nl/aware/index.html
Netiquette: !! Use descriptive subject fields !! Delete all unneeded lines from your reply
- Use subject prefixes (A5 , A5Mac , A5Web , KO , UCD , OT)