3 ms·
unsigned three = 1; To me, that is a 20 foot tall neon orange flashing Chesterton's fence. I think, "surely there is a very strong reason for this." Maybe not
by kortex 6y ago
unsigned three = 1;
To me, that is a 20 foot tall neon orange flashing Chesterton's fence. I think, "surely there is a very strong reason for this." Maybe not a good reason, but definitely a compelling one.
- ben_w 6y agoIf I was code reviewing this, I would almost certainly insist on a different name to make the WTF go away. I’m not going to suggest one here despite having read the other code comment, as doing so would be bikeshedding — not my codebase and I have no skin in this — the only point I will insist on is that I cannot believe that “three” is a sensible choice of name for whatever it does. Not even what the comment implies it does.
- kortex 6y agoTotally agree, it would definitely be better to rename it, but I read in another comment that the kernel is loathe to rename things. So then it makes you wonder, who allowed 'number_noun = N' in the first place? "Three is the number of the counting, and the number thou shalt count to is three"
- ipnon 6y agoWhy my kids ask me questions like this, "who invented the number three," I usually tell them it was someone vaguely European of the Enlightenment era with the same last name. "Ah, it was Ulysses Herman Three, inventor the natural numbers and famed bicyclist." Usually buys me enough time to look it up online.
- de6u99er 6y agoOr at least require a comment explaining it, before someone needs to dig through the code. Powers of three, five, and seven sounds a little bit like Totvald's very own little FizzBuzz game hidden in ext4's file-system source code.
- gadrev 6y ago> Totvald's very own little FizzBuzz game hidden in ext4's file-system source code What's that?
- warkdarrior 6y agoWrite a filesystem that saves all data blocks to disk, but: - if the data block id is a multiple of 3, replace its contents with 0x03 - if the data block id is a multiple of 5, replace its contents with 0x05 - if the data block id is a multiple of both 3 and 5, replace its contents with 0x15
- m463 6y agoTake down the fence. It's in the filesystem code, what could go wrong?
- a1369209993 6y ago> To me, that is a 20 foot tall neon orange flashing Chesterton's fence. It's not a Chesterton's fence, though. The whole point of Chesterton's fence is that whoever put up the fence that you want to take down couldn't be bothered to add signage explaining why the fence was present, thus either it isn't important to keep the fence up long term, or they're a idiot, in which case there's no reason to belive they were correct in deciding that having a fence there was useful in the first place. With this fence, if you walk a few meters to the side (read, "select 'ext4_list_backups' and hit ^F and ^G a few times); et viola, there's your signs.