4 ms·
> Just using JS and letting things break without knowing it? And if types change, and it still works, it's basically working by accident.
by david422 4y ago
> Just using JS and letting things break without knowing it?
And if types change, and it still works, it's basically working by accident.
- latchkey 4y agoIf types change, it doesn't compile and I can't do a release in CI. I don't consider that working.
- david422 4y agoI'm agreeing with you here. If you use plain JS and change the underlying types that are being passed around, but things are still working, you're basically getting lucky.
- latchkey 4y agoOk, got it. Apologies. If you write comprehensive unit tests for your javascript, that should effectively also work too... this is what ruby developers pretty much had to do. We can see that over time based on the decline of ruby popularity in general, that fell out of style though. It is too easy to make a mistake and everyone was just duplicating what a compiler does for us. I can't tell you how many hours I would sit there pair programming with other ruby developers just trying to figure out what 'type' an object is. Mind boggling, but it was good to get those high paid consulting hours.
- oivey 4y agoThat’s a pretty underspecified comment for a static typing enthusiast. You’re referring to polymorphism. And to be completely clear: you can have safe polymorphism without type hierarchies via things like type inference.
- arinlen 4y ago> And if types change, and it still works, it's basically working by accident. So the Liskov substitution principle now passes off as "working by accident"?