Re:Strong typing, a hill I'm willing to die on
by Aeolos on Saturday October 07, 2023 @01:07AM
(#37799142)
And that's assuming you even have access to said source code. In many cases, you just receive a semi-documented JSON object and a prayer.
Anecdotal story: We recently went through an effort to introduce strict-type checking for our typescript backend. As part of that effort, we introduced concrete types for every API accessible across a service boundary, which caught 6 mismatches between the documentation and the implementation (e.g. return Promise<bool> vs Promise<Instance>) and several hundred issues with missing null or type checks that would result in an "InternalServerError" instead of a meaningful error message.
We started rolling the strict version out this week, and we can already see a meaningful improvement in the sentry logs.
Also, if I am using an API another team is providing - I don't want to have to go and trace through their code.