Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Go to top

Refactoring Tips - Tip 1

, 2 Mar 2010
Rate this:
Please Sign up or sign in to vote.
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Stefan_Lang
Software Developer (Senior)
Switzerland Switzerland
Graduated at TU Darmstadt in Math & CS, with a heavy focus on CAD/CAM
 
Programming and designing applications in C++ in the areas AI, real-time programming, client-server applications and CAD/CAM since 1985.
 
Personal interests: AI, computer graphics, games, reading

Comments and Discussions

 
GeneralMy vote of 1 PinmemberYoldas Askan15-Sep-14 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 2 Mar 2010
Article Copyright 2010 by Stefan_Lang
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid