flâneur — a map of the web's best reading

Reflecting on deserialization. Why you should explicitly decode your JSON

hashset.dev · 3,183 words · saved by 1 readers

When working with JSON, 99% of the time developers write a custom type that closely matches the format of the JSON payload, and then use their favorite programming languages built in metaprogramming ability to automatically deserialization the payload into a typed object. I want to tell you why you shouldn't use reflection and instead take a page out of functional programming and explicitly decode the JSON payload.

Reflecting on deserialization. Why you should explicitly decode your JSON. JSON is everywhere . As developers, we will be required to work with it at some point or another. Maybe in the embedded space you could avoid it, but as a cloud and web developer, I have no choice but to be intricately familiar with all things JSON. As an enjoyer of statically typed programming languages, I need some way of deserializing the JSON payload into a custom defined type in my language of choice. The techniques talked about here are opinions I hold myself that I have developed over my career and work well for

Explore this link on the map →

saved by

related reading