The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
So, Newtonsoft is the premier library for JSON in C#. If you create a stringdictionary in C# and serialise it, the resultant JSON will not deserialise using the same library and same CLASS. I had to use Dictionary<string, string="">
Well, sure, but, I still think I've spent less time dealing with this frustration than it took to write JSON.Net which, again, is widely used so I get the benefit of tons of testing.
When I was new to dev, I mocked the idea of paying for things I knew I could write. Now I know the most important thing is giving my boss a result as quickly as possible. Would you roll your own auth or use Identity, for example?
I agree with you in general. But in JSON's case, I've never found a good reason *not* to use what I've built, as by now it's tested, and unlike NewtonSoft it does exactly what i want how I want it.
It did take me time to get it there, so I probably wouldn't have built it professionally unless i needed like, a little REST/json-RPC layer and nothing else at which point I know from experience that deving that took less time than learning to do the same thing with NewtonSoft, whose offering is actually more complicated in that regard.
I am aware that a schema can specify that a sequence is to be preserved. Of course, even if you are not required to preserve the order of elements, you are allowed to do so in your processing, which is often the simpler solution. But unless explicitly declared as a sequence, I would not rely on preservation of order.
Schemas can only restrict the order they may appear in. (order=any or whatever means no restriction, but it still keeps the subelements in document order)
I'm pretty darned confident of this, but do correct me if I'm wrong. The *only* exception i could think of would be something that allows reordering by schema "key" field, or perhaps "id" field but i've never seen an implementation that does this, and I think it's not cool to do.
So I'd put rent money on this assertion. I don't rent, but still.
I would try to justify my claim but I just don't have enough spare time to point out all the wrongs with it. Let's just say it's very biased and the examples are not practical and have been cherry picked to fit the agenda.
For example, at one point it uses XPath to show how easy it is to get elements with a certain attribute using XML, but then suggests you need to write a multiple line for-loop to deal with the JSON equivalent...
Personally I don't have a problem with either, pick what best suits the requirements, as is true with most things.