Hacker News new | ask | show | jobs
by venus 4696 days ago
Well, the cool thing about HTTP error codes is that you don't need a campaign or get permission from the W3C, you can just start using them if you want.
2 comments

Yes, but that's true of other standards. Eg, I can start putting <haiku> tags in my HTML if I want.

The issue is whether anyone else will expect this tag or code and do anything meaningful with it.

I get what you mean but I don't think this is the same thing. HTML has a DTD, something that people conform to when writing, so your <haiku> tag would not follow that guideline, whereas companies like Twitter can implement their own error codes as they see fit. See error code 420, Enhance Your Calm.[0]

[0]: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Well, sure, just like I can create my invented domain name like hacker.news and use my own IP addresse 1.2.3.4 without being allocated them. The Internet interoperates by everyone agreeing to follow the same agreed conventions, but there is no rule that says you have to. The registry for HTTP status codes has no 420 code and could be assigned for a different purpose in the future: http://www.iana.org/assignments/http-status-codes
Yes, they can respond with 420. However, my browser does not have a predetermined response for that. Whereas if they respond with 200 or 302 or 404, all browsers know what to do; that's what it means to be a "standard".
> HTML has a DTD

Tangentially to your point, that's only true of the 4.x and earlier versions of HTML which are SGML applications, WHATWG HTML / W3C HTML5 is not SGML-based and does not have a DTD.

Eg, I can start putting <haiku> tags in my HTML if I want. The issue is whether anyone else will expect this tag or code and do anything meaningful with it.

You mean like this? https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custo...

Honestly, people who believe in this strongly enough should just start using them and provide themselves as examples of good use cases. That doesn't mean it shouldn't be campaigned for to get more people to use it.