Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Feature request: a new warning option
- X-seq: zsh-users 24329
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Re: Feature request: a new warning option
- Date: Wed, 9 Oct 2019 08:49:42 +0000
- Accept-language: en-GB, en-US
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20191009084943euoutp026e81a6510e6a48e5b74ba0d0ded61f25~L7l44EHzS1937419374euoutp02Q
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1570610983; bh=4tbXZw/MVEUfjCZjMjw+1jazlau0uoVlHrWtkPUyevI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=C0MX7TAWDGxCHSyI64d13ig0zia2uHbQJUTBqt2GJk6SEV8XjL9m/aRgaTSTEREyJ p7jh86RQcjnGgDRSTa3zzbCTI3BVfwmcg/K8ClUEGXvCwYF0dexs2cEte8A9zeG+fj 3q+DHqeSMjdJecVSVK3IpWyvxjuRlgm8J2dQqR3Q=
- In-reply-to: <CAN=4vMraXtTooeYfBDGObA7xVhoC6JpHRz1C3CUHKiW=LY8Nuw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDN-GspoiS-iVR5ThdbDVbLWVNJWcZ=TyY0=9ydtPswAw@mail.gmail.com> <CGME20191009084644epcas5p3e808d2d1e65f330659335282a1c27efd@epcas5p3.samsung.com> <CAN=4vMraXtTooeYfBDGObA7xVhoC6JpHRz1C3CUHKiW=LY8Nuw@mail.gmail.com>
- Thread-index: AQHVflbBT2vLbMd/1k2CryCk1XKeGqdR7kyAgAABPgA=
- Thread-topic: Feature request: a new warning option
On Wed, 2019-10-09 at 10:45 +0200, Roman Perepelitsa wrote:
> I myself am guilty of using `x && y || z` in place of a ternary
> and this leads to bugs that your proposed warning is meant to flag.
> However, if I were to enable this warning, I wouldn't be able to
> use `x && y || z` when it is the best tool for the job. Hence I'm
> leaning towards unlearning my current habbit and starting to use
> `if-else` more.
>
> What do you think?
For clear code, if-then-else is defnitely preferable anyway.
The problems with && / || are very subtle and often don't register even
if you're aware of the possibility.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author