goto function!

0 Sha Kal · August 7, 2015
Why do people hate goto function so much, i find it useful in many cases...

ex. if you ask user to type Yes or No, you can check if he type anything different and just put him above the same question with goto if he did  type something else..again you can do same thing on many different ways...but every time i did it with goto function some1 was there to complain, and telling me i should avoid it whenever i can, tho none told me why even if i asked haha. 

We have been taught in school, univ..etc...we should avoid it when its used in ex. loops because once it exists it stop the loop as it is, unfinished and so on, its hard to keep the track of the code when you aren't using goto carefully and i understand that.

But people keep complaining even if its used for such simple stuff and they have no idea why they shouldn't use it.

Post a Reply

Replies

Oldest  Newest  Rating
0 c student · August 8, 2015
no one's complaining and no one can stop you from using it.  it's just advice for good programming practice.

http://stackoverflow.com/questions/46586/goto-still-considered-harmful

https://en.wikipedia.org/wiki/Spaghetti_code
0 Sha Kal · August 8, 2015
no one here, but i i did show some codes to other ppl :D Btw thx for material, im going to read is as soon as i can :)
  • 1

C

107,049 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator