News for hackers. Stuff that matters.
Re:The Java type system is broken by buremba on Thursday July 19, 2018 @09:49AM (#17566205)
Welcome to the world of enterprise-ready complex applications. I agree that these cases should be covered by the compiler but man, there are mainstream languages that don't implement generics just because they're complex and pretend that they're not helpful.

It 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.

Re:The Java type system is broken by pdpi on Thursday July 19, 2018 @09:59AM (#17566308)
Clearly you didn't reach the conclusion. First, because the conclusion is not "Java sucks", but rather "Most of these things, while not kosher, are unlikely to happen in practice." Second, because the author didn't just leave it at criticising the language — he opened a bunch of bugs in the OpenJDK tracker.
Re:The Java type system is broken by bad_user on Thursday July 19, 2018 @10:05AM (#17566365)
People criticizing constructive criticism are often not constructive.
Re:The Java type system is broken by humanrebar on Thursday July 19, 2018 @10:20AM (#17566510)
> It doesn't help anyone writing "this is broken" not offering any alternatives or suggesting ways to fix the problem.

Clearly stating and detailing problems is absolutely helpful. We can't solve problems if we don't understand them.

Re:The Java type system is broken by coldtea on Thursday July 19, 2018 @10:22AM (#17566524)
>It doesn't help anyone writing "this is broken" not offering any alternatives or suggesting ways to fix the problem.

Actually identifying a problem is of very much help, even without a solution.

For one, it lets people know of the problem, so they can get to an eventual solution.

Second, it lets people know of the problem, and avoid those areas, even if there's no solution available.

Re:The Java type system is broken by nurettin on Thursday July 19, 2018 @10:11AM (#17566410)
C# is a similar language in it's goals and architecture. LINQ to Objects type system will throw an error if you try to return conditionally different types from a lambda expression, so it is doable.
Re:The Java type system is broken by hyperpape on Thursday July 19, 2018 @09:58AM (#17566301)
I think it would've been better to write "unsound" rather than broken, but it's pretty common to present little proofs/results like this without saying how the system should fix it. Doing so is helpful, because many times you'll know there's a problem without there being an obvious fix.
Re:The Java type system is broken by projektir on Thursday July 19, 2018 @12:04PM (#17567589)
> It 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.

Hmm. If I knew your coolant was leaking, but had no idea how to fix it, would you prefer I didn't tell you? Just want to keep driving that car around with that coolant leaking?

At the very least, this is educational and helps better understand Java for those of us who work with it.