Article Options
Premium Sponsor
Premium Sponsor

 »  Home  »  .NET Framework  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 2
 »  Home  »  .NET Newbie  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 2
 »  Home  »  Data Programming  »  ADO.NET  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 2
 »  Home  »  Reviews  »  Book Reviews  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 2
 »  Home  »  Visual Studio 2005  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 2
 »  Home  »  Windows Development  »  Win Forms  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 2
Book Review: Murach's C# 2005
by Scott Waletzko | Published  06/15/2006 | .NET Framework .NET Newbie ADO.NET Book Reviews Visual Studio 2005 Win Forms | Rating:
Walkthrough: Section 2

Anyone with any experience using Visual Studio for Windows Forms development may want to skip the first section and start right in with "Section 2 - The C# Language Essentials". These 8 chapters serve as an introduction to the building blocks of the C# programming language, covering how to work with different variable types, code control structures, exceptions, methods, and events. When looking at this section's topics in the table of contents it doesn't appear that they appear in any particular order, but when reading the chapters sequentially everything seems to flow nicely.

"Chapter 4 - How to work with numeric and string data" begins by explaining the basics of working with value type variables, and covers declaration and initialization, arithmetic and assignment expressions, order of precedence, and casting. This chapter provides a very solid foundation for working with value types, specifically using strings and numeric variables to illustrate how and why to cast values to specific types, how to create formatted string representations of different types (using the String.Format method), and includes a brief mention of the Math class and its associated methods (the StringBuilder and the differences between mutable and immutable string values are covered in a later chapter).

The next chapter ("How to code control structures") introduces relational and logical operators, conditional statements ("How to code if-else statements", "How to code switch statements"), and loop constructs ("How to code while and do-while loops", "How to code for loops").

Chapter 6 is a discussion on "How to code methods and event handlers", expanding on what is covered in the first section of the book by detailing the differences betwen value and reference parameters, using Visual Studio 2005's refactoring feature to convert a block of code into its own method, and explaining in detail how events and event handlers work ("How to work with events and delegates", "How to generate an event handler for an event", "How event wiring works", "How to handle multiple events with one event handler").

The next chapter ("How to handle exceptions and validate data") begins by covering exception handling, explaining the specifics of the proper handling of exceptions through structured try-catch blocks, and introducing the proper reasons and methods for throwing exceptions in your code.

Following is a chapter on arrays and collections, covering the use of single- and multiple-dimensional arrays ("How to work with one-dimensional arrays", "How to work with rectangular arrays", "How to work with jagged arrays") and collections ("Commonly-used collection classes", "Typed vs. untyped collections"). The array discussion ends with more advanced examples of how to manipulate arrays ("How to refer to and copy arrays", "How to code methods that work with arrays"), and the collection discussion details the different built-in collections (including list, sorted list, queues, and stacks) and how and when to use each.

"Chapter 9 - How to work with dates and strings" extends the previous discussion of formatting strings, introduces the DateTime and TimeSpan structures, and explains how to manipulate, compare, and format date-related values.

Moving back to the sample application, the next chapter begins with examples of working with some of the more common controls (comboboxes, listboxes, checkboxes, radio buttons, and groupboxes), explaining tab order, and then illustrating how to use the Visual Studio reference documentation to learn more about the controls not covered in the book. The next discussion is about using multiple forms in one application ("How to work with a multi-form project", "How to use the MessageBox class", "How to display a dialog box and get the user response", "How to use the FormClosing event"), ending with example code integrating everything discussed in the previous chapters into the sample project that is used throughout the book.

The last chapter in this section, "How to debug an application", covers the debugging features of Visual Studio including break mode, edit and continue, breakpoints, the various debug windows (Watch, Locals, Autos, and Call Stack), and the use of Visual Studio 2005's new visualizers to view variable content. Not mentioned are the System.Diagnostics.Debug class, the different build configurations, or conditional compilation constants; all of which might have fit nicely in this chapter.

Sponsored Links