Summary


In this hour, you learned how to eliminate magic numbers by creating constants. By using constants in place of literal values, you increase code readability, reduce the possibilities of coding errors, and make it much easier to change a value in the future.

In addition, you learned how to create variables for data elements in which the initial value isn't known at design time, or for elements whose values will be changed at runtime. You learned how arrays add dimensions to variables and how to declare and reference them in your code.

Visual C# enforces strict data typing, and in this hour you learned about the various data types and how they're used, as well as tips for choosing data types and functions for converting data from one type to another. Finally, you learned about scopean important programming conceptand how to manage scope within your projects.

Writing code that can be clearly understood by those who didn't write it is a worthwhile goal. Naming prefixes go a long way toward accomplishing this goal. In this hour, you learned the naming prefixes for the common data types, and you learned to use prefixes to denote scope.

In the end, you utilized all these concepts and created a constant and some variables to handle the options of your Picture Viewer program. You even added code to make them work! The Options form is still not "hooked up," but you'll fix that in Hour 16.




Sams Teach Yourself Microsoft Visual C# 2005 in 24 Hours, Complete Starter Kit
Sams Teach Yourself Visual C# 2005 in 24 Hours, Complete Starter Kit
ISBN: 0672327406
EAN: 2147483647
Year: N/A
Pages: 248
Authors: James Foxall

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