5 ms·
One often overlooked aspect of BASIC's and COMAL's success was the educational benefit of line numbers. Several teachers who taught BASIC/COMAL in the 1970ies
by phkamp 3y ago
One often overlooked aspect of BASIC's and COMAL's success was the educational benefit of line numbers.
Several teachers who taught BASIC/COMAL in the 1970ies and 1980ies have commented to me, that the line numbers made them much easier to teach than for instance PASCAL.
The line numbers enables the teacher to say "Now, look at line 240" which is much more precise and concise than "Look at the statement in the IF inside the WHILE" etc.
- cmrdporcupine 3y agoAbsolutely. And the line numbers stuff was made it much easier to write code on these machines that lacked proper text editors, and made it easier to ship a minimal programmable machine without including one. Plus it immediately and intuitively exposes the imperative sequential "turing tape" model of the computer to the user. "Do these sets of things, in sequence, now go back to this line, or forward to this, and do the things there" is far less abstract than "execute this function."
- CydeWeys 3y agoMost (all?) modern IDEs have line numbers for all languages, so if you open the code in the right program the educational benefit should still be there.
- colanderman 3y agoLine numbers in an IDE change as soon as you add or delete a line. Not the case for BASIC.
- CydeWeys 3y agoI always renumbered my lines in BASIC to be incrementing multiples of ten as I was anal about that ... But I was thinking more in the context of showing code to a class, during which you're usually not updating it, and even if you do, you just say the new line number as appropriate. It only breaks down if everyone is individually editing the same one piece of code.
- lproven 3y agoI strongly agree, but there is an even simpler way in which numbering lines is useful and valuable: Line numbers, for beginners, eliminate the advanced OS concepts of "files" and with them "editors" and "saving" and "loading" and much else. If you type the code without a number, that means: do this now. If you type code with a number in front, it means: remember this for later. And that is all you need to enter, edit and run code. No "editor" that loads "files" from a "directory" on a "drive" which you must "save" before you "execute" the code in a language. To try it: type the code; hit Return. To run the code you entered earlier: type RUN, hit Return. This is a very powerful abstraction which simplifies a lot for beginners. That you can further expose this by using those numbers in the code is a great first step into thinking about program structure as more than a consecutive list of steps. It leads naturally into loops and things.