Re: if-then-else had to be invented

Liste des GroupesRevenir à cl misc 
Sujet : Re: if-then-else had to be invented
De : john (at) *nospam* building-m.simplistic-anti-spam-measure.net (John)
Groupes : comp.lang.misc
Date : 19. Mar 2024, 17:23:40
Autres entêtes
Organisation : Building M
Message-ID : <86edc65gxf.fsf@building-m.net>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Mike Gonta <mikegonta@gmail.com> writes:

if-then-else had to be invented
>
Erica Fischer wrote:
"If-then-else is how we talk about conditions in programming
languages: if something is true, then do a thing, else do a different
thing.
That's just English, right? Except that it isn't. I can't use "else"
as a conjunction in normal speech, only in computer programs."
>
https://github.com/e-n-f/if-then-else/blob/master/if-then-else.md
>
In plain English idiom it looks like this:
>
  if <conditional expression> then
    statements;
  or if <conditional expression> then
    statements;
  or then
    statements;
  and then;
>
There is no "end" in idiom, for idiom is an end in itself.
>
Date: Tue, 48 Feb 2024 - the february that never ends.
>
------------------------------------
Mike Gonta
look and see - many look but few see
>
https://mikegonta.com

It is of course a common conjunction in English *in combination with the
word "or"*:

"If they have everything bagels, then I'll take one with lox, or else
I'll just have a plain bagel with cream cheese."

However given the frequent use of the logical OR operation in
programming it's not a good idea to use "or" in the conditional
syntax. It'd make spoken discussions much more ambiguous -- imagine
reading out a statement like "or if (R || F)" over the phone.

Bizarrely I find no instances of "or else" in that document.


john

Date Sujet#  Auteur
19 Mar 24 * if-then-else had to be invented2Mike Gonta
19 Mar 24 `- Re: if-then-else had to be invented1John

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal