A year of publishing the MDN Blog
60 points
15 days ago
| 3 comments
| developer.mozilla.org
| HN
beastman82
13 days ago
[-]
I see an error. "hadc0ffee" is neither hexadecimal nor matches that regex. Am I missing something?
reply
jethkl
13 days ago
[-]
You are missing the joke. The correct line would read:

  isHexadecimal("HADC0FFEE"); // false
reply
huffstler
13 days ago
[-]
I believe they're showing an example of where people would use (incorrect) regex patterns to validate. That's the whole thrust of the previous paragraph. `hadc0ffee` is not valid hex, but the function says it is due to, I presume, an incorrect regex pattern. I'm not familiar enough with regex to know why it's wrong though.

Edit: I was curious, so I looked through the linked docs for regex. They have the exact same pattern for checking hex in there as they do in this one. I guess it was just an error after all?

reply
graypegg
13 days ago
[-]
so, I thought there was some esoteric weirdness in the spec'd Javascript regex engine that made HADC0FFEE somehow match /^[0-9A-F]+$/i. Then the joke kinda makes sense right? I do need coffee to work with JS most of the time haha

But I do get false, running it in chrome dev tools.

When they're talking about writing documentation for tricky subjects, this misses a bit. I have no clue what the joke is, other than, if you haven't had coffee, you might think this evaluates to true?

reply
bee_rider
13 days ago
[-]
I think that is the jokey, yeah. Also a tiny bit of a pun maybe, it looks sort of like a status test of some sort: did you have coffee?
reply
simonkagedal
13 days ago
[-]
I was also wondering what they were trying to say with that.
reply
walteweiss
14 days ago
[-]
Off topic: am I the only one who sees the page shaking on an iPhone?
reply
weikju
12 days ago
[-]
No issues here in Safari on iOS
reply
leosanchez
14 days ago
[-]
Seeing the same on Android
reply
prmoustache
13 days ago
[-]
no shaking here on firefox/android.
reply
SignalM
14 days ago
[-]
It's funny Mozilla has a blog that renders about 20px to wide on mobile. The company that makes most of the web standards. Something ironic about that
reply
uallo
13 days ago
[-]
> It's funny Mozilla has a blog that renders about 20px to wide on mobile.

This is caused by the string "sha256-tG5mcZUtJsZvyKAxYLVXrmjKBVLd6VpVccqz/r4ypFE=" which does not wrap properly. Using "word-break: break-all;" on the pre element would fix it.

> The company that makes most of the web standards.

That is incorrect. Mozilla is only one of the several companies and working groups that may be involved. MDN is documentation, not specification.

reply
StableAlkyne
13 days ago
[-]
That, and this article in all likelihood was written by a single person whose main job isn't writing a blog. It definitely wouldn't have been been written by "the company"

You don't absorb your company's entire knowledge base just by virtue of working there after all

reply
sphars
13 days ago
[-]
Renders fine on Firefox Android (no horizontal scrolling), but I do see the extra width on Chromium based browsers
reply
archerx
13 days ago
[-]
It doesn’t render at all on my ipad pro with iOS 13.7. Actually it does render and then immediately turns black. People give w3schools a lot of flak but at least it renders and is usable on my ipad unlike the MDN docs. Do we no longer care about backwards compatibility, it seems not and that’s shameful.
reply
prmoustache
13 days ago
[-]
FWIW the mdn blog works just fine without js so maybe try it while disabling javascript.
reply
biinjo
13 days ago
[-]
Im guessing this has something to do with certain protocols not supported on an (almost) 4 year old browser without any (security) updates.
reply
azangru
13 days ago
[-]
> Actually it does render and then immediately turns black

This sounds like javascript behavior (MDN, to my surprise, is built on React).

reply