Sujet : Re: Command Languages Versus Programming Languages
De : sebastian (at) *nospam* here.com.invalid (Sebastian)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 06. Aug 2024, 09:04:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v8sleh$1g9s4$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-18-amd64 (x86_64))
In comp.unix.programmer Stefan Ram <
ram@zedat.fu-berlin.de> wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote or quoted:
On 05.04.2024 01:29, Lawrence D'Oliveiro wrote:
This is where indentation helps. E.g.
a =
b ?
c ? d : e
: f ?
g ? h : i
: j;
>
Indentation generally helps.
Let me give it a try to find how I would indent that!
b?
c? d: e:
f?
g? h: i:
j;
Better:
a = b ? (c ? d : e) :
f ? (g ? h : i) :
j;
Equivalent Lisp, for comparison:
(setf a (cond (b (if c d e))
(f (if g h i))
(t j)))
And some people claim that ternaries are SO horribly
unreadable that they should never be used.