6 ms·
If 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
by ben_w 6y ago
If 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