336
Today I went to the museum
(feddit.uk)
Post funny things about programming here! (Or just rant about your favourite programming language.)
Wow. I totally forgot that Commodore BASIC ignores spaces in variable names. I do remember that it ignores anything after the first two letters though. That said, there's a bit more going on here than meets the eye.
PRINT HELLO WORLD
is actually parsed asPRINT
HELLOW
OR
LD
, that is: grab the values of the variablesHELLOW
(which is actually justHE
) andLD
, bitwiseOR
them together and then print.Since it's very likely both
HE
andLD
were undefined, they were quietly created then initialised to 0 before their bitwise-OR was calculated for the0
that appeared.Back in the day, people generally didn't put many spaces in their Commodore BASIC programs because those spaces each took up a byte of valuable memory. That PET2001, if unexpanded, only has 8KB in it.
</old man rant>
Neat. Sounds very confusing for future maintenance, but when you only have 512KB of storage, you do what you gotta do!
512KB? At the risk of going all Four Yorkshiremen, that sounds luxurious.
Floppy disks held 170KB if you were lucky to have a drive. The PET line, like many 8-bit computers, used a cassette tape drive (yes, those things that preceded CDs for holding and playing music). Capacity depended on the length of the tape. And it took ages to load.
The PET was fancy because it had a built-in cassette drive. That's what you can see to the left of the keyboard in the picture.
The main machines at work still do upgrades via tapes. The main program can communicate with lots of online services, but it still updates via tape. Probably too hard to spend the time to figure out how to implement OTA upgrades, since it was first created back in the 80s.
But the 512KB was more of a vague gesture towards the limitations back then. We had a separate floppy drive, with which I would load up a big black rectangle that had 1-5 very basic games on it. There's something special about locking down the disk which you can't get even with its smaller successor...
Comparing audio cassettes to modern high-density tape storage is pretty much the same comparison as an 8-bit computer with a modern 64-bit server, or, say, a hamster with a human.
Basically the same thing, but the differences are somewhat notable.
Yes, the tape really took ages to load and then you'd just get that damned SYNTAX ERROR just to have to reload everything. ๐
dijkstra was right