[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: point-min and 1
From: |
Stefan Monnier |
Subject: |
Re: point-min and 1 |
Date: |
Wed, 12 Aug 2009 22:22:30 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
> I asked a serious question. Would you please humor me with a serious
> answer?
Just the same old general programming principle that says that you
should avoid using integer constants and prefer to give them names, so
the intention is clear. In the case of "1", there might be many
different kinds of "1", it can be "1" the size of chars in a buffer, or
"1" the position of the second char in a string, or ...
As a general rule, using 1 rather than (point-min) tends to also
introduce bugs where code only works when the buffer is widened, so it's
good practice to prefer (point-min) over 1.
Stefan
- Re: point-min and 1, (continued)
- Re: point-min and 1, martin rudalics, 2009/08/14
- Re: point-min and 1, David Kastrup, 2009/08/14
- Re: point-min and 1, martin rudalics, 2009/08/14
- Re: point-min and 1, Miles Bader, 2009/08/14
- Re: point-min and 1, Stefan Monnier, 2009/08/13
- Re: point-min and 1, martin rudalics, 2009/08/14
- Re: point-min and 1, David Kastrup, 2009/08/14
- Re: point-min and 1, martin rudalics, 2009/08/14
- Re: point-min and 1, Stefan Monnier, 2009/08/11
- Re: point-min and 1, Eli Zaretskii, 2009/08/11
- Re: point-min and 1,
Stefan Monnier <=
- Re: point-min and 1, Eli Zaretskii, 2009/08/13
- Re: point-min and 1, martin rudalics, 2009/08/13
- Re: point-min and 1, David Kastrup, 2009/08/13
- Re: point-min and 1, martin rudalics, 2009/08/13
- Re: point-min and 1, Stefan Monnier, 2009/08/13