On Saturday, 16 June 2007 at 01:41, Kyle Wheeler wrote: > On Saturday, June 16 at 02:09 AM, quoth Vladimír Marek: >> Why not, if you believe that it's worth of six lines instead of one. > > Well, so my thinking there (and I'm not an official mutt developer, I'm just > a guy with opinions) is based on my own experience with large code bases. > Code that ends up looking sloppy or with unnecessarily "inelegant" pieces is > code that often confuses people and is likely to be removed later (e.g. in a > kruft removal) long after the original reason it's in there has been > forgotten---this is particularly true when working around bugs in compilers > or libraries that most of the primary developers do not or never had access > to. At that point, just for maintainability (and readability) reasons, if > you still want the workaround in the code, it's a good idea to put a comment > in the code explaining why it looks so strange and why it needs to stay that > way. Personally, though, I prefer a similarly-sized ifdef that gives > non-broken compilers the more "clean" code, so I can read it and think to > myself "ah, I don't have to worry about that". > > Plus, of course, nobody likes "magic code" that looks strange but can't be > changed. :) I agree. But I'd also point out that hg annotate is a wonderful tool for digging up the motivation behind weird looking code (as long as the committer wrote some kind of explanation in the changelog).
Attachment:
pgpz09189Q3TE.pgp
Description: PGP signature