336
submitted 6 months ago by sirico@feddit.uk to c/programmerhumor@lemmy.ml
top 20 comments
sorted by: hot top controversial new old
[-] palordrolap@kbin.social 92 points 6 months ago

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 as PRINT HELLOW OR LD, that is: grab the values of the variables HELLOW (which is actually just HE) and LD, bitwise OR them together and then print.

Since it's very likely both HE and LD were undefined, they were quietly created then initialised to 0 before their bitwise-OR was calculated for the 0 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>

[-] Telorand@reddthat.com 23 points 6 months ago

Neat. Sounds very confusing for future maintenance, but when you only have 512KB of storage, you do what you gotta do!

[-] palordrolap@kbin.social 28 points 6 months ago

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.

[-] Telorand@reddthat.com 3 points 6 months ago

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

[-] palordrolap@kbin.social 4 points 6 months ago

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.

[-] mihor@lemmy.ml 1 points 6 months ago

Yes, the tape really took ages to load and then you'd just get that damned SYNTAX ERROR just to have to reload everything. ๐Ÿ˜‚

[-] rain_worl@lemmy.world 0 points 1 month ago

dijkstra was right

[-] gregorum@lemm.ee 46 points 6 months ago* (last edited 6 months ago)

some people just want to see the world

BOOBS
BOOBS
BOOBS
BOOBS
BOOBS
BOOBS
BOOBS
BOOBS
BOOBS
BOOBS
BOOBS
BOOBS
BOOBS

[-] Hegar@kbin.social 12 points 6 months ago

That code is to computer porn as the Hunt the Wumpus is to computer games.

[-] lefaucet@slrpnk.net 8 points 6 months ago

Everyone's heard of the "Hello world" being people's first program, but just as popular among teenaged boys is their second, more advanced program: Boobs! :)

[-] cupcakezealot@lemmy.blahaj.zone 7 points 6 months ago

if you flip it over it spells 80085

[-] Got_Bent@lemmy.world 5 points 6 months ago

I had to go look up when those things came out (1977) because by the time I got my hands on one in 1982 in the school library they were already little more than toys even when compared to the luxurious Vic 20.

I know we played some games off cassettes on them. I feel like Oregon trail was one of those games, but I'm suspicious of my own memory because I know I was playing that on my Apple 2, which I think had joystick driven hunting on it.

God I'm getting old and can't remember the finer points anymore.

I do remember that other kids bullied the HELL out of me for carrying one of those plastic boxes full of floppies with me at school. Not a good time to be a nerd back then.

[-] azimir@lemmy.ml 7 points 6 months ago

It's wonderful how included and valued nerdiness is these days. Being interested in anything non mainstream in the conformist 80's was hell outside of a tight friend group.

[-] Got_Bent@lemmy.world 5 points 6 months ago

By tenth grade I had been commissioned to write some software. When I completed it, I walked away from all of it because of the social stigma. Didn't touch a computer again for ten years. I won't say I regret that because walking away led me to other life adventures, but I will say I regret the circumstances that drove me to do it.

[-] PriorityMotif@lemmy.world 5 points 6 months ago

I can't believe it's already been 23 years. What a long way we've come.

[-] MajorHavoc@programming.dev 5 points 6 months ago
[-] sheepishly@kbin.social 5 points 6 months ago
[-] Zachariah@lemmy.world 4 points 6 months ago

Is that a time machine museum because I ran that exact code more decades ago than I care to think about?

[-] Mozingo@lemmy.world 2 points 6 months ago

Such a fun museum, so many cool pieces of hardware I'd never have the chance to see in person.

[-] sirico@feddit.uk 2 points 6 months ago

Mad you got it off the screen shot

this post was submitted on 04 May 2024
336 points (98.8% liked)

Programmer Humor

32495 readers
531 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS