Click here to Skip to main content
15,351,641 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
AnswerRe: goto... Who uses it? Pin
Member 46088981-Mar-13 21:27
MemberMember 46088981-Mar-13 21:27 
AnswerRe: goto... Who uses it? Pin
YvesDaoust3-Mar-13 21:31
MemberYvesDaoust3-Mar-13 21:31 
GeneralRe: goto... Who uses it? Pin
Fred Flams3-Mar-13 21:54
MemberFred Flams3-Mar-13 21:54 
AnswerRe: goto... Who uses it? Pin
Tieske83-Mar-13 22:08
professionalTieske83-Mar-13 22:08 
AnswerRe: goto... Who uses it? Pin
Super Lloyd3-Mar-13 22:43
MemberSuper Lloyd3-Mar-13 22:43 
GeneralRe: goto... Who uses it? Pin
Al Chak4-Mar-13 4:44
MemberAl Chak4-Mar-13 4:44 
AnswerRe: goto... Who uses it? Pin
Rob Grainger3-Mar-13 23:20
MemberRob Grainger3-Mar-13 23:20 
AnswerRe: rarely but sometimes it's the solution [example inside] Pin
Jcmorin4-Mar-13 1:46
MemberJcmorin4-Mar-13 1:46 
The goto is not required, you can always skip around with variable but sometime it's the best solution.

In this example the goto is a clear simple example, remove it and you introduce less readable and more complexity.
C#
function BigFunction() {
  for (int i =0; i < 100; i++) {
    while(true) {
      if (...) {
        goto DO_SOMETHING_AT_THE_END;
      } 
    }
  } 

 
  DO_SOMETHING_AT_THE_END:

  DoSomething();
}

GeneralRe: rarely but sometimes it's the solution [example inside] Pin
tom14434-Mar-13 2:37
Membertom14434-Mar-13 2:37 
GeneralRe: rarely but sometimes it's the solution [example inside] Pin
Joe Woodbury4-Mar-13 4:13
professionalJoe Woodbury4-Mar-13 4:13 
GeneralRe: rarely but sometimes it's the solution [example inside] Pin
Jcmorin4-Jun-13 5:47
MemberJcmorin4-Jun-13 5:47 
AnswerRe: goto... Who uses it? Pin
César de Souza4-Mar-13 2:05
professionalCésar de Souza4-Mar-13 2:05 
AnswerRe: goto... Who uses it? Pin
Gary Huck4-Mar-13 2:29
MemberGary Huck4-Mar-13 2:29 
GeneralRe: goto... Who uses it? Pin
tom14434-Mar-13 2:40
Membertom14434-Mar-13 2:40 
GeneralRe: goto... Who uses it? Pin
Gary Huck4-Mar-13 2:41
MemberGary Huck4-Mar-13 2:41 
GeneralRe: goto... Who uses it? Pin
Joe Woodbury4-Mar-13 4:14
professionalJoe Woodbury4-Mar-13 4:14 
GeneralRe: goto... Who uses it? Pin
tom14434-Mar-13 4:29
Membertom14434-Mar-13 4:29 
GeneralRe: goto... Who uses it? Pin
Jcmorin4-Mar-13 3:03
MemberJcmorin4-Mar-13 3:03 
GeneralRe: goto... Who uses it? Pin
Climate Turnip5-Mar-13 8:04
MemberClimate Turnip5-Mar-13 8:04 
AnswerRe: goto... Who uses it? Pin
NAANsoft4-Mar-13 3:17
MemberNAANsoft4-Mar-13 3:17 
AnswerGOTO - a useful tool in the right hands Pin
Chris Boss4-Mar-13 3:19
professionalChris Boss4-Mar-13 3:19 
AnswerRe: goto... Who uses it? Pin
CDMTJX4-Mar-13 3:30
MemberCDMTJX4-Mar-13 3:30 
GeneralRe: goto... Who uses it? Pin
TNCaver4-Mar-13 4:05
MemberTNCaver4-Mar-13 4:05 
AnswerRe: goto... Who uses it? Pin
Al Chak4-Mar-13 4:28
MemberAl Chak4-Mar-13 4:28 
AnswerRe: goto... Who uses it? Pin
Cj Welborn4-Mar-13 4:44
MemberCj Welborn4-Mar-13 4:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

What language are you using for AI development or learning?
Whether you're at work or home, hard core coding or just trying to figure out this AI thing, which languages have you used in your adventures?
  Results   369 votes