3 ms·
> And my system is safer in the end because I take that time I would've spent fighting the type system / tooling and instead spend it writing integration tests.
by davidatbu 4y ago
> And my system is safer in the end because I take that time I would've spent fighting the type system / tooling and instead spend it writing integration tests.
I'm a type-safety kind of guy, but this argument (that time spent "fighting" the type system) is better spent writing tests when it comes to DB queries, has me very very curious. Would love others' opinions/experience on this!
- hot_gril 4y agoSmall clarification, the tests aren't on the DB queries alone. It's a full flow on a test backend, like it calls /editProfile to name a user "Bob" then calls /getProfile, and it expects the response to have `name: "Bob"`. It'll probably fail if I mess up a type and get "undefined," but it's also testing much more than that.
- davidatbu 4y agoAh, in that case, I'm much less interested :D , because that would mean that you let the untypedness of the DB queries propagate through pretty much the entire codebase.
- hot_gril 4y agoOh, yeah. Except I just remembered that I use an OpenApi spec, so at least the API param and return types are enforced.