Hacker News new | ask | show | jobs
by oconnore 2036 days ago
There seems to be a bit of irony citing whatwg in your attempt at shaming here —- the standard that was created to be a living document tracking what web developers and browser creators were implementing in the real world.

I’m not sure there is a good reason to require web authors to type an extra 5 character prefix every time they want to attach data to an element. This is supported by the fact that browsers can figure this out.

1 comments

Those five letters are the difference between safe code and unsafe code. If you've used data-* you can rest assured your attributes will always be author-defined and not interfere with any future real attributes defined by HTML, whatever those may be.

But if you invent and use invalid attributes, any browser could do something with that, any day, for any reason, and it wouldn't be a bug - you're the one that would have chosen to build on top of undocumented and non-standard behaviour. Does that sound like a reasonable approach to you when the safe and future-proof approach is so clearly marked and cheap and easy to do?