4 ms·
Ok let me make it more clear then: Type checking is a programming safety feature, and its trivial to argue in any domain that a safety feature is optional. Its
by vouwfietsman 3y ago
Ok let me make it more clear then:
Type checking is a programming safety feature, and its trivial to argue in any domain that a safety feature is optional. Its always trivial to argue this because safety is never a functional requirement, so it is never guaranteed to be needed for anything, and its easy to point out that regardless of safety, mistakes will happen, and that safety does not prevent all mistakes. All of this is trivial, and can be applied to any safety measure, this is why I brought up seatbelts: to show that your argument depends strongly on the context of where the safety applies, and the sacrifices that have to be made to gain that safety.
Which brings me to my second point: safety is always a tradeoff. Saying things like "perfectly safe" is completely void of meaning since nothing is ever perfectly safe, basing an argument on the fact that we cannot be perfectly safe is saying we shouldn't care about seatbelts because we're all gonna die anyway. Safety is a tradeoff and you should consider the up and downsides when you talk about it, always. So on your point:
> They aren't an easy safety feature you can use within a second and suddenly X% of bugs are prevented
Actually thats exactly what they are, because they will stop you from compiling a program that would have bugs in a dynamically typed system. Do they prevent all bugs? No, nobody is saying that. Its also easy to find how, just by googling: https://stackoverflow.com/a/27791387 https://stackoverflow.com/a/27791387
> No research shows that it prevents the bugs we actually care about
No research shows anything about software, there is no research on software, stop deflecting.
> they don't deal with runtime issues that actually kills people like the one discussed in this thread
This thread is full of people suggesting type-safe fixes that would've prevented this, I'm not sure how you're still arguing that typing wouldn't help here. Again, maybe you don't want to use it because its too much work or some other kind of tradeoff you don't want to make, fine. But if you keep suggesting that types wouldn't work here you simply don't understand types.
- Draiken 3y ago> Saying things like "perfectly safe" I've never said that. It's always about trade-offs, but simply adding a typed system would not have prevented the issue, as it was already built in a typed system. My whole point is not pro or against typed languages. It's that we need to move beyond that. > Actually thats exactly what they are, because they will stop you from compiling a program that would have bugs in a dynamically typed system. It totally depends. It only stops you if you are diligent enough to write programs with a very good type structure and hopefully you don't have any logical mistakes. If you type everything with primitives like uint you can still have a compiling program that's incorrect. > This thread is full of people suggesting type-safe fixes that would've prevented this And I could suggest fixes without typed languages that would also have prevented this, like better testing. The point is that a type system does not inherently change anything. It's still up to the developer and the systems around to be good enough to prevent catastrophes from happening. Using types is most definitely one way of solving the issue, if implemented correctly. But the exact same could be done with a dynamic language. > But if you keep suggesting that types wouldn't work here you simply don't understand types Sure... I don't understand types ;) In any case, I never said types wouldn't work here. Read my comments again. I said types are not the determining factor. The fact that this happened in a typed language simply cannot be overstated. Using a typed language or not affects many variables but it's not what will ultimately decide if a critical piece of software will kill someone or not.
- vouwfietsman 3y ago> My whole point is not pro or against typed languages. It's that we need to move beyond that. Ok, once you know where to move to we can consider that as a good solution. Until then, lets just use types, its the best tool we have. Restated: car has seatbelts, seatbelts were not used, people got injured, hence "seatbelts were not a deciding factor, we need to move beyond that". OK, sure, I can say the same of whatever you intend to move to, and we will have wasted a lot of air to no benefit.