3 ms·
>Rust is an even more extreme example. You might get extra safety, but at significant development cost. I don't buy this argument. If you want your program to
by carlmr 8y ago
>Rust is an even more extreme example. You might get extra safety, but at significant development cost.
I don't buy this argument. If you want your program to do what you intend you have to know the types anyway. I've never spent significant time on finding the right type, even in Rust.
I have spent significant time on incorrect code, because of functions that accepted inputs with the wrong type and didn't complain, because the wrong type had the same method.
I have spent significant time on looking up what a function can do, because the IDE can't figure out what my parameter is.
I have spent significant time on programs that ran into runtime problems every once in a blue moon that would have been easily detected by a good type system at compile time.
Articles like this just show me that every language that needs to have maintainability for large projects will turn into strongly, statically typed at some point. Whether it's type hints or TypeScript.
- hellofunk 8y agoBut static typing != static typing. There are many different degrees of type safety, some much more strict than others. It is often about more than just "finding the right type," as you say. How much does the compiler require features of a type to be implemented, even if they are not used, in order for it to be a certain type, or just use one featureset of a protocol/trait that it adopts? You can easily write types that eventually require a large amount of boilerplate in some languages to just do something fairly basic that is not as complex as what the compiler asks you to do.