I have heard that the use of...
goto label
...is not recomended? Why is that?
I have heard that the use of...
goto label
...is not recomended? Why is that?
You cantīt teach an old dog new tricks.
I heard that too. The main reason for not using goto: it can lead to bad maintanble code.I have heard that the use of...
goto label
...is not recomended?
So it has nothing to do with technical reasons then?Originally posted by Shiro
I heard that too. The main reason for not using goto: it can lead to bad maintanble code.
You cantīt teach an old dog new tricks.
No. In fact, all other loops are buildt upon simple goto:s. The reason to avoid goto is that unreadable (unfollowable) spaghetti code is so easily made with it.Originally posted by electrolove
So it has nothing to do with technical reasons then?
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Magos is right, in some situations, local jumps are in fact a faster alternative. But, he's right. When your code is filled to the rim with goto's, you know what happens? People start scrolling up...and scrolling down...and scrolling over just to read your code. Then people start complaining, calling lawyers, holding their breath, leaving the toilet seat up..and it's a mess.
Not using goto's, and planning out your code, usually leads to an elegant piece of nicely flowing art.
Maybe you can find something interesting here:
http://www.google.com/search?hl=en&l...=Google+Search
The world is waiting. I must leave you now.
I don't recommend labels (goto) because it makes your code dirty and more difficult to maintence.
My opinion is that you should only use goto if it makes the code easier to read. This is VERY RARE , the only time i would even consider using it is to escape a deeply nested structure if rewriting it without gotos would be more confusing.
Personally, i've been writing code for a while and I have never had to use a goto.
And you never have to. It's only ment to speed things up andOriginally posted by beege31337
i've been writing code for a while and I have never had to use a goto.
for easier reading. But don't use it exessively.
My old computing teacher told me that if I ever used goto in my code I would be arrested. Same goes for dividing by zero. Care to test the theory?
Originally posted by SMurf
My old computing teacher told me that if I ever used goto in my code I would be arrested. Same goes for dividing by zero. Care to test the theory?
Let's lock up carmack then shall we?
This has been discussed many times before... please do a search if you want to know more.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]