DekGenius.com
Team LiB   Previous Section   Next Section

Chapter 4. Visual Studio .NET

In Chapter 2 you learned that you can create your C# applications using Notepad. In this chapter, you'll learn why you never will. Microsoft developed Visual Studio .NET (VS.NET) to facilitate the creation of Windows and web applications. You will find that this Integrated Development Environment (IDE) is a very powerful tool that will greatly simplify your work.

Visual Studio .NET offers many advantages to the .NET developer. The following features are discussed in this chapter:

  • A modern interface using a tabbed document metaphor for source code and layout screens, and toolbars and informational windows that dock where you want them

  • Code completion, which allows you to enter code with fewer errors and much less typing

  • IntelliSense, which pops up help on every method and function call as you type

  • Dynamic, context-sensitive help, which allows you to view topics and samples relevant to the code you are writing at the moment

  • Immediate flagging of syntax errors (e.g., missing characters, misplaced braces, etc.), which allows you to fix problems as they are entered

  • The ability to compile and test programs right in the IDE

  • A built-in task list to keep track of changes you need to make

  • A Start Page that provides easy access to new and existing projects

  • Customization capability, which allows you to set user preferences for IDE appearance and behavior

One VS.NET feature will be so important to you, even as a C# novice, that it actually merits its own chapter: an integrated debugger, which allows you to step through code, observe program run-time behavior, and set breakpoints, even across multiple languages. The debugger is considered in detail in Chapter 10.

In addition to these basic capabilities, VS.NET provides a number of advanced features that will simplify the development process. These features include:

  • Convenient access to multiple design and code windows

  • WYSIWYG (What You See Is What You Get) visual design of Windows forms and web forms

  • An HTML editor which provides both Design and HTML views that update each other in real time

  • A Solution Explorer, which displays all the files comprising your solution (a collection of projects) in a hierarchical format

  • A Server Explorer, which allows you to log on to servers to which you have network access, access the data and services on those servers, and perform a variety of other chores

  • Integrated support for source control software

Many of these advanced features are covered in detail in Programming ASP.NET and Programming .NET Windows Applications (both books cowritten by Jesse Liberty and Dan Hurwitz, published by O'Reilly).

Robert Heinlein said "TANSTAAFL: There ain't no such thing as a free lunch."[1] While Visual Studio .NET can save you a lot of grunt typing (and in general greatly facilitate and accelerate the development process), the automatically generated code can obscure what is really necessary to create good working applications. It is sometimes difficult to know how Visual Studio .NET accomplishes its legerdemain. Similarly, the proliferation of mysteriously named files across your filesystem can be disconcerting when all you want to do is a simple housekeeping chore, like rename a minor part of the project.

[1] Robert A. Heinlein, The Moon Is a Harsh Mistress (St. Martin's Press).

Since most of the applications we'll build in this book are console applications designed to illustrate the basics of the language, there will be very little obscuring code produced. When you create Windows and web applications, however, you'll want to learn to sort through the code Visual Studio .NET generates in order to focus on the logic of your program.

The current chapter cannot possibly teach you everything about Visual Studio .NET; it is far too large and complex an application. What this chapter does is give you the basics for getting started and also point out some of the possible pitfalls.

Keep in mind that there's no way to familiarize you with some of these features without wading into some slightly deeper waters of C# programming, which will likely be a bit cloudy to you at this stage. As you get deeper into the book and learn more about the language, your understanding of VS.NET will become clearer.

    Team LiB   Previous Section   Next Section