I'm curious about how much people take what Linus says at face value.
I'm even more interested now, because the fulcrum of Linus's argument isn't safety.
This is just my opinion.
Using a builtin operation ("addition and comparison of integers") is always safer than using a function that may or may not work the same everywhere. I.e. a nonstandard function.
Also, the proposed code has more levels of indirection, therefore places a higher cognitive load on the reader. These things tend to result in bugs down the road.
And it is also true that "an overflow could still happen", which is mentioned in Linus' critique.
All of these are objective ways to measure how "safe" the code is.
Returning to the thread: why are you so comfortable extrapolating from Linus's rant to "this code would ruin the Linux kernel"? You don't grok the code he's talking about.
Is it because "if Linus is arguing against this code with this much ferocity, the code must be really bad?" Because if that's it, you're starting to see the issue some people have with the tone he uses.
OK, sure.
That seems a bit hyperbolic.
> Kernel development isn't for everyone.
Very little is "for everyone". That's not an excuse to offer criticism in a nasty manner. The article links to a nicer response that's a) shorter and b) a lot more likely to educate and build up a better contributor.
By the time Linus is ranting at someone at LKML, the person he's ranting at has --- statistically, at least --- already qualified themselves as especially competent. These people aren't arguing over Rails template languages.
I'm coming to realize that the sociology of Linus LKML rants is pretty fascinating.
I would be extremely motivated to prove Linus wrong. If I would realize I was wrong, I would lick my wounds and be hurt. The hurt felt would be related to the amount of work and effort I would have invested. I would not claim that Linus is responsible for my emotional state. I was challenged and I lost.
Identifying with your ideas is fine in moderation but taking lasting personal offense is when your ideas forcefully rejected is madness.