From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] simplicity From: "Russ Cox" Date: Wed, 19 Sep 2007 11:02:02 -0400 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Message-Id: <20070919150122.BF0DD1E8C35@holo.morphisms.net> Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: c1171bc2-ead2-11e9-9d60-3106f5b1d025 > i see two problems with this sort of indirection. if i see NBBY > in the code, i have to look up it's value. NBBY doesn't mean anything > to me. this layer of mental gymnastics that makes the code hard > to read and understand. on the other hand, 8 means something to me. >=20 > more importantly, it implies that the code would work with NBBY > of 10 or 12. (c standard says you can't have < 8 =C2=A75.2.4.2.1.) > i'd bet there are many things in the code that depend on the sizeof > a byte that don't reference NBBY. >=20 > so this define goes 0 fer 2. it can't be changed and it is not informa= tive. 8 can be a lot of things besides the number of bits in a byte (the number of bytes in a double or vlong, for example). if you're doing enough conversions between byte counts and bit counts, then using NBBY makes it clear *why* you're using an 8 there, which might help a lot. in other contexts, it might not be worth the effort. jumping all over a #define without seeing how or=20 why it is being used is not productive. nor interesting. in fact i can't believe i'm writing this. sorry. russ