Earlier quoted context omitted.
Well, think of it this way. A seat belt cannot help you at all if an object flies through your windshield. Nevertheless, driving while wearing a seat belt is, overall, safer than driving without one.
This is HN, we don't need seat belt analogies. Very strict type systems forbid this class of errors during compilation, others do a best effort and fail at runtime.
The Java type system is broken
51–60 of 168 posts
Re: The Java type system is broken
#52Earlier quoted context omitted.
So a type-system that does the right thing in 99.999999% of the cases is completely useless according to you?
I think the question is rhetorical.
Re: The Java type system is broken
#53Earlier quoted context omitted.
Is it? The whole point of a type system is that it gives you guarantees over your code. Certain bugs should be inexpressible within the language.
Well, think of it this way. A seat belt cannot help you at all if an object flies through your windshield. Nevertheless, driving while wearing a seat belt is, overall, safer than driving without one.
Re: The Java type system is broken
#54Find something that bothers you, complain publicly, do absolutely nothing after that, repeat.
Re: The Java type system is broken
#55The mess that is the current Java type system makes me skeptical when proponents of languages like Go say not to worry, that generics can be added later. If Java had generics in the beginning, it would look a lot different and the type system would be more powerful and safe.
Unlike Java, Go doesn't have to worry about bytecode backwards compatibility. That was the main issue that had them reaching for type erasure. Take a look at C# which added it without many issues (because they were willing to break back compat of their bytecode). Go fits this model a whole lot better.
Re: The Java type system is broken
#56> Everything is broken. Everything is fine. This is the correct conclusion. The people getting outraged over this are the same that will hold long and boring monologues about how everybody does REST wrong.
Required a SOAP message, that contained no XML after the message tag, but instead the entire message body was to be a JSON, and responded with a JSON if something was wrong, and a fully formed SOAP message if things were Ok.
That and the guys that handle your money use the Http status code as their personal error messages. Except when the error is on their end, in which case they return 200 and a JSON with an error message.
There are plenty of ways to do REST wrong, so let's not lump that into the people that make blog posts complaining about X because X is broken, and working just fine...
Re: The Java type system is broken
#57Earlier quoted context omitted.
Is a type system really worth that much if it can't help you in a situation where your code is ugly and hard to follow?
Unequivocally, yes. Several new languages (eg Typescript, Dart) have optional type systems that still bring significant value to the table. Sure - all other things being equal, I'd much rather have a type system that is completely sound. Ceylon's type system is beautiful and I'm happy to see its union + intersection types being adopted by Typescript. But honestly, I'm not going to lose much sleep over these particula…
fyi "Dart’s type system is now sound" and "…types are mandatory".
Re: The Java type system is broken
#58It’s pretty tragic how people respond to such criticism emotionally, instead of acknowledging the issues and working towards fixing them or educating others in the traps and compromises involved. HN is less prone to toxicity, but this is reminiscent of Reddit and it drives away the people that want to help. As a piece of advice, some type theory never harmed anyone ;-)
It's pretty dramatic so it gets met with preemptive defensiveness.
From the end of article: Everything is broken. Everything is fine.
Re: The Java type system is broken
#59Earlier quoted context omitted.
What's the point of strong typing if it only saves you most of the time?
So a type-system that does the right thing in 99.999999% of the cases is completely useless according to you?
Either way, it is hard to reason about factors like that numerically when we've not qualified which kinds of programs we're expecting the type system to actually work for.
Re: The Java type system is broken
#60It’s pretty tragic how people respond to such criticism emotionally, instead of acknowledging the issues and working towards fixing them or educating others in the traps and compromises involved. HN is less prone to toxicity, but this is reminiscent of Reddit and it drives away the people that want to help. As a piece of advice, some type theory never harmed anyone ;-)