Sujet : Re: Command Languages Versus Programming Languages
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 06. Apr 2024, 01:25:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uuq4q9$1mbbf$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
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On Fri, 05 Apr 2024 19:35:37 -0400, Alan Bawden wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Fri, 5 Apr 2024 09:17:37 -0000 (UTC), Muttley wrote:
...
>> a =
>> b ?
>> c ? d : e
>> : f ?
>> g ? h : i
>> : j;
>
> Just use brackets. Saves a lot of pain.
a=(b?(c?d:e):(f?(g?h:i):j));
A normal programmer would write something like:
a = b ? (c ? d : e) :
f ? (g ? h : i) :
j;
I.e., she would allow herself to use spaces and newlines, and just
enough parentheses to make the structure clear.
It’s like, I don’t know ... you’re trying to save space. Why?
It’s like programming inside an apartment block, instead of having a
bungalow with a yard of your own.