Re: Check on correctness
- From: "Tom Serface" <tserface@xxxxxxx>
- Date: Mon, 3 Jul 2006 10:40:29 -0700
Hi Joe,
I assume you're excluding for() statements from this rule. For example:
for(int i=0; i < something;++i) {
}
is very common and a proper form of declaration and initialization
especially now that we have decent for scope handling. This keeps the
variable local to the loop and is a consise and coherent way of declaring
nad setting the initial value.
I agree with you on other types of statements. For example:
if(x=1) {
}
would work, but not likely how the programmer intended. Fortunately, we get
a nice fat warning for this one.
Tom
Of course, this compiles in either release or debug modes
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:u2fea21k8h9gj67kope08hp8uft4h0chh2@xxxxxxxxxx
You need to do two things to become a better developer:
Never, ever under any circumstances embed assignments in any other
construct. Not in an if, not in a while, and most especially not in an
ASSERT.
Embedded assignment is a very poor programming methodology, and serves
little if any useful purpose at any time and should be abandoned as a
programming technique
Never, ever, under any circumstances make any document or view class
visible
to a dialog. Dialogs should only work on their own member variables or
structures used for communication and not know about anything else outsdie
themselves.
joe
.
- Follow-Ups:
- Re: Check on correctness
- From: Joseph M . Newcomer
- Re: Check on correctness
- From: Sgt. York
- Re: Check on correctness
- References:
- Check on correctness
- From: tim@xxxxxxxxxxxxxxxxxxxxxx
- Re: Check on correctness
- From: www.fruitfruit.com
- Re: Check on correctness
- From: tim@xxxxxxxxxxxxxxxxxxxxxx
- Re: Check on correctness
- From: Joseph M . Newcomer
- Check on correctness
- Prev by Date: Re: issue with dialog
- Next by Date: Re: file can not be open, read or write in visual studio 2005
- Previous by thread: Re: Check on correctness
- Next by thread: Re: Check on correctness
- Index(es):
Relevant Pages
|
Loading