peteym5 Posted March 2, 2022 Report Share Posted March 2, 2022 (edited) This has been a topic since the later 1980s. Is that using GOTO's in Programming is bad. At least unconditional straight GOTO statements. The theory is the more GOTOs a program has, the more bugs it has and the harder it is to fix something if it is not functioning correctly. I know the default Atari Basic, makes it hard to write programs without using them, because you need to do IF-THEN-GOTO to execute code that takes several lines if a condition is true. Also need GOTOs to create Loops in Games or other programs. I know Basic XL, Basic XE, Turbo Basic, and Fast Basic include statements like IF ELSE ENDIF, REPEAT UNTIL, WHILE WEND, DO LOOP. These reduce the need of GOTOs. With Atari Basic, I need to use GOTOs with IF statements to simulate the function of a Block IF. This is also happening with Atari 7800 Basic. Edited March 2, 2022 by peteym5 Justin 1 Quote Link to comment Share on other sites More sharing options...
RickR Posted March 2, 2022 Report Share Posted March 2, 2022 This problem was solved by using labels and then GOTO <label>. I know Atari basic doesn't support this. Does 7800 basic? Justin 1 Quote Link to comment Share on other sites More sharing options...
peteym5 Posted March 2, 2022 Author Report Share Posted March 2, 2022 7800 Basic does. Actually 7800 does not have line numbers as it is a cross platform compiler that you edit code with a text editor. Justin and RickR 2 Quote Link to comment Share on other sites More sharing options...
Atari 5200 Guy Posted March 3, 2022 Report Share Posted March 3, 2022 I've always used GOTO, even in QuickBASIC 4.5 and DarkBASIC. I have been using it in 7800 BASIC for small subroutines. Those will be replaced once I call those subroutines in larger programs. Justin 1 Quote Link to comment Share on other sites More sharing options...
slobu Posted March 4, 2022 Report Share Posted March 4, 2022 (edited) It's never been a problem for BASIC users. I've always heard criticism from C and assembly oriented programmers. I've tried switching to user routines and gosubs but the additional CPU overhead always gets me in trouble. UPDATE: I'm not picking on anyone who comes from a lower level language background. Just my own personal impressions over the years. Edited March 4, 2022 by slobu RickR, Justin and Atari 5200 Guy 3 Quote Please check out my Atari 2600 party favors at https://theloon.itch.io/ Downloadable games include Upp Plus Plus, Stranglehand, Nitebear on Sleepystreet and more! Link to comment Share on other sites More sharing options...
peteym5 Posted March 6, 2022 Author Report Share Posted March 6, 2022 I agree line numbers were also a major issue with earlier Basics. Programmers tend not to include comments to save memory. Plus some basics can execute GOTOs faster than GOSUB RETURN. All you see if GOTO 3000, without knowing what happens at line number 3000. This is also known a "spaghetti code." When I learned about structure programming in college, my whole world of game making changed. It is also other Basic's available for the 8-bit that changed things like Turbo Basic XL, Basic XL, Basic XE, and recently Fast Basic. RickR 1 Quote Link to comment Share on other sites More sharing options...
Atari 5200 Guy Posted July 11, 2022 Report Share Posted July 11, 2022 Spaghetti code is/was a way to protect your work in a weird sort of way. It was a way to make sure that only the author knew what was going on. If they got canned and the project handed to someone else the next person would have their work cut out for them. I try not to use REM statements not because of program space because those are ignored. If I do use them it is to map out game ideas of what I am trying to accomplish. I have nothing against using GOTO, GOSUB, or any other program flow syntaxes or remarks. RickR 1 Quote Link to comment Share on other sites More sharing options...
RickR Posted July 11, 2022 Report Share Posted July 11, 2022 1 hour ago, Atari 5200 Guy said: Spaghetti code is/was a way to protect your work in a weird sort of way. It was a way to make sure that only the author knew what was going on. If they got canned and the project handed to someone else the next person would have their work cut out for them. I try not to use REM statements not because of program space because those are ignored. If I do use them it is to map out game ideas of what I am trying to accomplish. I have nothing against using GOTO, GOSUB, or any other program flow syntaxes or remarks. I'll be honest with you. As a person that has been a profession software developer for over 30 years, and someone that has hired many software developers...the minute I catch this attitude from someone, I won't hire them or I will try to train it out of them. I completely understand this point of view, but the other side is the huge risk to whoever owns the software. If you win the lottery or decide to move on, the company will suffer. :) :) :) But for your own personal programs, go for it. Quote Link to comment Share on other sites More sharing options...
Atari 5200 Guy Posted July 11, 2022 Report Share Posted July 11, 2022 I use to hate REM statements but I have gotten to where I use them often and especially in work explaining what a section of code is trying to accomplish. Being I was the only one programming many moons ago, and not wanting any one else to take my work, I avoided REM statements but had a hard copy with remarks present. With web design I use remarks everywhere, and in BASIC, except with the small code I just shared, I use them first to outline what I want my program to accomplish. I then build my program up from there. I just wish I knew what I'm supposed to use to compile my Atari BASIC programs into stand alone programs. RickR 1 Quote Link to comment Share on other sites More sharing options...
peteym5 Posted July 20, 2022 Author Report Share Posted July 20, 2022 The issue with Commodre 64, Vic-20, Atari 8-bit, Apple II, TI-99, TRS-80, etc. is these systems had very limited resources by default. The Basic was stored in ROM and could only do what fit inside there. It goes back further to mainframes. So we can get away with GOTO 1000 with a smaller program. But as computers got more powerful, our programming had to evolve with it. Turbo Basic and Basic XE on the Atari allowed you to use labels that you can direct program flow to. The issue I am having is that I am converting stuff from 30+ years ago to Fast Basic, and need to figure out what something does. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.