← Back to context

Comment by neonsunset

2 years ago

You should never do that. Please do not, and I can't stress this enough, use `dynamic`.

If you need DOM-style JSON handling, please use JsonDocument and JsonNode instead: https://learn.microsoft.com/en-us/dotnet/standard/serializat...

There are plenty of cases where dynamic saves a ton of code.

  • No, it never does. There are better containers than dynamic, that do not have its performance drawbacks and have way better UX. The fact that this does not raise an eyebrow is a legitimate concern over the state of the codebase that uses it!