i want to make switch contain value for example
if was 12.56>x>4.68 goto function mystring
& switch code not suitable for float
& not suitable using " for " also
It's not that using goto causes problems. It's abusing it that does. It tend to create what is known as spaghetti code, which is hard to read and debug.
However, and despite what many programmers may say, not using it when it would clearly give an advantage is not a good thing, either. Currently, the only place where using goto is not frowned upon is when breaking from inside nested loops, and even then care should be taken. If used correctly, goto can actually simplify code and increase its readability. If used incorrectly, however...
So, goto is considered harmful, but without merit.
You didn't read Dijkstras artikle, did you? He stated:
"Since a number of years I am familiar with the observation that the quality of programmers is a decreasing function of the density of go to statements in the programs they produce"
So your "without merit" statement really is a persomal opinion, and although you stated that, it is somewhat strange to read it in the exact wording this article has coined.
See http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF
... please please re-read both articles. You'll learn that (1) Dijkstra didn't hate GOTO, and (2) Knuth didn't disagree with Dijkstra.
--by Duoas
I find it amazing how often these two articles are quoted to support assertations at odds with their content. That amazement is actually the point of Knuth's article about Dijkstra's.
The problem with attacking the tool instead of the tooler is that the underlying problem is blissfully forgotten and remains undiagnosed by multitudes of programmers in their programming practices.
I didn't bother. And I wasn't referring to what Dijkstra said. I was quoting the title of his article to refer to the impression many programmers have of goto.
I agree with Duoas. Don't blame the hammer hammering the screw. Blame the idiot trying to nail a screw.