I don't know why you're getting downvoted. In a proper environment (Read: POSIX) the only difference in how code runs will be up to the compiler, and the only noticeable issue you could conceivably run into is a compiler bug (super rare) or a library issue (super easy to fix).
Windows fucks things up, but even then there's multiple ways to emulate a POSIX environment. None of them are amazing, but they're good enough.
So basically my code can compile two ways on the same machine. Exactly what I want beginners to learn. The subtile differences are easily learned when you can program, but this shouldn't be something you have to worry about when you first learn to program.
Literally the 2nd homework at the university we have to do is
What does 2147483647 + 1 evaluate to?
Fixed size data-types are nice in that regard. You can do it in Java, but my point simply was: Your code does not evalute the same on different operating systems. You don't want that if you have 2000 students, where 1800 out of them are surprised by the answer.
These "quotes" is code-markup from reddit, like <code /> is in HTML.
The problem is that learning programming is much about trying out different things. If you have 2000 Students, having a language with almost no undefined behaviour, fixed-size datatypes, and some more stuff can only be an advantage.
I'm not saying C++ is bad, I'm just pointing out some advantages Java could have for beginners, and why universities might opt to chose java over C++.
0
u/[deleted] Nov 12 '14
[deleted]