D - Legacy coding style (wasRe: On compiler warnings...)
- Ant (14/33) Dec 01 2003 I never use goto, continue or break (except on switch)
- Vathix (8/44) Dec 01 2003 I use goto all the time and I'd be pretty disappointed if I couldn't use...
- Charles Sanders (7/61) Dec 01 2003 Yea i noticed alot of gotos in ini.d ;) ( Very cool module btw!)
- Ant (5/11) Dec 01 2003 Browsing through your the ini I understand what you mean.
In article <bqfiuc$vsf$1 digitaldaemon.com>, Berin Loritsch says...Walter wrote:int foo() { while (1) { .... return ...; } }There are a couple things I really don't like about that code anyway.>int foo() { while(true) { ..... break; } return ...; }I never use goto, continue or break (except on switch) and I try to have only one exit point on the functions, at the end (sometimes I get lazy). "goto", "continue" and "break" should be removed from the language. break on switch should be implicit and case should handle multiple values "case 1,2,1024,8:" but, of course, that can't be done... :( I thought we had goto, continue and break just to support conversions from older languages but I've seen it used on new code! I'm very desapointed... <joke> the D compiler should also limite the number of lines in a function/method, let's say 50</joke> Ant
Dec 01 2003
"Ant" <Ant_member pathlink.com> wrote in message news:bqfqe6$1c7d$1 digitaldaemon.com...In article <bqfiuc$vsf$1 digitaldaemon.com>, Berin Loritsch says...I use goto all the time and I'd be pretty disappointed if I couldn't use it anymore. goto is just easier in my opinion. You can directly do what you want without having to rethink a loop or indent a ton of code for a new if statement. I don't recall having goto be a problem for me; but I usually code alone. People say they hate goto; well, I hate goto haters :) just kidding.Walter wrote:int foo() { while (1) { .... return ...; } }There are a couple things I really don't like about that code anyway.>int foo() { while(true) { ..... break; } return ...; }I never use goto, continue or break (except on switch) and I try to have only one exit point on the functions, at the end (sometimes I get lazy). "goto", "continue" and "break" should be removed from the language. break on switch should be implicit and case should handle multiple values "case 1,2,1024,8:" but, of course, that can't be done... :( I thought we had goto, continue and break just to support conversions from older languages but I've seen it used on new code! I'm very desapointed... <joke> the D compiler should also limite the number of lines in a function/method, let's say 50</joke> Ant
Dec 01 2003
Yea i noticed alot of gotos in ini.d ;) ( Very cool module btw!) I think goto is a good tool to use when appropriate, i think goto got alot of flack from languages like basic where all of the flow is based on gotos! C "Vathix" <vathix dprogramming.com> wrote in message news:bqg9kr$23ih$1 digitaldaemon.com..."Ant" <Ant_member pathlink.com> wrote in message news:bqfqe6$1c7d$1 digitaldaemon.com...itIn article <bqfiuc$vsf$1 digitaldaemon.com>, Berin Loritsch says...I use goto all the time and I'd be pretty disappointed if I couldn't useWalter wrote:int foo() { while (1) { .... return ...; } }There are a couple things I really don't like about that code anyway.>int foo() { while(true) { ..... break; } return ...; }I never use goto, continue or break (except on switch) and I try to have only one exit point on the functions, at the end (sometimes I get lazy). "goto", "continue" and "break" should be removed from the language. break on switch should be implicit and case should handle multiple values "case 1,2,1024,8:" but, of course, that can't be done... :( I thought we had goto, continue and break just to support conversions from older languages but I've seen it used on new code! I'm very desapointed... <joke> the D compiler should also limite the number of lines in a function/method, let's say 50</joke> Antanymore. goto is just easier in my opinion. You can directly do what you want without having to rethink a loop or indent a ton of code for a new if statement. I don't recall having goto be a problem for me; but I usually code alone. People say they hate goto; well, I hate goto haters :) just kidding.
Dec 01 2003
I use goto all the time and I'd be pretty disappointed if I couldn't use it anymore. goto is just easier in my opinion. You can directly do what you want without having to rethink a loop or indent a ton of code for a new if statement. I don't recall having goto be a problem for me; but I usually code alone. People say they hate goto; well, I hate goto haters :) just kidding.Browsing through your the ini I understand what you mean. We just think differently, no I don't mean we have different oppinions, I mean: our thought process is really different. Hey, friends all the same! Ant
Dec 01 2003