[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: constant `e'

From: Stefan Monnier
Subject: Re: constant `e'
Date: Sat, 10 Feb 2007 14:05:33 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

> Incidentally, I also think `(not (null n))' looks better than `n'

Please, it's not the same thing: (not (null 2)) != 2
Code is a way to communicate, so if you write (not (null N)) instead of N,
the reader will have to wonder:
- is this a beginner who doesn't realize who could/should have just used N?
- or is it an experienced programmer who just wants to tell me something
  about his intention?
- or is it really that the code needs the value converted to a nil/t "boolean"?
Also, the compiler will have to work extra hard to try and figure out
whether it is safe to optimize it away or not.  If it's more work for the
compiler, it's probably more work for the human reader as well.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]