4 ms·
Another reason: BASIC had a GOTO statement to change program flow to any point in the code. There was no idea of nested blocks of code that executed conditional
by joezydeco 4y ago
Another reason: BASIC had a GOTO statement to change program flow to any point in the code. There was no idea of nested blocks of code that executed conditionally. The GOSUB directive was only useful in some situations.
GOTO needed somewhere to jump to and the easiest thing to delineate was a line number.
- convolvatron 4y agolabels are strictly better. idk if you've ever had to renumber your basic or fortran code
- joezydeco 4y agoI did a lot, by hand. I was on the Apple ][ in my BASIC days, they also had a utility to help you renumber your code. (Both versions of BASIC for the Apple ][, Integer BASIC and Microsoft's Applesoft BASIC, didn't allow for inline labels) https://archive.org/details/applesoft-toolkit/mode/2up https://archive.org/details/applesoft-toolkit/mode/2up If you're really old you'll remember this one too: https://yesterbits.com/wp-content/uploads/2013/06/600-2024-00-renumber.jpg https://yesterbits.com/wp-content/uploads/2013/06/600-2024-0...
- apgwoz 4y agoI prefer to name my labels L00001, L00002, and so on. One for each logical line of code. (Why yes, I am suggesting that there’s no difference between the two, and so “strictly better” is …)
- convolvatron 4y agoyou choose to do that rather than more descriptive targets like 'loop' and 'exit'?
- apgwoz 4y agoI prefer that people get the joke (and to use languages where this isn’t a problem).
- ok123456 4y agoGWBasic had a renum command that would renumber all your lines to use the same consistent interval spacing.
- ForOldHack 4y agoI did a lot, and when the renumber range was added... we leapt for joy.
- scotty79 4y agoIf anyone misses GOTO, GOSUB, RETURN control flow, there's a modern language that has it in the form of features called diverts and tunnels: https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md https://github.com/inkle/ink/blob/master/Documentation/Writi... It's dedicated for writing narrative games.
- timbit42 4y agoIn Atari BASIC, you can set a variable to a number and GOTO or GOSUB VARIABLENAME. 10 MYSUB=50 20 GOSUB MYSUB 30 PRINT"END" 40 END 50 PRINT"MYSUB" 60 RETURN RUN MYSUB END READY _
- ForOldHack 4y agoYou are an evil programmer. If you printed on line 50 50 PRINT MYSUB-40, "MYSUB=", MYSUB. You would not know if you were printing your own program, and what 'MYSUB' actually was: A literal string or a memory value or a memory reference. It is for this very reason that 1) Clarity needs to be foremost in designing and implementing programs, and 2) Structured programming was invented and 3) Most Microsoft products fall short in both categories, and also Atair "Computers."
- timbit42 4y agoIf you think that's bad, check out the Atari BASIC code in issues of the ANTIC and ANALOG magazines. There is some real evil wizardry in some of those programs. Another oddity about Atari BASIC is that you can put any binary data in a string, such as machine code, and then execute the code in the string using: 50 RESULT = USR(ADR(MLSTRING$)) As for points 1 and 2, I learned those things over 30 years ago. I don't get your, 'Atair "Computers"', reference. If you meant, 'Atari Computers', or 'Altair Computers', I still don't get the reference.