Click here to Skip to main content
12,626,508 members (38,487 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

3.2K views
Posted

Refactoring Tips - Tip 1

, 2 Mar 2010 CPOL
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

You may also be interested in...

Comments and Discussions

 
GeneralMy vote of 1 Pin
Yoldas Askan15-Sep-14 8:02
memberYoldas Askan15-Sep-14 8:02 

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.

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