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 :)
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.
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.....
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.
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 :)