by PashaGo · 5mo ago · 0 comments
I'm not sure I agree that anonymous records are “obviously useful” when working with JSON. JSON is not typed, so if you want your deserialized JSON to be statically typed, you need to declare typed records outside of the JSON, so I'd say it's far more useful to use type declarations that are not anonymous.
That said, anonymous types are incredibly useful in general. I work with C# a lot and its support for them is rather shallow. In particular, there is no “with” expression equivalent.