[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Advanced Programming Structures
I must disagree with you on two points:
1. Using GOTOs is *not* bad programming practice; using *excessive* GOTOs
is. The worst I've ever come across is 5 chained GOTOs - in a *commercial*
program (!)that I was hired to *try* to modify. I try to avoid using GOTOs
in Applesoft and Atari BASIC because they both use line numbers, and
remembering where branches go can make renumbering tricky.
2. Changing programming practice for a specific purpose (i.e. to emulate the
DO/LOOP structure) and to add to your general programming strategy, instead
of doing it 'just because', *IS* good programming practice, as long as it is
clear and consistent. (IMHO)
--
Keith Olson
---------------------------------------------------------------------
| For the memory of the uncompromisingly righteous is a blessing, |
| Proverbs 10:7a |
---------------------------------------------------------------------
"SoftNGui" <softngui@earthlink.net> wrote in message
tk3qgi4kr8a1ac@news.supernews.com">news:tk3qgi4kr8a1ac@news.supernews.com...
> This code misses the point. It tries to avoid GOTO's because they are bad
> programming practice. Yet at the same time, changing the for-loop
variable
> II within the loop is also bad programming practice.
>
> Keith Olson <s p a m t r a p 0 0 7 @ y a h o o . c o m> wrote in message
> tk35h8spqrdqaa@corp.supernews.com">news:tk35h8spqrdqaa@corp.supernews.com...
> > FOR II = 0 TO 1
> > .
> > .
> > .
> > II=1
> > IF X=0 THEN II=0
> > IF Y=0 THEN II=9
> > IF Y=99 THEN II=10
> > NEXT II
> > IF II=10 THEN PRINT "AT BOTTOM"
> > IF II=11 THEN PRINT "AT TOP"
> >
>
>
>