[Git][NTPsec/ntpsec][master] ntpviz: correct usage for errno
Dave Hart
davehart at gmail.com
Thu Jul 3 04:57:21 UTC 2025
Cheers,
Dave Hart
On Thu, Jul 3, 2025 at 3:15 AM Richard Laager (@rlaager) via vc <
vc at ntpsec.org> wrote:
>
> -
>
> [Reverted changed to non-Pythonic == idiom. Tweaked commit message.]
>
>
> 1 changed file:
>
> - ntpclients/ntpviz.py
> <#m_9204065444261560541_5d7267c06a32341332961589a5641bb0142dca20>
>
>
I learned to put an rvalue on the left-hand side of == comparisons as a
safety idiom for C/C++, sure, but I also find it speeds code comprehension.
if (ENOENT == errno)
vs.
if (errno == ENOENT)
errno is cognitive noise. Just my two cents. I'm not advocating churning
existing code but you might consider it writing new code, regardless of
whether it's C/C++.
Cheers,
Dave Hart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20250703/92583a7a/attachment.htm>
More information about the vc
mailing list