Quote (carteblanche @ Mar 28 2016 03:22pm)
I haven't heard that before. Is that just a c++ thing? It's good practice in the other languages in familiar with
After googling around and seeing what the gurus of stack overflow had to say (lmao), it seems that breaks aren't a bad practice like I was taught. The issue that my professors always had with it is that it is easy to lose track of the purpose of breaks in multiple nested loops. When you start putting breaks and gotos everywhere, you're obstructing the flow of logic making it unreadable. So, I guess they're good and bad on a case by case basis. If they're used in a concise way, they're fine. I guess my professors just spoke too much in absolutes. They probably just wanted to avoid reading spaghetti code

Also, they probably spoke in absolutes in order to force us to learn the concepts behind different loops. Otherwise, we'd have some assembly-type c++ code that is terrible to read. To avoid using breaks, I've always used something like
Code
While(x){
if(condition is true)
x = false
}
But, the system pause thing is something I was always taught too. Sigh... guess I gotta go find out if that is nonsense too.
edit: It seems that system pause is generally frowned upon as it is platform specific and generally an insecure way of allowing you to read your ouput. Consider using a breakpoint and then debug from there. In case anyone reads this and was wondering, I'll save you the google.
This post was edited by PureOwnage2 on Mar 28 2016 02:55pm