by buzzardbait · 1y ago · 0 comments
In .NET land the most popular JSON library is Newtonsoft which plays fast and loose with the JSON spec and makes a lot of default assumptions. A couple of years ago Microsoft rolled out their own first-party JSON library, which is a lot stricter and requires the developer to explicitly configure the parser instead of making assumptions.
https://learn.microsoft.com/en-us/dotnet/standard/serializat...
But some developers still instinctively reach for Newtonsoft, even when working on brand new projects. In practice, this sort of ingrained habit is far greater of a problem than the JSON spec itself.
The author says that Protobuf makes all of JSON's problems go away. I don't know enough about Protobuf to confirm or deny, but I know that it's not tested 10 trillion times a day like JSON is.
Perhaps not, but it might be close: essentially every message sent between every component of every service on every machine in every datacenter Google operates gets encoded as a protobuf. Engineering at Google consists of populating protobufs to send to other services, which reply with protobufs containing the data you need to stuff into more protobufs, which you can then send on to further different services.
We can, in other words, safely conclude that protobuf scales.
I think it is more interesting how protobuf is used. I am not experienced in it but roughly it seems like you design a schema for tight packing data. Therefore there is more work in accepting a protobuf and you cant just add arbitrary fields and let old versions of sdks ignore em. I think!
This is good and bad. It is the schema vs schemaless and compile types. vs runtime types.
There is also the efficiency of protobuf vs slightly more verbose JSON.
JSON is essentially just a specification for some syntax. When you actually want a full and well-defined serialization/deserialization format, this can lead to fun surprises with JSON.
Despite the heavy usage I it hasn't been canned and I have never heard anyone at work complain about JSON for any reason.
You could say it is network effects but if it were crap you could replace it much more easily than say moving from Python to Java or whatever. Especially for internal microservice stuff and perhaps front end.
JSON and the tooling is basically solid. It is a non-concern.
A random click on a website might not be a great test, but it is a test nonetheless. And if it fails enough times, someone somewhere will be held accountable.
Also, there was no Python 2/3 - it’s not comparable and there were no breaking changes in the language. You can’t be serious if you think these are equivalent.
All companies whose main business isn't selling software have reasons to use ancient stacks, that isn't the money maker, what is deployed in production works, and there isn't budget around for a full rewrite.
Also Microsoft could set the example, some of those products are theirs.
Yes I am serious, library code also counts.
If your identity wasn't so tied with .NET, maybe you would see the transition mess in a bit more impartial way, it is no accident that now they introduced AI based migration tool at Ignite, and are seeking companies willing to try it out.
Wow. I'd like to live in your world. Where I am, they seem to be the norm.
https://learn.microsoft.com/en-us/dotnet/standard/serializat...