https://softwareengineering.stackexchange.com/questions/3097...
https://softwareengineering.stackexchange.com/questions/3097...
This doesn't make much sense to me.. why does storing the lines in a linked list require line numbers?
- list lines X to Y
- “change line X to ‘foo bar baz’”
- discard the entire program
They could have chosen to use indexes for line numbers, but allowing programmers to label each line with a ‘virtual’ line number made it somewhat easier for programmers to keep track of where code lived (imagine having to keep track of the fact that, after inserting three lines to the subroutine starting at line #100, the subroutine formerly starting at line #200 now starts at line #203)
It also meant that the interpreter didn’t have to make such adjustments to subroutine calls in the program (changing “gosub 200” to “gosub 203”)