Chapter 10. General Issues in Using Variables

 < Free Open Study > 

cc2e.com/1085

Contents

  • Data Literacy page 238

  • Making Variable Declarations Easy page 239

  • Guidelines for Initializing Variables page 240

  • Scope page 244

  • Persistence page 251

  • Binding Time page 252

  • Relationship Between Data Types and Control Structures page 254

  • Using Each Variable for Exactly One Purpose page 255

Related Topics

  • Naming variables: Chapter 11

  • Fundamental data types: Chapter 12

  • Unusual data types: Chapter 13

  • Formatting data declarations: "Laying Out Data Declarations" in Section 31.5

  • Documenting variables: "Commenting Data Declarations" in Section 32.5

It's normal and desirable for construction to fill in small gaps in the requirements and architecture. It would be inefficient to draw blueprints to such a microscopic level that every detail was completely specified. This chapter describes a nuts-and-bolts construction issue: the ins and outs of using variables.

The information in this chapter should be particularly valuable to you if you're an experienced programmer. It's easy to start using hazardous practices before you're fully aware of your alternatives and then to continue to use them out of habit even after you've learned ways to avoid them. An experienced programmer might find the discussions on binding time in Section 10.6 and on using each variable for one purpose in Section 10.8 particularly interesting. If you're not sure whether you qualify as an "experienced programmer," take the "Data Literacy Test" in the next section and find out.

Throughout this chapter I use the word "variable" to refer to objects as well as to built-in data types like integers and arrays. The phrase "data type" generally refers to built-in data types, while the word "data" refers to either objects or built-in types.

 < Free Open Study > 


Code Complete
Code Complete: A Practical Handbook of Software Construction, Second Edition
ISBN: 0735619670
EAN: 2147483647
Year: 2003
Pages: 334

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net