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

The same could be said about C++. C is a weakly typed language and was designed to be so, so it's type system cannot really be said to be 'bad'.


Yes, good point. But a lot of people cite C as "the" strongly and statically typed language, and that's just wrong. ("But omg, you have to say 'int i' instead of 'var i'. Clearly this is strong typing!")


C has no types, as a quick (int*)&var will show.


Unfortunately, this is not true in the case of type punning. C used to be the language you used when you wanted to access bits. Now with C99 you cannot * (int16* )((int32* )x).

NB, all compilers make exceptions for unions, but the type punning rule stands, and at work we've actually seen code like the above (for a dynamic typing system) compile to NULL instead of the appropriate reference with GCC. Grrrrrrr.


Being able to subvert the type system is different than having no type system.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: