[flagged]

Please make your substantive points without breaking the site guidelines.

https://news.ycombinator.com/newsguidelines.html

What's Math.sqrt(value_from_a_package_that_was_definitely_a_number_before_you_updated_it)?

So then you have to make sure any inputs that get passed into Math.Sqrt aren't strings. You can pay the cost at runtime or compile time, and doing it at compile time saves you headaches later.

I agree that is not a good example, but the exact same thing can happen in more subtle ways that is hard to catch. For instance you might have a function that returns a user. Do you pass in the user ID argument as a string or a number?

>I agree that is not a good example

It's actually a great example, because in JS Math.sqrt("4") returns 2 because of JS's idiotic type coercion rules. So if you're passing in user input and don't typecheck it, it will work fine until someone inputs a letter instead of a number.

You won’t get far with attitude like that.