From: Leigh Johnston on 24 Apr 2010 11:48 "Daniel T." <daniel_t(a)earthlink.net> wrote in message news:daniel_t-DBCC13.11141024042010(a)70-3-168-216.pools.spcsdns.net... > Ali Karaali <alicpp(a)gmail.com> wrote: > >> I use goto to break nested for loops and I can't see a >> reason to ban goto. > > I'll give you a reason to ban goto. This is a line of BASIC code: > > 90 x = 5 > > Now, I ask you, where is the line that was previously executed? Is it > directly above line 90, is it directly below it, or could it be anywhere > in the program? Because of the goto statement, simply because an > unstructured "goto" is possible in the language, you have to analyze the > entire program to know the answer. If we ban the use of "goto", we can > confidently know exactly what line of code comes before line 90. This channel is about C++ not BASIC, you do not have to analyze the entire program in C++ as goto can only jump within the same function so comparisons with BASIC is silly. /Leigh
From: Kenny McCormack on 24 Apr 2010 11:50 In article <EIOdnQHlmcFTj07WnZ2dnUVZ8h-dnZ2d(a)giganews.com>, Leigh Johnston <leigh(a)i42.co.uk> wrote: .... >This channel is about C++ not BASIC, you do not have to analyze the entire >program in C++ as goto can only jump within the same function so comparisons >with BASIC is silly. (Channelling Kiki) >This channel channel??? >is about C++ not BASIC, you do not have to analyze the entire C++ is not C (so says Kiki every chance he gets) -- > No, I haven't, that's why I'm asking questions. If you won't help me, > why don't you just go find your lost manhood elsewhere. CLC in a nutshell.
From: Leigh Johnston on 24 Apr 2010 11:54 "Kenny McCormack" <gazelle(a)shell.xmission.com> wrote in message news:hqv40l$oh$3(a)news.xmission.com... > In article <EIOdnQHlmcFTj07WnZ2dnUVZ8h-dnZ2d(a)giganews.com>, > Leigh Johnston <leigh(a)i42.co.uk> wrote: > ... >>This channel is about C++ not BASIC, you do not have to analyze the entire >>program in C++ as goto can only jump within the same function so >>comparisons >>with BASIC is silly. > > (Channelling Kiki) > >>This channel > > channel??? > >>is about C++ not BASIC, you do not have to analyze the entire > > C++ is not C (so says Kiki every chance he gets) > > -- >> No, I haven't, that's why I'm asking questions. If you won't help me, >> why don't you just go find your lost manhood elsewhere. > > CLC in a nutshell. > Sorry non-C++ folks I didn't spot the cross-post, I hate it when people do that. At least what I said also applies to C. /Leigh
From: Daniel T. on 24 Apr 2010 12:12 "Leigh Johnston" <leigh(a)i42.co.uk> wrote: > "Daniel T." <daniel_t(a)earthlink.net> wrote: > > Ali Karaali <alicpp(a)gmail.com> wrote: > > > > > I use goto to break nested for loops and I can't see a > > > reason to ban goto. > > > > I'll give you a reason to ban goto. This is a line of BASIC code: > > > > 90 x = 5 > > > > Now, I ask you, where is the line that was previously executed? Is it > > directly above line 90, is it directly below it, or could it be anywhere > > in the program? Because of the goto statement, simply because an > > unstructured "goto" is possible in the language, you have to analyze the > > entire program to know the answer. If we ban the use of "goto", we can > > confidently know exactly what line of code comes before line 90. > > This channel is about C++ not BASIC, you do not have to analyze the entire > program in C++ as goto can only jump within the same function so comparisons > with BASIC is silly. I posted the message to the comp.programming and forgot to restrict the groups. In C and C++, goto is sufficiently restricted that as long as your functions are small, it is largely harmless. In other words: label: x = 5 Where was the line previously executed? In C++ (and C) you don't need to analyze the whole program to find the answer, you need only analyze the function. As long as you keep functions small, the issue is minimized.
From: io_x on 24 Apr 2010 13:48
"Mensanator" ha scritto nel messaggio news:5fd893eb-9dda-4c70-bf56-614b0f721874(a)u34g2000yqu.googlegroups.com... On Apr 24, 5:13 am, "io_x" <a...(a)b.c.invalid> wrote: >> [Xpost to: alt.comp.programming, alt.lang.asm, >> comp.lang.c, comp.lang.c++, comp.programming] >> >> the people that speak not good about "goto" >> are uttled wrong; their code bug full etc >> >> more distant is your code from goto >> more your code is bug full and incompresible >> >> the "goto" is the key word for programming; >> all the remain, other than goto or jmp or jc or jz, >> and the easy cpu layout >> is the wrong way for programming >> >> i advise all you >> Good Morning >Yeah, there's nothing more fun than converting BASIC to Pascal. > >Only to discover that goto was used to return from a sub-routine >without clearing the stack. all programming is all about choose the right gotos and how to write them in the page. point, end of programming difficulies, there is nothing to say |