Reply to post: Re: if you have to insert a new step without renumbering everything

The server is down, money is not being made, and you want me to fix what?

Ken Moorhouse Silver badge

Re: if you have to insert a new step without renumbering everything

When we were learning Algol at Polytechnic, we found the computer room had a load of boneshaker teletypes hooked into a Basic system. A lot of us succumbed to playing around with that for a while, it being a lot easier to write ad hoc programs than Algol.

A lot easier to get oneself into a mess, that is.

IIRC there was a program renumbering facility where, if you run out of line numbers, you can renumber your program with a simple command (you could specify the increment). So easy peasy... Why do we need Algol?

Except that Basic allowed you to have a line saying GOTO 5600 when line 5600 didn't exist. Yes, program flow would go to the next line that existed past 5600, so if line 6000 was next, it would goto that line.

However, the renumberer wasn't that intelligent*, so renumbering your program would effectively shred your code as it left any unmatched GOTO statements as they were. In hindsight, before renumbering you needed to check for unmatched GOTO's and match them. By going to all this trouble... Why don't we use Algol? No fiddling around with line numbers, and by banning GOTO's, no spaghetti code.

So all in all it was a good lesson for us to learn.

*It would be a trivial exercise for the renumberer to take orphaned line numbers into account, but maybe the shortcoming was there to teach us a lesson.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon