6

It is 2024 and C# doesn't seem to have a simple way to parse json data into dynamic objects. It wants some husk classes to read into. I will have to find a good third party library for this. I was thinking C# would have this, but no. I see there is something from asp stuff, but I have no clue what I have to import to get that.

Comments
  • 4
    I'm not even sure what you're looking to achieve. Dictionary<string, object> ? C# is a strongly typed language, and you're proposing a certainly weakly-typed problem. Dynamic being in C# at all is crap, frankly. It's like `any` in TypeScript. Ruins the point, total crap to work with, the source of many headaches.
  • 2
    you're complaining that there is no easy way to do something in _dynamic objects_ in a language that is known and valued for its great _static_ typing? seriously?

    when you use a bicycle, do you complain about it not being a good juice press, too?
  • 0
    @AlgoRythm Yup. Using dynamic in that scenario is introducing a lot of filth just so you can say obj.foo instead of obj["foo"]. And the latter more accurately represents what you're doing.
  • 2
    addendum:

    https://learn.microsoft.com/en-us/...

    your complaints are invalidated by the documentation.
  • 3
    I need to post wrong takes more often. I find how its supposed to be done faster.

    @tosensei

    Every time I saw JSON DOM in the docs I was kinda glazing over thinking it was "web shit". lol
  • 0
    @AlgoRythm maybe I am just looking for reasons to hate it. Learning for work. Trying to get over the learning curve so I feel like I know it enough to stop hating it. I would rather be using this:

    https://doc.qt.io/qt-5/json.html
  • 0
    With all the boiler plate of the json writer it would probably have been quicker to do object serialization...
  • 0
    @retoor happiness.. such a nostalgic word, does it even matter anymore in 2024?
Add Comment