The Java type system is broken
wouter.coekaerts.be
The Java type system is broken
1–10 of 168 posts
Re: The Java type system is broken
#2Re: The Java type system is broken
#3Not broken. Working as intended.
Re: The Java type system is broken
#4Java is not perfect, but this looks to me like a broken code indeed ".get(0).get(0).get(0)".
Could we rephrase the message of the article as "If you write really broken code in Java, you might be not guarded by the type system". And this is, well, uhm, well... acceptable?
Re: The Java type system is broken
#5https://raw.githubusercontent.com/namin/unsound/master/doc/u...
Re: The Java type system is broken
#6Re: The Java type system is broken
#7From the examples: "String s = gridWrapper.get(0).get(0).get(0);" - Java type system is broken! Java is not perfect, but this looks to me like a broken code indeed ".get(0).get(0).get(0)". Could we rephrase the message of the article as "If you write really broken code in Java, you might be not guarded by the type system". And this is, well, uhm, well... acceptable?
Re: The Java type system is broken
#8Re: The Java type system is broken
#9My favourite feature of Java's type system is that, because any object type also accepts null, the type system is unsound and you can convert anything to anything else: https://raw.githubusercontent.com/namin/unsound/master/doc/u...
If I can serialize to String, and then deserialize a String to any type of class, I can effectively "cast" anything to anything.
Re: The Java type system is broken
#10It would be nice of you to compare Java generics with equivalents instead of just criticizing it. It doesn't help anyone writing "this is broken" not offering any alternatives or suggesting ways to fix the problem.