65.9K
CodeProject is changing. Read more.
Home

Refactoring Tips - Tip 1

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.56/5 (2 votes)

Mar 2, 2010

CPOL
viewsIcon

6664

I actually prefer initialization over assignment, like this:private void Method(){ int Var2; int Var3; // some more statements int Var1(10);}In doing this you prevent later edits to again separate the declaration from the assignment by inserting code between them.

I actually prefer initialization over assignment, like this:
private void Method()
{
   int Var2;
   int Var3;
   // some more statements

   int Var1(10);
}
In doing this you prevent later edits to again separate the declaration from the assignment by inserting code between them.