3 ms·
Could you imagine hitting a rest api and like 25% of the bytes are comments? lol
by blackcatsec 7mo ago
Could you imagine hitting a rest api and like 25% of the bytes are comments? lol
- bmacho 7mo agoHTML and JS both have comments, I don't see the problem
- Someone1234 7mo agoAnd both are poor interchange formats. When things stay in their lane, there is no "problem." When you try to make an interchange format using a language with too many features, or comments that people abuse to add parsable information (e.g. "type information") then there is a BIG problem.
- lolive 7mo ago« HTML is a poor interchange format. » - quote of the century -
- thaumasiotes 7mo agoIt caused all kinds of problems, though those tend to be more directly traceable to the "be liberal in what you accept" ethos than to the format per se.
- dunham 7mo agoWorse than that - people will start tagging "this value is a Date" via comments, and you'll need to parse ad-hoc tags in the comments to decode the data. People already do tagging in-band, but at least it's in-band and you don't have to write a custom parser.
- somat 7mo agoSee also: postscript. The document structure extensions being comments always bothered me. I mean surely, surely in a turing complete language there is somewhere to fit document structure information. Adobe: nah, we will jam it in the comments. https://dn790008.ca.archive.org/0/items/ps-doc-struc-conv-3/ps-doc-struc-conv-3.pdf https://dn790008.ca.archive.org/0/items/ps-doc-struc-conv-3/...
- f30e3dfed1c9 7mo agoNot sure it's a fair comparison. The spec says: "Use of the document structuring conventions... allows PostScript language programs to communicate their document structure and printing requirements to document managers in a way that does not affect the PostScript language page description" The idea being that those document managers did not themselves have to be PostScript interpreters in order to do useful things with PostScript documents given to them. Much simpler. For example, a page imposition program, which extracts pages from a document and places them effectively on a much larger sheet, arranged in the way they need to be for printing 8- or 16- or 32-up on a commercial printing press, can operate strictly on the basis of the DSC comments. To it, each page of PostScript is essentially an opaque blob that it does not need to interpret or understand in the least. It is just a chunk of text between %%BeginPage and %%EndPage comments. This is tremendously useful. A smaller scale of two-up printing is explicitly mentioned as an example on p. 9 of the spec.
- troupo 7mo agoReminds me how old versions of .net used to serialize dates as "\/Date(1198908717056)\/".
- thaumasiotes 7mo ago> Could you imagine hitting a rest api and like 25% of the bytes are comments? lol That's pretty much what already happens. Getting a numeric value like "120" by serializing it through JSON takes three bytes. Getting the same value through a less flagrantly wasteful format would take one. I guess that's more than 25%. In the abstract ASCII integers are about 50% waste. ASCII labels for the values you're transferring are 100% waste; those labels literally are comments. If you're worried about wasting bandwidth on comments, JSON shouldn't be a format you ever consider, for any purpose. lol