Software Engineering discussion
Code Complete
>
General Issues in Using Variables
date
newest »
newest »
I like the suggestions of using easily recognizable fillers for initialization of working memory. This one may actually save me some debugging time in the future. There are many other good suggestions in Guidelines for Initializing Variables section. Just because author uses many C++ examples in this book I think he could mention the importance of using class member initialization list in Initialize a class’s member data in its constructor advice. Scott Meyers in Effective C++ book provides more detailed discussions on this and other topics about using variables in C++. Also, I like the discussion on measuring variable span and live times.
The last time I worked under a very formal coding policy, many of the strict coding standards were along the lines of topics from this chapter.I would agree with most of the suggested behavior in this chapter. I'm guilty of most of these bug types if my life, but good practice (as suggested by this chapter) certainly helps avoid them.


I don't think that this book covers the functional programming paradigm, which is a shame (OK, I know it is a big enough book already) because many of these side effect issues go away.