I've been dealing with a program for some hours and I finally solved it :), but I had to draw upon the "goto" sentence. I don't see any other way to modify the program since when it reaches certain condition I have to execute a some code above the current line.
My question is: what do you think about the usage of "goto"? does this exhibits poor programming abilities? Is it recommended to avoid "goto" sentence?
@All: Thanks for your comments! Based on them, I believe "goto" usage depends on the situation. In this case it may apply, but just as @firedraco suggests, it may be better to use recursion. It would be more elegant as well :P
I'm going to try the recursive alternative and I will post it once it works.
I remember working with someone who spent days trying to refactor code to get rid a single goto statement. There was absolutely no benefit to spending effort to refactor all the code, other than perceived aesthetics.
Topic archived. No new replies allowed.
You are using a version without Ads of this website. Please, consider donating: