Quote:
|
Originally Posted by Dave Flowerday
Break and continue are simply a goto command in disguise. Break and continue should be avoided for the same reasons that goto should. The reason that software engineers really hate goto (and break and continue for that matter) is that it generally makes code harder to read. However, there are times where a well-placed goto can simplify code and make it easier to understand than it would be if you had to wrap it in a bunch of if() or for() statements.
{soapbox}
I work full time as an embedded software engineer, and I still wouldn't feel comfortable making statements like these. While I agree that gotos and recursion are generally a bad practice, I know that there's a nearly infinite amount of software engineering situations that I haven't encountered yet, and one or both of these methods may be the best solution in that situation. I'm very encouraged to see so many young people on this board taking such an interest in engineering (and software engineering in particular), and the amount that you all know about these fields already is amazing. However, do you really feel that you guys have enough experience to back these statements up?
There's a lot of teams that are going to go through a bit of a software engineering trial-by-fire this year with the C based controller, and I just don't want to see the situation made worse by providing them with bad information when they come here for help.
{/soapbox}
|
And thats why i retracted my previous statement. I try to speak only when i know know what i'm talking about, but please point it out if I or anyone else say something incorrect.