3 ms·
Unfortunately, in practice they are a nightmare. Look at the WHOIS protocol for an example. Humans don’t look at responses very much, so you should optimise fo
by orf 2y ago
Unfortunately, in practice they are a nightmare. Look at the WHOIS protocol for an example.
Humans don’t look at responses very much, so you should optimise for machines. If you want a human-readable view, then turn the JSON response into something readable.
- poincaredisk 2y agoWhois protocol has no grammar to speak of (the response body is not defined at all, just a text blob) which makes it a nightmare to parse. Having a proper response format would solve this. Though I agree, I prefer my responses in JSON.
- tephra 2y agoIf you want WHOIS with a better defined format we have a protocol for that! It's called RDAP https://en.wikipedia.org/wiki/Registration_Data_Access_Protocol https://en.wikipedia.org/wiki/Registration_Data_Access_Proto...
- astrobe_ 2y agoThe next logical step is to use a machine-friendly format instead; that is a binary protocol. Even HTML and XML which were designed for readability and manual writing eventually became 'not usable enough" ("became" because I think part of it is that their success made them exposed to less technical populations), and now we have markdown everywhere which most of the times is converted to HTML. So if you are going to use a tool more sophisticated than Ed/Edlin to read and write (rich) text in a certain format, it could be more efficient to focus on making the job of the machine - and of the programmer, easier. If you look at a binary protocol such as NTP, the binary format leaves very little room for Postel's principle [1], so it is straightforward to make a program that queries a server and display the result. [1] https://en.wikipedia.org/wiki/Robustness_principle https://en.wikipedia.org/wiki/Robustness_principle