3 ms·
How come the code listings seem to have removed spaces between keyword tokens? Like, for example, on page 185 you have lines like: > 50 IFHF<0THENEND Which cl
by apetresc 5y ago
How come the code listings seem to have removed spaces between keyword tokens? Like, for example, on page 185 you have lines like:
> 50 IFHF<0THENEND
Which clearly, from context, are supposed to be:
> 50 IF HF < 0 THEN END
Is this a typesetting error or did the original text do it that way for some reason? Just to emphasize that BASIC's interpreter didn't care?
- jasperry 5y agoI can verify that it's that way (without the spaces) in the original. Sometimes you had to do it to fit all the code in two screen lines, because that was the maximum line length. So it probably became a habit for some programmers.
- apetresc 5y agoThat's a shame :( I had been hoping to use this book with my daughter (she's been getting into coding on retro machines like our C64) but I don't think I want to complicate things with the added cognitive load of tokenizing keywords she doesn't even know yet, by hand.
- pkaye 5y agoJust imagine it is a write-only language like FORTH.
- tomcam 5y agoGive her some credit
- fortyseven 5y agoIf us old farts got by with it as kids... she'll be fine. Though I wouldn't pass by an opportunity to make things better if possible.
- tomcam 5y agoAgreed completely
- ddingus 5y agoShe will blow through it same as so many of us did.
- YesThatTom2 5y agoWaste 5 bytes on whitespace? I could never imagine being so wasteful. In fact, I once wrote a program that removed whitespace of other programs. It also renumbered the lines starting at 1, incrementing by 1. Why? Because the line numbers in gotos would be fewer digits.
- buescher 5y agoI forget if Commodore BASIC partly tokenized programs or simply stored them as text, but it definitely stored formatting information, so there was an art to minimizing memory footprint and execution speed by entering them that way.
- tomcam 5y agoTokenized
- tapland 5y agoThe original did this, see: http://cini.classiccmp.org/pdf/Commodore/C64%20Programmer's%20Reference%20Guide.pdf http://cini.classiccmp.org/pdf/Commodore/C64%20Programmer's%... Or the plain text version: http://www.zimmers.net/cbmpics/cbm/c64/c64prg.txt http://www.zimmers.net/cbmpics/cbm/c64/c64prg.txt Both found through https://www.c64-wiki.com/wiki/Commodore_64_Programmer%27s_Reference_Guide https://www.c64-wiki.com/wiki/Commodore_64_Programmer%27s_Re...