3 ms·
Wow, the "POKE i,." notation does work. Are there any advantages to doing so instead of typing zero for the value?
by rzzzt 2y ago
Wow, the "POKE i,." notation does work. Are there any advantages to doing so instead of typing zero for the value?
- weinzierl 2y agoFor a moment I saw POKE 1,. and thought "Oh, Noooo";-)
- rbanffy 2y agoThis is why Edsger Dijkstra hated BASIC so much…
- weinzierl 2y agoMaybe, but it is not known that he did for that particular reason. The sales assistants in department stores on the other hand... different story. In the 80s stores often had home computers for display and for customers to try them out. Much like they have tablets and phones on display now. Kids being kids used to play pranks with these machines and one way to hang a Commodore 64 was POKE 1,0 (or POKE 1,.). The store employees hated it because they had to come and reset the machines all the time. For me POKE 1,0 will always be burned into my mind as a dangerous frightening command, hence the " Oh, nooo". I do not have any information if Edsger Dijstra held similar feelings and whether they contributed to his hate for BASIC.
- rbanffy 2y agoSorry. I was joking. Dijkstra’s criticism wasn’t as much for the syntax. I would, however, prefer “POKE X” as a shorthand for “POKE X, 0”, but this might as well be a bug of the parser rather than an intended feature. Code had to be very compact back then.
- yencabulator 2y agoI think it was intentional, and omitted arguments defaulted to zero for any "FOO 1,2,3" style command. Think LOAD, SAVE etc.
- glimshe 2y agoDijkstra did much for computing, but an entire generation of developers inspired by and initially taught by BASIC did a LOT more.
- the-rc 2y agoThe BASIC interpreter parses numerical values from text each time a token gets executed. It converts that into a float and, in the case of POKE, then into an integer. Using the dot without the implicit leading zero, there's no need to convert a "0” (48 in decimal) into a zero and, possibly, a multiplication by 10 of previously parsed digits, in this case the starting zero value.