Writing and compiling code by hand would be a tedious task for any developer. But the Visual Studio
IDE offers a slew of high-level features that go beyond basic code management. These are some of Visual
Studio’s advantages:
An integrated web server: To host an ASP.NET web application, you need web server software like
IIS, which waits for web requests and serves the appropriate pages. Setting up your web server isn’t
difficult, but it can be inconvenient. Thanks to the integrated development web server in Visual
Studio, you can run a website directly from the design environment. You also have the added
security of knowing no external computer can run your test website, because the test server only
accepts connections from the local computer.
Multilanguage development: Visual Studio allows you to code in your language or languages of
choice using the same interface (IDE) at all times. Furthermore, Visual Studio allows you to create
web pages in different languages, but include them all in the same web site. There are only two
limitations: you can’t use more than one language in the same web page (which would create
obvious compilation problems), and you must use the projectless website model (not web projects).
Less code to write: Most applications require a fair bit of standard boilerplate code, and ASP.NET
web pages are no exception. For example, when you add a web control, attach event handlers, and
adjust formatting, a number of details need to be set in the page markup. With Visual Studio, these
details are set automatically.
Intuitive coding style: By default, Visual Studio formats your code as you type, indenting
automatically and using color-coding to distinguish elements such as comments. These minor
differences make code much more readable and less prone to error. You can even configure what
automatic formatting Visual Studio applies, which is great if you prefer different brace styles (such
as K&R style, which always puts the opening brace on the same line as the preceding declaration).
■ Tip To change the formatting options in Visual Studio, select Tools ➤ Options, and then look at the groups
under the Text Editor ➤ C# ➤ Formatting section. You’ll see a slew of options that control where curly braces
should be placed
Faster development time: Many of the features in Visual Studio are geared toward helping you get
your work done faster. Convenience features allow you to work quickly and efficiently, such as
IntelliSense (which flags errors and can suggest corrections), search-and-replace (which can hunt
for keywords in one file or an entire project), and automatic comment and uncomment features
(which can temporarily hide a block of code).
Debugging: The Visual Studio debugging tools are the best way to track down mysterious errors and
diagnose strange behavior. You can execute your code one line at a time, set intelligent breakpoints
that you can save for later use, and view current in-memory information at any time.
Visual Studio also has a wealth of features that you won’t see in this chapter, including project
management, integrated source code control, code refactoring, macros, and a rich extensibility model.
Furthermore, if you’re using Visual Studio 2010 Team System you’ll gain advanced unit testing,
collaboration, and code versioning support (which is far beyond that available in simpler tools such as
Visual SourceSafe). Although Visual Studio Team System isn’t discussed in this chapter, you can learn
more from http://msdn.microsoft.com/teamsystem.
Hiç yorum yok:
Yorum Gönder