3 ms·
I actually rationalized the '=' symbol in assignment into the following statement, "Let 'left hand side' be equal to 'right hand side'". Using this wording reso
by cosmotron 9y ago
I actually rationalized the '=' symbol in assignment into the following statement, "Let 'left hand side' be equal to 'right hand side'". Using this wording resolves some dissonance around its overloaded usage.
- amyjess 9y agoDitto. Fun fact: various dialects of BASIC let you optionally put LET before your assignment statements. So the following are equivalent: X = 10 LET X = 10
- joezydeco 9y agoWait...LET was optional? Auigh! Whole months of my childhood, wasted!
- Doctor_Fegg 9y agoDepends on the dialect. It was mandatory on the Sinclair BASICs, for example (ZX81/ZX Spectrum), but optional on the Amstrad (Locomotive/Mallard) and BBC BASICs. A quick search suggests it was optional as early as "MicroSoft"'s Altair BASIC: http://swtpc.com/mholley/Altair/BasicLanguage.pdf http://swtpc.com/mholley/Altair/BasicLanguage.pdf As someone who learned first on a ZX81, I'd always assumed that "LET X=5" was the canonical form, and that "X=5" for assignment was just a shortening for convenience.
- jameshart 9y agoLikewise - but of course in Sinclair BASIC it was mandatory because every command had to begin with a keyword - a fact enforced by the fact that the cursor started out as a flashing [K], and every key on the keyboard was mapped to directly enter a keyword in that mode. LET was on the 'L' key. You literally couldn't type "a = 1" into a Spectrum/ZX81 - you couldn't type an 'a' unless you were at an [L] cursor prompt, which would only appear after you had chosen a keyword. Typing an 'a' at a [K] cursor would get you the keyword NEW. I wonder if you, like me, were also completely thrown when you first encountered a programming language where you didn't also have to enter line numbers...
- feintruled 9y ago> I wonder if you, like me, were also completely thrown when you first encountered a programming language where you didn't also have to enter line numbers... Haha, yes, totally! For me this was AMOS on the Amiga (a Basic variant). I was so thrown I started by using them anyway as they were supported by the interpreter - it just treated them as labels. I soon stopped though when I discovered it didn't reorder based on number, so you ended up with 10 print "world" 5 print "hello" 20 goto 5
- Doctor_Fegg 9y agoNot too thrown - I went from BASIC to Z80 assembler, and that just had labels...!
- deleted 9y ago[deleted]
- Jtsummers 9y agoDepended on the dialect. Whatever we had on my first PC as a kid, it was mandatory. Later, in HS, when we used BASIC for a first CS course, it was optional.
- ghaff 9y agoBASIC on PCs. How new-fangled. I forgot about LET. You probably needed to use it on the HP 2000 minicomputer I first learned BASIC on. :-)
- Someone 9y agoOnly tangentially related: an (unsuccessful) search for a genealogy of the Basic programming language led me to https://en.wikipedia.org/wiki/Basic_Using_Reverse_Polish https://en.wikipedia.org/wiki/Basic_Using_Reverse_Polish, which led me to http://vintagecomputers.site90.net/comp80/ http://vintagecomputers.site90.net/comp80/, which has scans of articles giving examples of that language, for example (from http://vintagecomputers.site90.net/comp80/Part_4_Jul_79.pdf http://vintagecomputers.site90.net/comp80/Part_4_Jul_79.pdf): 018 LET P=P K * B - and 135 LET Q=1 F G / 1 - REC 0.00001 * - Q * but also the sort-of traditional 016 FOR X=1 STEP 1 UNTIL T I guess they had a Basic that only allowed expressions with a single operator or a single function call (some early systems with very limited memory did that) to the right of =, and didn’t have the memory for an infix parser.
- jameshart 9y agoVisual Basic, notably, made 'Let' optional, but made 'Set' mandatory when assigning object references.
- Retra 9y agoI just intuitively understood that symbols can have different meanings in different contexts, so never felt any dissonance or had any trouble understanding it. Like "read" has different pronunciations, or "plane" has different meanings, "=" is just multiple things under different contexts.
- cosmotron 8y agoI agree in that this doesn't really take conscious thought anymore. However, the article had the following: > How can a = a + 1? That’s like saying 1 = 2. It looks like a lot of us don't have (never had?) trouble accepting a statement like `a = a + 1` and, upon stepping back, thought maybe it had to do with our internal dialog (which is now probably intuition as we've been processing statements like this for so long).