3 ms·
Signed/unsigned conversions and conversion to/from pointers of functions and arrays cause real, production-code confusion. In terms of how much mental overhead
by lmm 13y ago
Signed/unsigned conversions and conversion to/from pointers of functions and arrays cause real, production-code confusion. In terms of how much mental overhead the language takes up - how many edge cases you have to keep in mind to read code in the language (because if you're programming right then you spend more time reading than writing) - no, it's not simpler than Java, because classes, generics and memory language are more straightforward and less confusing than C's typing rules.
Languages have a complexity budget, and C blew its on a squillion different kinds of integer and a bunch of arbitrary-seeming rules to minimize the amount of typing needed to change between them. That was a good tradeoff in its day, where hand-optimization was practical and program source needed to be small. It's not an appropriate language to use now outside of very specific circumstances.
- dvt 13y agoYou say this as if Java doesn't have its fair share of oddities. It seems you're saying that the highly granular typing found in C doesn't have an equally-annoying analogue in Java; it does[1]. [1] http://www.javalobby.org/java/forums/m92125315.html http://www.javalobby.org/java/forums/m92125315.html
- lmm 13y agoThat's not a corner case, it's a particular instance of a general Java misfeature. In Java, "==" is an abomination that you must never use and will give essentially random results; "equals" is what you use to compare things for equality, and this is consistent throughout your codebase. Is it annoying? Yes. But it's easy to remember because it applies everywhere; any case of "==" in a java source file sticks out like a sore thumb. (Also any use of an array, anywhere, for anything. Sometimes I think I should write "Java: the good parts").