Re:The Java type system is broken
by ilikehurdles on Thursday July 19, 2018 @10:59AM
(#17566888)
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.
[ Parent
| on HN ]
Re:The Java type system is broken
by emodendroket on Thursday July 19, 2018 @11:11AM
(#17567034)
Whoever you are, analogies can help clarify your thinking. A type system that prevents some errors is not without value just because it cannot catch others. If the uncaught types of errors are rare and the type system that would solve them somehow burdensome it may even be a reasonable compromise to accept these faults.
Re:The Java type system is broken
by ilikehurdles on Thursday July 19, 2018 @12:57PM
(#17568222)
Of course. At this point I'm not sure what this has to do with the code snippet mentioned upthread or the response to it. Your analogy didn't really convey why you'd think java allowing "String s = gridWrapper.get(0).get(0).get(0);" is a good vs bad thing, it just tells me that types don't protect you from everything, I think. I didn't find that the analogy added anything valuable and instead kind of simplified a problem that didn't need simplifying. The topic isn't whether type systems are valuable, but whether the positive value of java's outweighs the harmful logic it allows the developer to write.
A language like rust can prevent writing code like that, and thus prevent that sort of error, while a language like javascript is even more lax. Both have their tradeoffs wrt productivity and performance.
Re:The Java type system is broken
by emodendroket on Thursday July 19, 2018 @01:12PM
(#17568409)
I was replying to someone implying that the type system was useless because it was not ironclad.