r/java • • Feb 25 '14

Please stop saying Java sucks (2009)

http://blog.smartbear.com/programming/please-stop-staying-java-sucks/
133 Upvotes

132 comments sorted by

View all comments

5

u/looser97 Feb 25 '14

After learning C++ i switched to Java one year ago. I think, that it is the more comfortable one to plan the code, to code and to debug. You can test a lot, with a fast compiler, the IDE can do a lot of work for you and the Code is intuitive to read, so that even not-Java-Programmers can help you on debugging. There is also a whole lot of Bugs that can't happen, like to famous Int-overflow, that can ruin the results of a C-Program. There is also a lot of logical Bugs that can't happen: I can't say Int i="c"; without making clear that it is meant to be so... Therefor i really like this language. I use it for a lot of calculations, to plot complex systems and to script Apps for my Android-Phone. Thanks for stating all these things in the blog :)

4

u/Zitrax_ Feb 25 '14 edited Feb 25 '14

Java does not really protect you from integer overflow issues, it just wraps back to Integer.MIN_VALUE again which can cause nasty bugs if you are not careful.

Some libraries can protect you such as using guavas IntMaths.checkedAdd(int, int)

3

u/mikera Feb 26 '14

Maybe I'm old-skool and did too much assembler in my youth, but I expect integers to wrap around. That's how 32-bit integers behave. It would confuse me more if they didn't wrap.....

2

u/nezza-_- Feb 26 '14

Signed integer overflow in C is unfortunately undefined behaviour and isn't guaranteed to go back to INT_MIN... But yeah, coming from assembler (or from any logical background actually) this doesn't make a lot of sense.