Its not good coding if you use goto but why in my project i used goto plenty of times it has only made my program easier to code and uses fewer lines of code than conventional method

Using goto goes against the idea of structured programming.

Wikipedia wrote:
Structured programming is a programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops—in contrast to using simple tests and jumps such as the goto statement which could lead to "spaghetti code" which is both difficult to follow and to maintain.

If goto helps you improve your code, by making it easier to read and understand, then use it.
However, in general, your code will probably be less elegant than that of a programmer who doesn't use goto.
Mostly, when goto is used, the code can be re-written with structured concepts such as a while loop. When that is done, and with proper indentation, the structure of the program becomes clearly visible and the code may be easier to read - at least for someone familiar with that style.

On a purely technical level, there's nothing to stop goto from being used in a structured way. But to do so requires a disciplined approach to coding, and there are no constraints to guarantee that the intended methodology will be followed. For example the initial design and coding may be clear and well-structured, but later modification can break the structures very easily.
Thank you :)
Topic archived. No new replies allowed.