i used protobuffers a lot at $previous_job and i agree with the entire article. i feel the author’s pain in my bones. protobuffers are so awful i can’t imagine google associating itself with such an amateur, ad hoc, ill-defined, user hostile, time wasting piece of shit. the fact that protobuffers wasn’t immediately relegated to the dustbin shows just how low the bar is for serialization formats.
Protobuffers Are Wrong (2018)
161–170 of 321 posts
Re: Protobuffers Are Wrong (2018)
#162Earlier quoted context omitted.
Sure you can look at it[1], but you're not expected to look at Apple Photos database. The computer is. Write a correct JSON parser, compare with protobuf on various metrics, and then we can talk. [1]: although to be fair, I am older than kids whose first programming language was JavaScript, so I do not think of JSON object format with property names in quotes and integers that need to be wrapped as strings to be safe…
I'm also "older" but I don't think that means anything. > Sure you can look at it[1], but you're not expected to look at Apple Photos database. How else are you supposed to figure it out? If you're older then you know that you can't rely on the existence or correctness of documentation. Being able to look at JSON and understand it as a human on the wire is huge advantage. JSON being pretty simple in structure is as a…
I don’t think this is a given at all. Depends on the context. I think it’s often overvalued. A lot of times the performance matters more. If human readability was the only thing that mattered, I would still not count JSON as the winner. You will have to pipe it to jq, realistically. You’d do the same for any other serialization format too. Inside Google where proto is prevalent, that is just as easy if not more convenient.
The point is how hard or easy it is for an app’s end user to decipher its file database is not a design goal for the serialization library chosen by Apple Photos developers here. The constraints and requirements are all on different axis.
Re: Protobuffers Are Wrong (2018)
#163I share the author's sentiment. I hate these things. True story: trying to reverse engineer macOS Photos.app sqlite database format to extract human-readable location data from an image. I eventually figured it out, but it was: A base64 encoded Binary Plist format with one field containing a ProtoBuffer which contained another protobuffer which contained a unicode string which contained improperly encoded data (for e…
Re: Protobuffers Are Wrong (2018)
#164It is a 7 year old article without specifying alternatives to an "already solved problem." So HN, what are the best alternatives available today and why?
It’s the new default in a lot of IOT specs, it’s the backbone for deep space communication networks etc..
Maintains interoperability with JSON. Is very much battle tested in very challenging environments.
Re: Protobuffers Are Wrong (2018)
#165Protobuf's original sin was failing to distinguish zero/false from undefined/unset/nil. Confusion around the semantics of a zero value are the root of most proto-related bugs I've come across. At the same time, that very characteristic of protobuf makes its on-wire form really efficient in a lot of cases. Nearly every other complaint is solved by wrapping things in messages (sorry, product types ). Don't get the enum…
Some solutions do exist like here’s a C one[1] which maybe you could throw in some WASI / WASM compilation and get “somewhat” idiomatic bindings in a bunch of languages.
Here’s another for Rust [2] but I’m sure I’ve seen a bunch of others around. I think what’s missing is a unified protoc style binary with language specific plugins.
Re: Protobuffers Are Wrong (2018)
#166Re: Protobuffers Are Wrong (2018)
#167I went into this article expecting to agree with part of it. I came away agreeing with all of it. And I want to point out that Go also shares some of these catastrophic data decisions (automatic struct zero values that silently do the wrong thing by default).
This is not pb nor go. A sensible default of invalid state would have caught this. So would an error and crash. Either would have been better than corrupt data.
Re: Protobuffers Are Wrong (2018)
#168Earlier quoted context omitted.
Flatbuffers satisfies those requirements and doesn’t have varint shenanigans.
What about Cap’n Proto https://capnproto.org/ ? (Don't know much about these things myself, but it's a name that usually comes up in these discussions.)
Re: Protobuffers Are Wrong (2018)
#169Not even before the first line ends you get "They’re clearly written by amateurs". This is a rage bait, not worth the read.
Re: Protobuffers Are Wrong (2018)
#170I agree with the author that protobuf is bad and I ran into many of the issues mentioned. It's pretty much mandatory to add version fields to do backwards compatibility properly. Recently, however, I had the displeasure of working with FlatBuffers. It's worse.