Comment by KerrAvon

Comment by KerrAvon 13 hours ago

1 reply

But that’s where TFA breaks down: the whole point of this is to claim “hey, C does too have typesafety” —if you use a modern language with actual typesafety, you can just make the underlying representation accessible (probably read-only) and you don’t need a reverse conversion step. You can have type safety, efficiency, and ease of use. Just rip the band-aid off and move to Rust or Swift already.

lelanthran 3 hours ago

> the whole point of this is to claim “hey, C does too have typesafety” —if you use a modern language with actual typesafety,

I'm afraid the point was not some childish and immature comparison of C with modern languages.

The point was to demonstrate what type safety there is, and how to use it. The advantages of modern languages are even acknowledged:

> Much to the surprise of, well, everybody, C actually has type safety. Sure, it isn’t as enforceable as (for example) Rust… and, sure, if you are willing to do extra work you can bypass it,

The entire point of TFA is actually in TFA:

> The problem isn’t that C lacks type safety (it clearly enforces most types in most expressions), it’s that raw pointers do not encode semantics (e.g., a char * doesn’t tell you if it’s an email, a name, or a filename).