Click here to Skip to main content
15,909,747 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.

 
GeneralRe: goto statement Pin
vl211-Nov-13 7:49
vl211-Nov-13 7:49 
GeneralRe: goto statement Pin
jaybus5610-Nov-13 22:11
jaybus5610-Nov-13 22:11 
GeneralRe: goto statement Pin
Stefan_Lang10-Nov-13 23:13
Stefan_Lang10-Nov-13 23:13 
GeneralRe: goto statement Pin
vl211-Nov-13 7:46
vl211-Nov-13 7:46 
GeneralRe: goto statement Pin
Stefan_Lang11-Nov-13 20:30
Stefan_Lang11-Nov-13 20:30 
GeneralRe: goto statement Pin
vl212-Nov-13 0:44
vl212-Nov-13 0:44 
GeneralRe: goto statement Pin
jschell12-Nov-13 9:56
jschell12-Nov-13 9:56 
GeneralRe: goto statement Pin
Stefan_Lang12-Nov-13 21:19
Stefan_Lang12-Nov-13 21:19 
jschell wrote:
Nor can I refactor millions of lines of code every two weeks every time I figure out a "better" way to do it.

Agreed, The code I'm working on has quite a few gotos, but I don't have the time to dig through the code and lack the test cases to do a secure refactoring, so they'll remain right there, unless I find the code is broken.
jschell wrote:
And technology rationalizations are often based on nothing but technology while ignoring the realities of delivering software in a business environment.


Absolutely, the points I've made refer to creating new code, not modifiying existing one to either insert or remove gotos. My point is that you shouldn't use goto in new code, or insert it into existing code where there is no gto yet. I claim that if you see no good or at least equivalent alternative using other language constructs, then maybe you haven't looked hard enough.

I willing to concede that there may be cases where there is a real benefit if using goto over any alternative, but I can't think of an example in C++, as long as you're using a decent compiler with a good optimizer that will translate alternate control statements into gotos anyway.


jschell wrote:
That would of course be an excellent argument if in fact none of the following was true.

- Maintenance was the sole and only driving business requirement.

- The business had a firm enough grasp on process control to be able to quantify maintenance costs.

- The process control was structured enough ...

Maintenance doesn't need to be sole requirement and of course never is. But ignoring it would be a falacity, unless your application is supposed to be throw-away code that shouldn't be maintained (and I already said that for that kind of code all bets are off - there's no point in discussing coding guidelines at all

A business not able to quantify and control maintenance cost will soon be out of business, specifically in software development). There's a reason why there are SCRUM, XP, Agile, (R)UP, etc..

Ideally process control should indeed enforce quality on the entire enterprise - that's what they're modelled to achieve! We as software developers should strive to contribute towards that goal and leave the decision whether our efforts result in small or big gains to the project leaders. In my experience, while maintenance cost is considerably lower per year or month compared to development, it is never minuscule, and will add up over time to the point where it is relevant.

Also you shouldn't neglect the time you need to fix a bug: if you need double the time because of sloppy coding, then this may lower your reputation, resulting in less sales. Ask your sales people how much they like that! Of course, at this point you also need to weigh the effect of releasing your product on time, with clean code: if you need too long for that, you may lose market shares to a competitor. However, at this point we're leaving the scope of this discussion Wink | ;)
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

GeneralRe: goto statement Pin
jschell13-Nov-13 10:27
jschell13-Nov-13 10:27 
GeneralRe: goto statement Pin
Stefan_Lang13-Nov-13 21:07
Stefan_Lang13-Nov-13 21:07 
GeneralRe: goto statement Pin
jschell14-Nov-13 7:54
jschell14-Nov-13 7:54 
GeneralRe: goto statement Pin
Stefan_Lang14-Nov-13 23:15
Stefan_Lang14-Nov-13 23:15 
GeneralRe: goto statement Pin
jschell15-Nov-13 12:28
jschell15-Nov-13 12:28 
GeneralRe: goto statement Pin
Stefan_Lang17-Nov-13 21:29
Stefan_Lang17-Nov-13 21:29 
GeneralRe: goto statement Pin
jschell18-Nov-13 8:13
jschell18-Nov-13 8:13 
GeneralRe: goto statement Pin
Stefan_Lang13-Nov-13 21:22
Stefan_Lang13-Nov-13 21:22 
GeneralRe: goto statement Pin
jschell18-Nov-13 8:17
jschell18-Nov-13 8:17 
GeneralRe: goto statement Pin
Stefan_Lang18-Nov-13 20:54
Stefan_Lang18-Nov-13 20:54 
GeneralRe: goto statement Pin
jschell19-Nov-13 10:39
jschell19-Nov-13 10:39 
GeneralRe: goto statement Pin
Stefan_Lang19-Nov-13 22:33
Stefan_Lang19-Nov-13 22:33 
GeneralRe: goto statement Pin
jschell20-Nov-13 9:54
jschell20-Nov-13 9:54 
GeneralRe: goto statement Pin
Bill_Hallahan11-Nov-13 17:39
Bill_Hallahan11-Nov-13 17:39 
GeneralRe: goto statement Pin
vl212-Nov-13 0:47
vl212-Nov-13 0:47 
GeneralRe: goto statement Pin
Bill_Hallahan12-Nov-13 13:35
Bill_Hallahan12-Nov-13 13:35 
GeneralRe: goto statement Pin
Stefan_Lang12-Nov-13 1:27
Stefan_Lang12-Nov-13 1:27 

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.