Exactly.
It's okay when you use it for debugging and such and remove it later, but I personally think it's a bad programming practice because it's easy to get thrown off when you have thousands of lines of code, especially if one small break is an important component of your code. Same with continue. It's really a personal opinion kind of thing, though.
First off, I want to say that if you prefer not to use break and continue statements, there's nothing wrong with that, but for any new programmers coming on the scene, I want to make sure that it's understood that the use of the break and continue statements are idiomatic in the majority of languages which support iterative looping. This includes C, C++, C#, Java, Python, and many others. When I say that it's idomatic, I mean that it's widely accepted by programmers, and the designers of the language, as a control-flow tool which is appropriate to use. It's not considered a bad programming practice to use them, and in many situations, it's necessary.
Take for example, a switch statement in C++, how would you use one effectively without a break statement?
Take this example as well which includes a short-circuit return, acting similarly to a break statement:
Code:
bool contains(int* myPntr, int size, int target){
for(int i = 0; i < size; i++){
if(myPntr[i] == target){
return true; //If you had to do something else before returning, you could actually just break out here.
}
}
return false;
}
Also, consider the following for continue situation:
Code:
int someFunc(bool a, bool b){
int i = 0; //Doing work on this.
int c = 0; //Counter.
while(c < 50){
c++;
i+=1;
if(a) continue;
i += 2;
if(b) continue;
i += 3;
}
return i;
}
I realize that's a pretty contrived example, sorry, I'm kind of tired and couldn't think of anything off the top of my head. That said, there are times when you need to do one thing first, then if I certain condition is true, ignore the rest (using continue), but if the condition isn't true, you can carry on and do the rest. It's like a conditional fall-through. Sometimes you're going to need the second part of that while loop, sometimes you're not. Rather than writing a redundant piece of code, you can just conditionally use continue.
Like I said, if you don't want to use it, that's cool. It totally depends on what you're doing, and yeah, you can get around the use of break in most cases, but sometimes it leads to really complicated conditions in while loops, and sometimes it can detract from readability for that reason. I rarely use continue, I'll be honest, I have used it, but it's rare. I do often use break though, and I don't think it makes my code any harder to follow. I usually don't have massively long loops with a huge number of break statements, but it's not uncommon to see a while(true) loop in my code with a couple of breaks thrown in, depending on the application. I really don't think it detracts from readability, since breaks are only one way, right? They break out of the function downwards. It's not like a goto statement (although, in C++ I think it is actually a wrapper for goto, but it's obviously restricted to jumping out of the loop), which can literally go pretty much anywhere. You see a break, you know it's breaking out of the loop. Keep in mind, this is just my opinion.
I just wanted to be clear that using break and continue is not considered bad programming practice paradigmatically, and is in fact idiomatic, in most languages which support the statements.
-------------------------------------
As far as quirky stuff I do while coding, probably having conversations with other developers through comments. At the company I'm working for now, we're notorious for having conversations, discussions, and occasionally arguments at the top of our code files. We always clean it up though. :)