Sujet : Re: else ladders practice
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 10. Nov 2024, 06:05:02
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vgpeu0$7vkt$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 09.11.2024 17:27, David Brown wrote:
On 09/11/2024 05:51, Janis Papanagnou wrote:
[...]
Sure, I appreciate all this. We must do the best we can - I am simply
saying that using | for this operation is far from the best choice.
That's also what I understood. - My point is that preferences (and
opinions) differ. (And I haven't seen any convincing rationale.)
Frankly, we're confronted with so much rubbish syntax (in various
languages, even in the ones we have to or even like to use) that
I'm at least astonished about your [strong appearing] opinion here.
>
Well, I'm more used (from mathematics) to 'v' and '^' than to '|'
and '&', respectively. But that doesn't prevent me from accepting
other symbols like '|' to have some [mathematical] meaning, or
even different meanings depending on context. In mathematics it's
not different; same symbols are used in different contexts with
different semantics. (And there's also the mentioned problem of
non-coherent literature WRT used mathematics' symbols.)
>
We are - unfortunately, perhaps - constrained by common keyboards and
ASCII (for the most part). "v" and "^" are poor choices for "or" and
"and" - "∨" and "∧" would be much nicer, but are hard to type.
That was the key what I wanted to express. (I used the approximated
symbols only for convenience.) - But, as a fact, the symbols I used
(an alpha-letter and a punctuation character) can [in Algol 68] be
effectively used as valid operators but the more appropriate Unicode
characters can't. (In the Genie compiler the 'v' must be used as 'V',
though.)
(Yes, it's a pity that we are constrained by keyboards, but not only
by that. And international use and cooperation makes sensible general
applicable solutions not easier.)
For
better or worse, the programming world has settled on "|" and "&" as
practical alternatives.
Only a subset of the languages; nowadays vastly those that took "C" -
to my very astonishment! - as a design paragon.
Personally I prefer 'and' and 'or' to '&&' and '||', or '&' and '|'.
(And the others, "∧" and "∨", are out for said reasons.)
The symbol '|' I associate more with alternatives (BNF, shell syntax,
etc.). But in Unix shell also with pipes (in former Unixes '^', BTW).
And I have no problem with it if used as a separator in a conditional,
where "separator" is of course not the formally appropriate term.
("+" and "." are often used in boolean logic,
and can be typed on normal keyboards, but would quickly be confused with
other uses of those symbols.)
[...]
Well, on opinions there's nothing more to discuss, I suppose.
Opinions can be justified, and that discussion can be interesting.
Purely subjective opinion is less interesting.
Sure. Your's appreciated as well.
Janis