Re:`three = 1` in the Linux sourcecode (2014)
by ben_w on Tuesday March 09, 2021 @09:11AM
(#26398888)
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.
[ Parent
| on HN ]
Re:`three = 1` in the Linux sourcecode (2014)
by kortex on Tuesday March 09, 2021 @09:46AM
(#26399255)
Totally 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"
Re:`three = 1` in the Linux sourcecode (2014)
by ipnon on Tuesday March 09, 2021 @01:23PM
(#26401805)
Why 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.
Re:`three = 1` in the Linux sourcecode (2014)
by de6u99er on Tuesday March 09, 2021 @10:21AM
(#26399600)
Or 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.
Re:`three = 1` in the Linux sourcecode (2014)
by gadrev on Tuesday March 09, 2021 @12:39PM
(#26401252)
> Totvald's very own little FizzBuzz game hidden in ext4's file-system source code
What's that?
Re:`three = 1` in the Linux sourcecode (2014)
by warkdarrior on Tuesday March 09, 2021 @02:25PM
(#26402796)
Write 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