Hacker News new | ask | show | jobs
by apetresc 1736 days 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?

4 comments

I 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.
That'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.
Give her some credit
If 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.
Agreed completely
She will blow through it same as so many of us did.
Just imagine it is a write-only language like FORTH.
Waste 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.

I 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.
Tokenized