[bind10-dev] trivial bug in src/lib/util/io/fd.cc

Michal 'vorner' Vaner michal.vaner at nic.cz
Mon Oct 17 07:50:38 UTC 2011


Hello

On Sun, Oct 16, 2011 at 11:19:20PM -0400, Danny Mayer wrote:
> Frankly if rest is a positive integer the line
> 
>    while (rest)
> 
> should be written as
> 
>    while (rest > 0)
> 
> Clarity is much more important. Write what your intent is and not what a
> computer/compiler might interpret it as.

I guess it's me who wrote this. And to say, I don't write these things because
it's how the compiler understands them, but because how I think about them.

The first one reads „while there's still something to do“, the second „while the
amount to do is bigger than 0“. The second is not natural way to think about it
for me, I'm not interested in the amount at all. I don't try to write only the
exact things the computer should do, but also the higher level intention or
thought of the code. Depending on that, I choose different ways to write the
same „action“.

Anyway, I know not many people share this view on the thing, so if it is a
problem, it can be changed. And I apologise for the original bug this thread was
about, that one was really stupid one.

With regards

-- 
Wait few minutes before opening this email. The temperature difference 
could lead to vapour condensation.

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20111017/1e8e5de8/attachment.bin>


More information about the bind10-dev mailing list