Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > muc.lists.netbsd.source-changes > #156212

Re: The --> "operator" (was: Re: CVS commit: src/sys/uvm)

From Taylor R Campbell <riastradh@NetBSD.org>
Newsgroups muc.lists.netbsd.source-changes
Subject Re: The --> "operator" (was: Re: CVS commit: src/sys/uvm)
Date 2026-07-09 23:18 +0000
Organization Newsgate at muc.de e.V.
Message-ID <20260709231811.23BFD84D3B@mail.netbsd.org> (permalink)
References <752.1783555181@jacaranda.noi.kre.to>

Show all headers | View raw


> Date: Thu, 09 Jul 2026 06:59:41 +0700
> From: Robert Elz <kre@munnari.OZ.AU>
> 
>     Date:        Wed, 8 Jul 2026 15:31:01 +0000
>     From:        Taylor R Campbell <riastradh@NetBSD.org>
>     Message-ID:  <20260708153102.C64DD84DA8@mail.netbsd.org>
> 
>   | I can tell you in a second _one_ of them is definitely correct, and
>   | for _every other one_ it'll take me at least a few seconds if not a
>   | few minutes to think about.
> 
> Really?

Really!

>   | 	for (i = N; i --> 0;) { ... i ... }
> 
> That one, which is the one you (claim to) prefer, and
> 
>   | 	for (i = N; i-- > 0;} { ... i ... }
> 
> this one, which is in KNF (ignoring the statement part), differ by
> exactly the positioning of one (unnecessary) space.
> 
> 	for (i=N;i-->0;} { ... i ...}
> 
> is just the same, compressed a bit (I am not suggesting that be used).
> 
> You're really unable to see that these 3 all do the exact same thing in more
> than about a millisecond?

Absolutely yes, because with

	i-- > 0

I have to stop and think whether pre-increment or post-increment is
correct here.  In contrast

	i --> 0

is highly memorable.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

Back to muc.lists.netbsd.source-changes | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: The --> "operator" (was: Re: CVS commit: src/sys/uvm) Taylor R Campbell <riastradh@NetBSD.org> - 2026-07-08 15:31 +0000
  Re: The --> "operator" (was: Re: CVS commit: src/sys/uvm) Robert Elz <kre@munnari.OZ.AU> - 2026-07-09 06:59 +0700
    Re: The --> "operator" (was: Re: CVS commit: src/sys/uvm) Valery Ushakov <uwe@stderr.spb.ru> - 2026-07-09 13:22 +0300
      Re: The --> "operator" (was: Re: CVS commit: src/sys/uvm) Robert Elz <kre@munnari.OZ.AU> - 2026-07-09 18:41 +0700
    Re: The --> "operator" (was: Re: CVS commit: src/sys/uvm) Taylor R Campbell <riastradh@NetBSD.org> - 2026-07-09 23:18 +0000
  Re: The --> "operator" Greg Troxel <gdt@lexort.com> - 2026-07-09 12:53 -0400

csiph-web