Hacker News new | ask | show | jobs
by nimih 682 days ago
It'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.
3 comments

It'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.

I feel my leg is being pulled, ever so gently.
the 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.