Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Static typing can guarantee that if you design your static typing system to allow it. Take a look at Rust's NonZero types for example.

Languages with dependent types can do even more. Of course that is much more complicated and at some point you can only check the type at runtime.

But the idea that static type checking is worse than runtime type checking because it can't do all the checks is idiotic. You're throwing out the static benefits for no reason.

You should use static types as much as possible, and runtime checking where that isn't enough.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: