Live data from Hacker News

0xCAFEBABE & 0xFEEDFACE (2003)

radio-weblogs.com

71–80 of 126 posts

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#71
post #18

Earlier quoted context omitted.

But why?

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.

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.

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#72

0x08675309 also shows up fairly often.

When I worked on Windows Phone during the good ol' days, my team used this for a sort of retail mode assert, for situations that really shouldn't happen. Instantly recognizable. The definition went something like this: // This is a shout out to that 80s hit. You know the one. #define E_JENNY_JENNY_WHO_CAN_I_TURN_TO 0x88675309 The 1 in bit 31 was required to signify that it's a Win32 error code. The other high bits ar…

It's far better than constants like NEVER_USE_OR_MODIFY_OR_YOU_WILL_BE_FIRED that are supposedly for testing only but turn out to be used in production to control whether a beta feature appears or not, and so lead to a bunch of dead code that couldn't really be cleanly disentangled from good production code without someone familiar with it doing a diff review.

Wherever my Motorola MPx200 went, it says "Hello."

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#74
post #39

Earlier quoted context omitted.

Reformatted: irb> [184594741, 2880289470, 2881141438, 2965027518, 2976579765, 3203381950, 3405691582, 3405697037, 3735927486, 4027431614, 4276992702].map! { _1.to_s(16) } => ["b00b135", "abadbabe", "abbababe", "b0bababe", "b16b00b5", "beefbabe", "cafebabe", "cafed00d", "deadbabe", "f00dbabe", "feedbabe"]

I wonder why are many many "babe" constants included, but only a single "d00d" constant.

Burn baby burn

(As per the Apollo guidance computer)

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#76

a long time a go I wrote a script that spit out random phrases in hex that would work as a mac address. I used to do this to mess with my coworkers in networking , and previous coworkers at the ISP I was still using. My HN username is the only one i remember though.

I always set my MAC to deadbeefcafe because it stuck out so much to see it in wireshark.

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#77
post #24

Earlier quoted context omitted.

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.

So 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.

Just 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.

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#78
post #24

Earlier quoted context omitted.

But why?

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.

Oh.

I was reading them out in hex. As in CA FE BA BE …

Now I feel stupid.

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#79
post #34
post #5

I'm surprised they didn't use 0xDECAFBAD for the Java format. Even more interesting is the Wikipedia page https://en.wikipedia.org/wiki/Hexspeak catalogs a delightfully long list of hexspeak words and what they're used for.

because it would need to be an even number of digits

Sneaky isn't it? Its give for the first "word" then three for the second.

Re: 0xCAFEBABE & 0xFEEDFACE (2003)

#80
post #18

Earlier quoted context omitted.

But why?

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.

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.

Post reply on HN