There was a little boy named Charlie. For his 10th birthday, his dad gave a computer. Charlie was quite curious. He wanted to know how programs worked. He learned BASIC and became pretty good at it. Before he knew it he was programing in C++ making ENTERPRISE QUALITY CODE for a bank in Utah at 23! He made a complex but easy to use banking program for all the computers. While developing his software, he thought it would be funny to make a little secret, or an 'easter egg' as some call it. It would be a simple BASIC interputer since thats what he learn first, But there was a minor glitch. Any unrecognized keyword be call a random function. He built a simple basic program that would run when ever the secret was accessed:
10 INPYT"Whats you name?";N$
20 IF N$="" THEN GOTO 10
30 PRINT NAME
40 END
he made a typo...
Years later, a employee as working late at the bank. He uncovered this easter egg antecedently. All of a sudden, the screen goes black. Text scrolls fast, whizzing by, randomly transfuring money, sending money, making money, all over the world. No one knows whats going on, stocks go down, everyone goes poor. People die. Wars around the earth, unfold... Nukes whizzing through the air. Mushroom clouds everywhere. The human race is wiped out...
ALL BECAUSE OF GOTO
Name:
Anonymous2007-09-08 1:58 ID:Ggq4sgK0
It is as they say. goto considered harmful
Name:
Anonymous2007-09-08 2:07 ID:Ud2bT/6j
>>1
More proof that only idiots too stupid to use it avoid goto.
>>11
Because it makes your code difficult to read, and kinda unpredictable
Name:
Anonymous2007-09-11 13:59 ID:1MrQ0ACP
>>11
Because it fucks up your execution model. You only want to use selection and loop constructs in imperative languages, for readability and traceability.
break, continue, multiple returns etcetera are equally harmful.