Microsoft went on to port their BASIC to more platforms, many of which were capable of full-screen editing, yet they kept with the line-oriented interface–why? It was a lowest common denominator which worked across all hardware and was trivial to bring up on a new hardware platform or operating system–full screen editing would have required a lot more platform-specific code to be written, and would have been more affected by differences in capabilities between different platforms (screen sizes/etc).
For instance, the Apple // graphics memory layout was really weird.
Source: https://www.pagetable.com/?p=43
Not true. See https://devblogs.microsoft.com/commandline/microsoft-open-so... in particular:
> This source was ‘translated’?
> Each of the assembly source files contains a header stating This translation created 10-Feb-83 by Version 4.3
> Since the Instruction Set Architecture (ISA) of the early processors used in home and personal computers weren’t spectacularly different from one another, Microsoft was able to generate a substantial amount of the code for a port from the sources of a master implementation. (Alas, sorry, we’re unable to open-source the ISA translator.)
You also write:
> For instance, the Apple // graphics memory layout was really weird.
That’s largely irrelevant because the core of Microsoft BASIC was text-only and had no graphics support. Graphics support was an extension, which was highly platform-specific, since platforms varied greatly in terms of their graphical capabilities and how those capabilities were implemented
Not exactly. Home computers leveraged televisions; often by generating radio signals (as opposed to direct video input).
The quality was awful. You couldn't rely on the screen to do much better than 320 X 240.
Also, in those days, most of us used 300-baud VT100 terminals, which were VGA (640 X 480). Not much room for chrome, and long text and fancy layout was painful.
The displays were ASCII-driven. Basically the precursor to Emacs/Vi.
Also, as was pointed out in another comment, Structured Programming was still in the future. If you were lucky, you had GOTO.
Line numbers didn't use up characters. They could be inferred. Memory was not cheap. It was also very limited. Every character (including comments), used up memory, and impacted performance. Variables had names like A1, A2, etc.
It was real fun, reading legacy code...
<GrumpyOldManVoice>
You kids don't know how good ya got it. Back in my day, we had to use a morse code keypad for data entry...
Get off my lawn...
</GrumpyOldManVoice>
https://floooh.github.io/tiny8bit/kc854.html
Many applications used the same menu system and thus automatically inherited this screen editor functionality.
Apart from that, Forth also had a screen editor, you could define a new word, run it, and then move the cursor up over the original definition and modify it without having to retype everything:
https://floooh.github.io/tiny8bit/kc854.html?mod=m026&mod_im...
...the builtin KC BASIC on the other didn't have such luxury, most likely because it also needed to run on other home computer systems that didn't have this screen editor capability.
VT100 terminals didn't have addressable pixels at all, nor colors - only two brightness levels. The screen was an 80x24 character matrix. You could move the notional cursor around by sending escape sequences and thereby place characters where you want within that matrix, so full-screen editor support was possible (and sometimes done), but there was nothing VGA about it.
There were also some box-drawing characters in the DEC Special Graphics character set, so you could draw rectangular shapes using primitives like ┣ and ┻. Effectively I guess that sort of got you a 161x49 matrix for wispy images.
GOTO needed somewhere to jump to and the easiest thing to delineate was a line number.
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-0...
(Why yes, I am suggesting that there’s no difference between the two, and so “strictly better” is …)
https://github.com/inkle/ink/blob/master/Documentation/Writi...
It's dedicated for writing narrative games.
10 MYSUB=50
20 GOSUB MYSUB
30 PRINT"END"
40 END
50 PRINT"MYSUB"
60 RETURN
RUN
MYSUB
END
READY
_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.- https://www.wikiwand.com/en/QuickBASIC
And BASIC itself was developed in 1963, when full screen editors may not have been as feasible.
https://github.com/tangentstorm/tangentlabs/blob/master/qbas...
Microsoft RemLine - Line Number Removal Utility
Copyright (C) Microsoft Corporation 1985-1990
REMLINE.BAS is a program to remove line numbers from Microsoft Basic
Programs. It removes only those line numbers that are not the object
of one of the following statements: GOSUB, RETURN, GOTO, THEN, ELSE,
RESUME, RESTORE, or RUN.So if that was the reason it was because of compatibility.
There's probably also the issue of keeping the code text in memory, an issue when talking about the zx80 end of the /spectrum/
1. BASIC was invented in the 1960s and supported the "teletype" style printing terminals of that era. Line oriented operation also enabled efficient multiuser/timesharing operation. (BASIC's simplicity, compactness and low resource requirements translated well to early 8- and 16-bit systems.)
2. BASIC traditionally used line numbers as GOTO/GOSUB targets.
3. Bill Gates' original Microsoft BASIC and (Allison et al.'s) Tiny BASIC, which fit in as little as 8KB and 2KB respectively, were the basis or inspiration for many 8-bit BASIC implementations. Both used line numbers for compatibility with Dartmouth BASIC and for line editing on printing terminals and serial CRTs that didn't support cursor positioning. For example, Microsoft/Altair BASIC worked with printing terminals, and Apple (Integer) BASIC for the Apple I worked with a CRT console that (afaik) didn't support cursor positioning.
That being said:
1. On systems like the C64 you can move the cursor around on screen, getting a sort of "screen editor" functionality although technically it is still a line editor.
2. As you note, there is no technical reason why labels rather than line numbers couldn't be used, and several 8- and 16-bit BASIC versions supported them; line numbers were optional in implementations such as Digital Research CBASIC or Microsoft QuickBASIC.
And, these were pre-IBM PC systems. (apple, radio shack 8 bit systems, many others).
150 baud (as a channel for a terminal running at 110 baud) was far more typical.
Most computer labs had punch card stations and paper terminals when BASIC was created.
You often used LIST to see your program and edited it by adding, removing, replacing line numbers.
Later on DEC terminals we had an editor named TECO that allowed you to do search and replace, inserts, and other line-oriented changes. I’d have my school programs memorized so I could type commands without a list.
Video terminals (and PCs) became common in the mid 80’s. Screen editors were still slow on video terminals (connected to shared runtime systems), but awesome on PCs.
https://en.m.wikipedia.org/wiki/Dartmouth_BASIC
I understand that the first versions of Dartmouth BASIC used teleprinters.
But it all started on the DECWriter paper terminal.
Line numbers were kept because line-oriented programming was easier to implement than a full-screen text editor and because they looked familiar to BASIC users. But many Microsoft BASICs, including GW-BASIC on PCs and Commodore BASIC, supported a sort of fake full screen: you could cursor around the entire screen and anything you pressed Enter or Return was scanned as a line and entered into BASIC. Smarts were built in to handle wrapped lines. This let you change a line in situ, hit Enter, and see the changed line entered into your program. Previous commands could be executed immediately provided they hadn't scrolled off the screen.
> The computer communicates to each student by closed circuit television. It selects slides and writes or erases sentences and diagrams on a storage tube. These two outputs are superimposed and displayed on the student's television screen. Not only are textual materials presented to each student at a rate determined by that student, but the computer frequently poses questions.
(See also https://core.ac.uk/download/pdf/4812121.pdf p36 for more details.)
Also, it doesn't need to be a CRT. Plasma displays were developed for PLATO IV because, to quote the 1966 paper (https://dl.acm.org/doi/pdf/10.1145/1464291.1464349):
> Display technology, however, has not kept pace with these advances. The TV-storage tube displays, of course, perform well in the PLATO system, and other CRT devices are used successfully in information retrieval systems. However, no display device is now available that performs well, and is sufficiently inexpensive for use in these large systems.
This make it possible to read the 1967 Final Report of the BASIC (https://files.eric.ed.gov/fulltext/ED024602.pdf) in context. When they write:
> Our experience does not include what is usually called CAI. While more elaborate CAI systems using fancy terminals (including TV-type presentations) could be attached to a general purpose computer system such as ours, the terminal costs would be much greater than those for teletype machines.
the "CAI" there means "computer-aided instruction", and is, I think, mean to include PLATO with its more advanced displays.
As a side note, neither early DOS nor CP/M had a full screen editor either, afair iirc. Edlin (poor man’s ed) is my earliest memory, which was a line-oriented editor. https://en.wikipedia.org/wiki/Edlin
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”)
https://www.youtube.com/watch?v=mOqguR3bBsk&t=1m8s
(Some things I didn't notice them getting into were `RESEQUENCE`, retyping a line with its number to edit a line, storing the program to flaky audiocassette, and losing the only copy of the game you were developing because you left your tape in, and your little brother absent-mindedly pressed the Record button while waiting his turn to play Parsec.)
Atari BASIC could export a BASIC program as a text file using the LIST command. Once exported, an editor could be used to edit the code:
LIST "D1:CODE.TXT"
Or you could only output part of the program, say from line 1000 to 2000: LIST "D1:PARTIAL.TXT",1000,2000
Then you could use the ENTER command to bring that code back in. If a program was already there, the lines would simply be inserted. If the ENTERed code had a line number the same as the program in memory, it would replace the one already in memory. This was a great way to have a subroutine library, kind of like #include in C: ENTER "D1:PARTIAL.TXT"
Outside of the examples above, it was difficult to have a full screen editor for BASIC because every line had to have a line number and you had to keep them organized. Also, the earliest microcomputers didn't have enough RAM for a full screen editor. The BBC Micro had a text editor in ROM but it couldn't be used for BASIC code. It could be used for other languages that were typically compiled.Most other languages either had a full screen editor or you could use any text editor. For example, Atari Logo has a full screen editor where you can edit one PROCEDURE at a time with:
EDIT "MYPROCEDUREMy first employer (now known as GE Aviation) back in the 80s had mainframes from Honeywell that worked the same way. GE Aviation had started with GE computers, had sold off its mainframe GE business to Honeywell in the early 60s and GE Aviation continued to use derivative models for decades later.
After listing a bunch of code (Fortran, of course) onto the screen, you'd cursor around making your changes, then hit the F1 key, which was programmed to send the screen one line at a time. God forbid that you'd spend a serious amount of time making those changes, because the modem (yep, we used a modem WITHIN the company) would time out, you'd disconnect and lose all your work.
I forget how we edited non-code files, but I guess that they must have had line numbers too.
Fortunately, we had systems other than the Honeywells that we could use (just about everything you could name), but most of the older internally developed software resided on the Honeywells.
At this time, the best "full screen" editor we could find was actually a very expensive CRT terminal that did all of the editing in the terminal's memory. It required an operating system and a disk. The program read 1K of data into terminal memory, and using keys built into the terminal, you could move the cursor around and cut and paste. When done, it write the memory into a file, and read the next 1K of data.
The computer it was attached to had an editor like TECO (DEC), NSPEED (Data General), or EX (AT&T Unix). These were editors designed to be used on dumb terminals or even hard copy terminals (Like a TeleType ASR33, Silent 700, or DECWriter).
A full screen editor would need an operating system with support for files (Floppy or the outrageously expensive hard disk), and enough memory to support a program on top of the operating system, on top of the program you are editing.
Anyhow, Apple Pascal was available with a full-screen editor in 1979 (this required 64-K of RAM, a disk drive, and lots of disk switching). 1984-era MacBASIC had a GUI text editor (The mac shipped with 128K of RAM, 64K of ROM, and a 400K 3.5" floppy drive.
Most had classic line numbers but one had a forward on full screen editor. You could fullscreen edit what was on the screen. This include adding new lines anywhere visible. Any action that made text scroll off the top was inaccessible and would be written to disk.
To get back to earlier lines you had save all and restart.
All the answers from the '80s make me laugh.
(Well, at least the laughing is true. )
The various BASICs were copies of what came before, and what came before had line numbers. As per the old joke ... "Why do ducks have feathers?" answer "Because their parents had feathers."
Look to the early interactive BASICs (wikipedia has a detailed article on Dartmouth BASIC) - line numbers were a convenient way to identify lines for editing and for control flow.
NOTE: How to disable AI? "Find my printer."
I remember writing programs first on paper, then transcribing them in. Line numbers were useful for that - making sure I didn't miss anything.
They were also incredibly useful when typing in programs from magazines!
"It pioneered many features that would become common in languages from the 1960s into the 1980s, including use of line numbers as both editing instructions and targets for branches, statements predicated by boolean decisions, and a built-in source-code editor that can perform instructions in direct or immediate mode, what they termed a conversational user interface."