14 ms·
But why?
by SanjayMehta 2y ago
But why?
- nimih 2y agoIt's a mystery, lost to the sands of time. IMO, it's highly unlikely anyone will ever discover why the maintainers of the Rust compiler decided to lint their codebase for a dozen or so magic numbers.
- SanjayMehta 2y agoI feel my leg is being pulled, ever so gently.
- fch42 2y agothe github commit's "conversations" log for the commit has a few notes you need to log in for to view. But then, the maintainer who merged said "it's just a few constants". Which is fair enough. I think this would more belong into clippy; it'd be easier extensible then, and less "magic". But I'm just a 0xf001 who's intentions are 0x900d ... please don't let me 0xbe misunderst0x0d.
- cbzbc 2y agoIt's fairly simple - and I don't know why no one has pointed this out already. If everyone starts to use the same magic numbers then they are no longer magic and you can end up with strange corner case bugs and holes where a magic number used in one context is mistaken for a magic number in another context.
- Krssst 2y agohttps://www.oxfordlearnersdictionaries.com/definition/english/babe https://www.oxfordlearnersdictionaries.com/definition/englis... > but sometimes considered offensive if used by a man to a woman he does not know There are billions of other magic numbers to choose from anyway.
- johnisgood 2y agoSo someone using "0xCAFEBABE" or whatever, do you really think women take it personally, or what is the problem here? If I were to use it, there would be no target, and I doubt in most common uses there are any, so it does not make much sense to me.
- Krssst 2y agoJust don't take the risk. Why is there a need to put potentially offensive words in the code when there are billions of alternatives? Some people may find it funny, but it mostly gives an image of immaturity.
- layer8 2y agoI’ve never liked those hex words, especially the sexually connoted ones, but at the same time I find the existence of code checking for them very cringy.
- HappMacDonald 2y agoBecause every word and every combination of hexadecimal characters is "potentially offensive", and because those prone to taking offense are perfectly capable of finding it anywhere that they want to anyway?
- self_awareness 2y agoIt's about what's offensive in certain groups living in the US. Nobody cares about the rest of the world. Certainly not these groups. I'm still baffled that it's still possible to use the "kill" word when terminating processes, but "cafe dude" is somehow undesirable. Selective virtue signalling at its finest.
- kragen 2y agoafter the parent kills the children that were sending the commands to the slaves, it needs to wait to reap the zombies, because there's no garbage collection for the dead children. otherwise the process table might fill up from all the forking, like with a fork bomb. then stonith failover will nuke the server, unless it's on the blacklist of dummy servers i wrote the stonith daemon in racket scheme because guile was too slow and was sometimes missing a heartbeat
- SanjayMehta 2y agoOh. I was reading them out in hex. As in CA FE BA BE … Now I feel stupid.
- lazide 2y agoThe beauty of being that kind of ‘stupid’ is you’re impervious to certain kinds of shaming. Enjoy it. Revel in it, if you can.
- matrix87 2y ago> but sometimes considered offensive if used by a man to a woman he does not know At some point within the past 10 years they started inserting these annoying little sjw asides into the dictionaries