Re:Open-sourcing Sorbet: a fast, powerful type checker for Ruby
by philwelch on Saturday June 22, 2019 @12:10PM
(#20250316)
In most statically typed languages you end up with a class/struct type that encapsulates the API response you are either generating or parsing. When you don’t have this, you have to either assume or defensively program around the presence or absence of certain fields in certain contexts. “Everything is a hash/dict/JSobject” doesn’t absolve you of having to reason about which fields an API payload contains, it just forces you to do it all by hand rather than simply defining a data type and telling your serializer/deserializer “this is what I want” (and then operating on a strongly typed object rather than an arbitrary hash table).
[ Parent
| on HN ]
There are no comments on this comment yet.