re: Is “Defensive Programming” actually healthy? VIEW POST

re: I agree that done well, defensive programming is helpful. Being mindful of the future is generally a good thing, especially in software engineering...

Omg this was totally the way that I wrote JS before TypeScript was invented:

Every function checked that all the arguments were the right type and were non null.

And this was also me:

We later transitioned to TypeScript and deleting all of those defensive checks (replacing them with types) was very satisfying.

It’s so nice to meet others who have had similar journeys. And thank you for sharing your perspective on the clutter of duck typing. I never thought of that so it was really valuable to hear. :)

Code of Conduct Report abuse