Jump to content

Basic Programming. Using GOTO. Do you still use it?


Recommended Posts

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 by peteym5
Link to comment
Share on other sites

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 by slobu

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

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. 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...