Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 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