3 ms·
> variable-length data structures are much more treacherous than fixed-length data structures A fixed-length structure is only fixed until you need to add a fi
by pjc50 6y ago
> variable-length data structures are much more treacherous than fixed-length data structures
A fixed-length structure is only fixed until you need to add a field to it. I understand the appeal, but good solutions seem to be very rare here. ASN.1 was possibly the first attempt but turned into a total nightmare. Protobuf seems to be doing a reasonable job, but only as a wire format and not a persistence format.
Text always "works", even if inadequately. And it can be handled with your normal diff and editing tools.
- gpm 6y agoWe've been using protobuf as a persistence format without issue?
- nitrogen 6y agoA self-describing format like MessagePack can be easier to build readers for in other applications, or if the schema is lost or changed.
- gpm 6y agoIf we've lost access to the schema, then we've lost access to our entire source repository, so we probably don't need to read our data anymore? I guess I could see that being an interesting property in software that wants to deal with incompatible forks, or software that for whatever reason wants other people to read their data but is unwilling to ship a schema with it, but just for persistence on backend servers it doesn't seem like a very interesting property or worth the extra space requirements.
- imtringued 6y agoCBOR is the gold standard for schema free data.
- pjc50 6y agoYou have. Far more apps out there are using JSON or XML, including (as we've seen GTA).
- gpm 6y agoAh, you were just talking about popularity not fitness? Fair enough.
- astrobe_ 6y ago> Text always work Windows vs Linux end-of-line markers often screws-up things. UTF often screws-up things. Tab-vs-space sometimes screws-up things. Text is related to Postel's principle, which is often questioned because it leads to sloppy implementations on one side and complex implementations on the other side, and other bug-is-now-a-feature niceties. I designed a couple of small internal protocols, and have been maintaining them for at least a decade. Maintenance time is nearly 0 because I never had to add a field to them. Even though the software using them evolved a lot and in unexpected ways. Yes, they stood the test of time because they solved the problem we had, and those problems didn't evolve much. Not every protocol or format needs to be hyper-extendable and scalable. > even if inadequately So it works poorly but it works, so it can be shipped. That's why you buy a new smartphone every two year and don't see much improvement in response time or battery life.