- Postpone a variable's definition until right before you have to use the variable
- Try to postpone the definition until you have initialization arguments for it.
- By doing so, you avoid constructing and destructing unneeded objects, and you avoid unnecessary default constructions.
- This help document the purpose of variables by initializing them in contexts in which their meaning is clear.
No comments:
Post a Comment