[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Advanced Programming Structures
Keith Olson wrote:
>
> 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 |
> ---------------------------------------------------------------------
Keith,
I've written some fairly large BASIC XE programs and CAN'T avoid the use of the GOTO command. However, at least BXE has named
subroutines and procedures. You can also GOTO linename or at least add a REM line in the code to state what the point of access
is to do. I use to do that, but it takes up valuable memory.
570 REM [some small code to do something]
.
.
.
1530 if x=y goto 572
Now this may look like a procedure call or a sub routine, but it may do some specific task that can't be done as a specific
routine call. I don't happen to have any examples on-hand at the moment. I call this glue code to stick program parts together.
It's rare, but necessary at times.
--
Robert S Ely - aka - Eli-the-Iceman
rsely74@optonline.net
rsely@dhs.state.nj.us
rsely74@hotmail.com
hsrelyy@vm.state.nj.us
ICQ#: 33390750
AOL-IM: Eliice1954
Work Phone:1-609-894-4057
Work FAX:1-609-894-4048