4 ms·
> Type erasure is still type checked though In the C example ? What do you mean ?
by alcover 2y ago
> Type erasure is still type checked though
In the C example ? What do you mean ?
- to11mtm 2y agoIf I had to guess, they were moreso referring to the java examples... The article states "The biggest issue is the same one Java had before version 5, there’s no type safety"... But that's a weird way to put it... Java 5 was when generics were actually introduced... so comparing a C hack for generics to Java pre V5... is just... weird.
- sirwhinesalot 2y agoHi author here, I don't understand your comment. Why is it weird? It's the same issue, only difference is in java (pre-5) you'll get a runtime exception somewhere while in C you'll get memory corruption, but it's the same cause, an "any" type. Modern Java has generics so it'll check at compile time that you use the types correctly.
- to11mtm 2y ago> only difference is in java (pre-5) you'll get a runtime exception somewhere while in C you'll get memory corruption, but it's the same cause, an "any" type. I would think that a runtime exception vs memory corruption is a big difference in relative type safety.... But overall I was just trying to explain to folks in thread how things were parsed....