Sujet : Re: Command Languages Versus Programming Languages
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 06. Apr 2024, 17:49:38
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uuruf3$26jhs$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 21 22 23 24
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 05.04.2024 19:37, Stefan Ram wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote or quoted:
>
[ Algol syntax variants, keywords vs. parenthesis ("meek form" ?) ]
The parenthesis are not used for grouping, but are the alternative
form for IF/THEN/ELSE/FI
It's funny how the discussion oscillates between
"too many parentheses" (LISP code) and "not enough parentheses"
("let me add some parens to improve readability").
We should distinguish the various aspects posted over time.
Parenthesis used...
- to group sub-expressions (to make precedence clear or
fix some precedence inconsistency in the language)
=> that's IMO a Good Thing for non-trivial cases
- as necessary syntax of the language (like inherently
in Lisp, or in C's control structures)
=> I don't like them, but you have no choice here
(but changing the language, where/if possible)
- as an alternative syntactic form of conditionals
(as in Algol, where you can choose the syntax)
=> Personally I like the verbose keywords, but in
case of conditional expressions the concise form
with parenthesis might be better readable (though
this can be different in complex cases as posted)
Note that in Algol not only the 'IF's can be written
in that parenthesis syntax form, you can also use
the '(' and ')' instead of the 'BEGIN'/'END' keywords.
It boils down to: to each his own, and, use what's most
appropriate depending on context.
Janis