> From my experience working with a team of different developers this is the > worst possible and a very selfish scenario a developer might choose to > follow. This is why in many cases the longer code exist the worse it is > getting. > GOTOing out of a jam simply add more garbage to the pot of garbage the > code > you describe is. I always insist that developers understand the code they > change before making any change and that the code is getting better not > worse after they made that always urgent and small modification to it.
While I agree with you in principle, reality sets in real quick. Sometimes you simply don't have the luxury of time & resources to completely rewrite a module to bring the code up to today's standards. This is especially true if you are a consultant that is being paid to provide a specific solution, not update the entire code base. I HATE this too, but that is life. Having said that, I still firmly believe that GOTO's are to be avoided at all costs. Yes, if you are careful you can write well structured code using GOTO's, but what about the guy after you or next to you? We don't code in a vacum. Using GOTO's creates code that is just too delicate. If you think you need to use one think about it again and be real sure. When you think about it some of the newer commands are really modified GOTO's. Commands linke EXIT and CONTINUE jump to specific code lines. The difference is that they are dynamic in that the jump point moves appropriately as you change code. < (The BNF is the table of valid statements.)> I have not heard reference to BNF grammars in a loooonnng time. Rich Taylor | Senior Programmer/Analyst| VERTIS 250 W. Pratt Street | Baltimore, MD 21201 P 410.361.8688 | F 410.528.0319 [EMAIL PROTECTED] | http://www.vertisinc.com Vertis is the premier provider of targeted advertising, media, and marketing services that drive consumers to marketers more effectively. "The more they complicate the plumbing the easier it is to stop up the drain" - Montgomery Scott NCC-1701 > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:owner-u2- > [EMAIL PROTECTED] On Behalf Of Serguei > Sent: Wednesday, October 05, 2005 3:45 AM > To: [email protected] > Subject: Re: [U2] more serious notes on GOTO > > ----- Original Message ----- > From: "Tony Gravagno" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Wednesday, October 05, 2005 4:54 AM > Subject: RE: [U2] more serious notes on GOTO > > <cut> > > > Rather than completely re-writing client code to > > my sense of what nice code looks like it's occasionally much easier to > GOTO > > to get out of a jam that someone else created. > > > > - Because in the internal bowels of the BASIC compiler and runtime we > find > > that all GOSUBs are actually GOTOs with a little extra code. The only > > difference is that on a GOSUB you push the address of the next > instruction > > onto a stack before the jump. > > Any compiler from any programming languages do that. But it does not mean > that we program in assembler all the time, does it? > > > - Because almost all languages have some form of GOTO and we'd see as > many > > "why isn't there a GOTO" here if it wasn't in UniBasic. > > Java does not have it. > ------- > u2-users mailing list > [email protected] > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
