Remix.run Logo
fridental 4 days ago

Typing keywords letter by letter is unnecessary too. Think about ZX Spectrum keyboard allowing you to type BASIC keywords with just one key press.

whartung 3 days ago | parent | next [-]

This was actually a potential problem, at least on Commodore machines.

On those machines you were able to abbreviate keywords.

At the same time, they support full screen editing. That meant you could just cursor up over some code, make changes, hit enter, and the changes would take place.

However, when using the abbreviations, it was possible to create lines that were too long. I don't recall the specifics, but there was a line limit for BASIC input. Lets say it was 80 chars (for discussion).

Using abbreviations (like ? for print) and you could end up with a line that would LIST for more than 80, but if you tried to change it with the screen editor, the lines would be too long, and truncate silently.

So you had to be cautious with your use of the abbreviations.

Cockbrand 4 days ago | parent | prev | next [-]

Similar, and maybe more related to the article's topic: Commodore BASIC also saved the commands as tokens, so you could enter abbreviated commands like

  10 ? "Hello"
  20 gO 10
and a LIST command would yield

  10 print "Hello"
  20 goto 10
So saving commands as tokens in memory and formatting them on output was somewhat common back then.

The speccy was more advanced in terms of this (as mentioned in the parent comment), and it had the better BASIC for sure.

cluckindan 4 days ago | parent | prev [-]

Or think about the M (aka MUMPS) language, which allows you to type just the first letter(s) of a keyword and considers it valid syntax.

Imagine Java if you could…

    na com.mycompany.myapp;
    
    pu cl MyClass {
      pro sta i = 42;
    
      pri fi ch[] MAGIC = ['a', 'b'];

      pu sta v main(String[] args) {
        OtherClass otherClass = n OtherClass();
        f (i i = 0; i < MyClass.i; i++) {
          otherClass.hex(i, this.MAGIC);
        }
      }
    }