3 ms·
>"this combination of preconditions yield a business logic edge case that wasn't accounted for". Static typing doesn't really help more than dynamic typing in t
by _dain_ 3y ago
>"this combination of preconditions yield a business logic edge case that wasn't accounted for". Static typing doesn't really help more than dynamic typing in these cases.
Depends on the language and the business logic. Types are a way of specifying preconditions and postconditions; a more expressive type system lets you rule out more edge cases by making illegal states unrepresentable.
In particular, I'm pretty sure it's not possible to have the thread bug from the article in Rust's type system.
- deleted 3y ago[deleted]
- makeitdouble 3y agoSpeaking only for me, but one can get used to the limits of the system and adapt (put another, I'd tend to introduce as many logical bugs, but in different ways) For instance in a method that absolutely requires a specific type of object as a return, setting up a sacrificial default value to have the compiler happy, and actually build the inners of the function from there would be a normal course of action. That lets us run the code as we build it. But at the end if you forgot a case, it will still be a bug, except instead of having a wrong return type you get a wrong value. Weither it's better or not is up for debate.
- fijiaarone 3y agoIt’s also not possible to write a non-trivial program in Rust.
- throwaway2037 3y ago"Servo is a web rendering engine written in Rust" Is Servo non-trivial? I think yes.
- cstrahan 3y ago> It’s also not possible to write a non-trivial program in Rust. You should probably clarify that it’s not possible for you to write non-trivial programs in Rust. And that’s okay! No one comes into this world knowing how to do any thing, but we can all learn if we choose to. If you have a particular sticking point, I’d be glad to give advice.