+ 2

Why programmers donot use 'Goto' command?

I liked use 'Goto', but they said to me that it is unprofessional and I should not use it. Only in C is 'Goto' corect, why?

26th Jul 2017, 6:47 AM
Adéla Krylová
Adéla Krylová - avatar
2 Réponses
+ 9
There is a number of reasons why 'goto' became a taboo in programming. That said, we shouldn't refrain from learning how to use it. There are situations where goto can and should be used for elegant solutions. https://www.quora.com/Why-is-the-goto-statement-in-C-advised-to-avoid
26th Jul 2017, 6:53 AM
Hatsy Rei
Hatsy Rei - avatar
+ 3
goto along with if statement can be an alternative to loops. We generally don't use it because we are not habitual to do so.
26th Jul 2017, 6:57 AM
Lakshay
Lakshay - avatar