Some years later in embedded development I learned that this was actually more similar to the CPU instructions used underneath, conditional jumps.
If-then-else had to be invented
31–40 of 255 posts
Re: If-then-else had to be invented
#32You can use "else" that way in ordinary speech. "If this then do that else do the other thing" is perfectly legitimate English, just a bit archaic.
In colloquial english we usually put an "or" in front of else. It really breaks down when you put it in boolean form because the "or" implies other actions when true rather than actions if false. Removing the "or" completely is unambiguous but is antiquated English. Examples: "Go to college or else work for your uncle" Turn this into boolean form: "If you go to college then or else you will work for your uncle" But t…
I disagree that or is ambiguous. In English we use or to mean xor, that is one item or the other item but not both. If we want to clarify that choosing both items is an option we use the term and/or.
Re: If-then-else had to be invented
#33Re: If-then-else had to be invented
#34Earlier quoted context omitted.
> “... one common word which does seem to have been invented by the software industry: "access" as a verb” Really? That’s surprising because the French and Spanish equivalent verb (accéder / acceder) is common and has multiple meanings such as “reaching a peak”. I would have imagined this word transferred over in the Norman days.
https://books.google.com/ngrams/graph?content=access_VERB would seem to support the claim.
Maybe it’s because “to accede” is also an English verb but acquired a different meaning from the Latin root.
Acceding to a computer system doesn’t make sense like it does in French or Spanish, so the noun was turned back into a different verb.
Re: If-then-else had to be invented
#35You can use "else" that way in ordinary speech. "If this then do that else do the other thing" is perfectly legitimate English, just a bit archaic.
I would not be surprised to learn that "else" is more common now thanks to programming languages.
> Christopher Strachey's CPL programming language is the grandparent of C and therefore the ancestor of most current programming languages, and he refused to use "else," calling it "ignorantly incorrect English."
Given how hard it seemed everyone who designed languages tried to avoid using the word, it would seem Strachey's view was not uncommon.
Re: If-then-else had to be invented
#36Re: If-then-else had to be invented
#37You can use "else" that way in ordinary speech. "If this then do that else do the other thing" is perfectly legitimate English, just a bit archaic.
Wiktionary has a usage example from 1903, clearly before modern computers but not too ancient. > 1903, Jack London, The Call of the Wild, Grosset & Dunlap, page 44: > […] and his first experience taught him an unforgetable lesson. It is true, it was a vicarious experience, else he would not have lived to profit by it. As an aside there is at least one common word which does seem to have been invented by the software…
Re: If-then-else had to be invented
#38This is fascinating! I started with BBC Basic II (on the Model B) which had IF..THEN but it was just one line and there was no ELSE. So if you wanted to make a 'block' you had to call a different PROC (thankfully there were PROCedures so you could avoid GOTO) As such when I was introduced to ELSE and ENDIF with BBC BASIC V on the Archimedes it seemed like very welcome syntactic sugar - it let you do the same stuff bu…
BBC Basic II does have ELSE, it just has to go on one line. IF A=4 THEN PRINT "FOUR" ELSE PRINT "NOT FOUR" Statements for the IF block and the ELSE block can be separated by ':'. I was recently given a BBC Micro and it's a fascinatingly impressive machine, the hardware and software are so beautifully designed in tandem that it's quite awesome even in 2020.
Obligatory shout out for 'Micro Men', about the making of the BBC Micro and ZX Spectrum https://www.youtube.com/watch?v=XXBxV6-zamM
Re: If-then-else had to be invented
#39There were a few interesting observations. The one that stuck with me the most is that 'and' is most commonly used with almost the opposite sense in natural language vs programming: more precisely, in natural language, 'and' usually implies set union, which is more similar to boolean Or. For example, 'women and children' means of course 'if X is a woman OR X is a child'.
The other interesting observation was that in natural language we usually describe operations on sets as taking the whole set as an argument, not in terms of what happens with each individual member. For example, it's more likely you'll say something like 'give candy to these kids' or 'wash these cars' than 'give a piece of candy to each kid' or 'wash each of these cars'. Of course, index based loops are essentially never used in common language, but even the common loop comprehensions that introduce a loop variable are quite far from natural language.
Re: If-then-else had to be invented
#40In propositional logic, which was developed well before the first computers by Leibniz, Frege, Boole, De Morgan, etc.:
"If A then B else C" can be stated as: (A --> B) ^ (¬A --> C)
So, in patent/invention language, I'm not sure if it would really constitute an invention since it is just putting a known mathematical formalism into a programming language.
It would be possible to implement this in Leibniz' calculus ratiocinator ~300 years ago: https://link.springer.com/chapter/10.1007/978-3-319-93779-3_...