5 ms·
The problem I see with binary protocols is the same one that plagues XML: as soon as you build something to be "not human-readable", any potential efficiencies
by Udo 11y ago
The problem I see with binary protocols is the same one that plagues XML: as soon as you build something to be "not human-readable", any potential efficiencies gained will quickly be overshadowed by increasing bloat.
When you as a developer look at JSON messages, and you see endless walls of irrelevant text scroll by, you're disgusted. This disgust drives minimalism. With a machine-centric format, the excuse quickly becomes "oh, this is intended for machines anyway, so who cares". If you can access something through tools only, the bloat becomes hidden and is encouraged to grow.
At that point, you'll start seeing articles asserting that, sure, the new super-efficient binblob messages are 10x-20x as large as JSON used to be, but look at all the things we gained, like automatic protocol negotiation, contracts, actual serialized objects. Any of these sounds reasonable at first but in reality will only benefit tool vendors in a vicious feedback cycle where the format slowly evolves itself to death.
I take that 3-5x overhead of parsing JSON any time over the non-human-readable alternatives. That doesn't mean it's the right choice for all protocols. But it's a reasonable default for a lot of systems.
- Jweb_Guru 11y agoXML was never intended as a memory-efficient format (or if it was, it was an utter failure before a single tag had been transmitted over the wire). I don't understand why you believe that binary formats naturally lead to increased bloat; while it may indeed be the case, your post largely reads like speculation to me. One could just as easily posit that the rigidity required of such a format makes it much harder to change (and examples supporting this viewpoint abound, including things like IPv4). Can you provide some examples of actual binary protocols that underwent this transformation?
- Udo 11y ago> XML was never intended as a memory-efficient format I never said it was. I apologize if it wasn't clear from my comment, but it was centered solely on the aspect of human readability. You're not wrong about it being speculation though, I just don't see the harm since we're talking about a speculative source article in the first place. > Can you provide some examples of actual binary protocols that underwent this transformation? My entire comment was addressing an example where I felt a format had degenerated because it transitioned from a human-readable to a decidedly machine-readable form. My criticism is not based on the notion that binaries are bad in of themselves.
- WalterGR 11y agoXML was never intended as a memory-efficient format... I wonder if it was assumed during the creation of XML that it would usually be compressed. The largely symmetric open and close tags compress quite well...