Thanks for clearing this up, I'll talk to my AP Computer teacher about this.
What I said only really applies to TorqueScript, when it comes to things like C++ and other languages like that, the compiler is (in most cases) actually really good at optimizing that kind of stuff, and the code snippet
if(x > 0)
if(y < 0)
return 5;
might produce the exact same machine code as
if(x > 0 && y < 0)
return 5;
so I'm really not sure how much it applies to other languages.