Thread: Recursion?
View Single Post
  #18   Spotlight this post!  
Unread 14-12-2003, 15:36
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Recursion?

Quote:
Originally Posted by Anthony Kesich
As far as i know, there has only been one situation found where go must be used to get the desired effect, i.e. break, continue, or loops will not work, and that was discovered by some fulltime programmer who was dedicating his time to finding it.
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}
Quote:
Recursion is a bad pracice on any platform and should be avoided.
Quote:
Goto is a useless command.
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?

I hope that this post doesn't offend anyone, and if it does I apologize. I am really impressed at the level and intelligence of discussion that occurs on this board. I'm just concerned that the level of misleading information around here seems to be on the rise. 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}