Re: What do you think about the code?
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Sun, 02 Jul 2006 09:32:02 +1200
Frederick Gotham wrote:
Ian Collins posted:Apply more imagination.
I agree 100% with Richard's comments, the cleaner the code structure,
the easier it is to refactor. That's why my last team banned goto
outright.
I find "goto" necessary when I have nested loops, for example:
I posted a viable alternative last week.
while ( expr1 )
{
while ( expr2 )
{
while ( expr3 )
{
goto OUT_OF_ALL_LOOPS;
}
}
}
OUT_OF_ALL_LOOPS: ;
Well that's team democracy at work. We preferred well structured code
In my own humble opinion, I think it's childish to outright ban something
when it comes to computer programming -- I feel it gives an air of
inconfidence in one's competence.
that was easy to refactor. Try extracting your inner loop to a function.
--
Ian Collins.
.
- Follow-Ups:
- Re: What do you think about the code?
- From: goose
- Re: What do you think about the code?
- References:
- Re: What do you think about the code?
- From: Richard Heathfield
- Re: What do you think about the code?
- From: Andrew Poelstra
- Re: What do you think about the code?
- From: Ian Collins
- Re: What do you think about the code?
- From: Frederick Gotham
- Re: What do you think about the code?
- Prev by Date: Re: Value Bits Vs Object Bits
- Next by Date: Re: 'clear' shell command in Makefile
- Previous by thread: Re: What do you think about the code?
- Next by thread: Re: What do you think about the code?
- Index(es):
Relevant Pages
|