Hacker News new | past | comments | ask | show | jobs | submit login

How about replacing certain compile time type checks with smoke tests and runtime assertions, or unit tests?



Why do what the compiler can do for me?


Because you like other features of the language and you just want to get on with it.


Others just switch to a proper language instead.


Inserting the assertions by hand is annoying and error prone - even if you want the assertions to be checked at runtime its still very helpful if the programming language inserts the type checking automatically for you.

Another thing is that assertions can only check primitive type. To check if a function pointer or object respects an interface you need to add an extra wrapper around it to check all its return values (and this is so annoying to do by hand that noone bothers to do it)




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

Search: