News for hackers. Stuff that matters.
Re:Protobuffers Are Wrong (2018) by KerrAvon on Thursday March 23, 2023 @06:25PM (#35282231)
> protobufs are a data exchange format. The schema needs to map clearly to the wire format because it is a notation for the wire format, not your object model du jour.

Yes, exactly this. I don't understand the vitriol here. Protobufs work fine for a wide variety of purposes and where the criticisms matter people use a different tool.

> I do mourn the days when a project could bang out a great purpose-built binary serialization format and actually use it. But half the people I hire today, and everyone in the team down the hallway that needs to use our API, can no longer do that. I'm lucky if they know how two's complement works

Would be great to work at a place where everyone knew how the machine worked, but the vast majority of developers entering the workplace since about 2000 have learned Java and web sh*t exclusively.

Re:Protobuffers Are Wrong (2018) by ninkendo on Thursday March 23, 2023 @06:41PM (#35282437)
The problem is that protobufs aren’t just an interchange format, they’re also a system for generating the code used to interact with said interchange. Said code has a habit of leaking into the types used by your code base. It’s too easy to just pass protoc-generated objects around and use them all over your code base, hence the majority of the criticisms.

Protobuf seems to encourage this… instead of a hard boundary where your serialization logic ends and your business logic begins, every project I’ve worked on that uses protobuf tends to blur the lines all over the place, even going as far as to make protoc-generated types the core data model used by the whole code base.

Re:Protobuffers Are Wrong (2018) by wahern on Thursday March 23, 2023 @07:33PM (#35283038)
> The problem is that protobufs aren’t just an interchange format, they’re also a system for generating the code used to interact with said interchange. Said code has a habit of leaking into the types used by your code base. It’s too easy to just pass protoc-generated objects around and use them all over your code base, hence the majority of the criticisms.

Welcome to the tyranny of strong typing. Now that we know the game is Global Thermonuclear War (i.e. one of the most fundamental and endless debates in software engineering), we know the only winning move is to not play at all.

Re:Protobuffers Are Wrong (2018) by jeffbee on Thursday March 23, 2023 @08:14PM (#35283373)
You can take the wire format and ignore the code generator, if you like. I often do, especially for languages other than C++. For C++ I quite like the generated code.
Re:Protobuffers Are Wrong (2018) by Pxtl on Thursday March 23, 2023 @08:36PM (#35283558)
I mean can you blame them? There's just so much java and web shit to learn. When are they going to pick up bit-banging when every week there's a new build toolchain or minifier or CSS standard or whatever other pile of abstraction upon abstraction of the day.