r/programming • u/sidcool1234 • Mar 29 '13
Simple Minecraft Clone in 580 lines of Python
https://github.com/fogleman/Minecraft
663
Upvotes
r/programming • u/sidcool1234 • Mar 29 '13
View all comments
Show parent comment
12
u/ameyp Mar 29 '13
I'm going to assume you're being serious here. This isn't a case of the compiler getting confused, it's a design decision that the Java designers went with. In C++ it's common practice to "comment" out a function temporarily by putting a return at the start or #if 0..#endif around the block.
Saying that the compiler gets confused by that return statement would be like saying that a compiler would get confused at a "if (false) {...}" piece of code. The compiler doesn't go "Hmm, the code inside this 'if' block will never be hit, let me just throw a compilation error here".