inset
Visual Studio Renews Pitch for Developers
Nov. 29, 2004

Visual Studio 2005 (VS 2005) promises improvements for the core development cycle—editing, compiling, and debugging code—across all of Microsoft’s programming languages. As the next major update of Microsoft’s integrated development environment (IDE), its improvements address limitations in the previous two versions that either hindered developers from making the jump to .NET or reduced the productivity of those who did. While Visual Studio is expanding beyond core development, the success of Microsoft’s .NET technology depends on the IDE’s appeal to its current developer base.

New VS 2005 features that go beyond core development include the following:

  • A source code control system based on SQL Server
  • Application modeling tools that tie into Microsoft’s Dynamic Systems Initiative for managing applications and systems
  • Tools designed to help project managers better track and communicate the state of a software development project.

All of these features will be covered in future articles in Update.

Developer Segmentation

Microsoft’s Developer Division has long sought a single IDE for all of its tools. After several false starts, the company finally achieved its aim with the introduction of Visual Studio .NET (VS.NET) in 2002.

Building a single IDE provides Microsoft with numerous benefits, including engineering efficiencies and the ability to provide third parties with a single platform to build on. However, the value to Microsoft’s customers is less clear. Many development organizations include Visual Basic (VB), C++, and even C# developers, but it is rare for an individual developer to move back and forth between languages. Therefore, the fact that all of Microsoft’s programming languages (with the exception of FoxPro) share a common IDE is less important to customers than having an IDE that is tuned for the needs of each individual.

Microsoft remains committed to a single code base for the Visual Studio IDE, but with VS 2005, it has begun to customize the look and feel of the IDE based upon the primary language chosen by the developer. Previous versions of Visual Studio provided some customization based upon language choice, but those customizations were mostly superficial, such as changing the help system to show code samples in the appropriate programming language.

VS 2005 takes the idea of customization further with features such as the following:

  • Removing (not just hiding) menu items and windows based on language—for example, removing low-level debugging windows such as the disassembly window that are important to C++ developers but likely to confuse VB developers
  • Bringing the most common project types for a language to the top of the list in the New Project dialog box—VB developers, for example, will find common project types such as GUI client applications or Web services at the top of the list and less common types such as Windows services at the bottom.

These options can be further customized through the Options dialog box or by editing an XML file that can be shared among a group of developers.

VB: Taking Down Roadblocks

Of all Microsoft’s developer constituencies, VB developers suffer most in the move to .NET. Although VB.NET improves on previous versions of the language, traditional VB developers face roadblocks in three areas: the IDE lacks productivity-enhancing features of past versions, the VB APIs are different, and the VB language itself has changed. VS 2005 addresses the first two roadblocks, but not the third.

Bringing Back the VB Experience

Prior to VS.NET, VB programmers used an IDE specifically built for VB. The move to a common IDE gave VB additional features (such as the ability to extend the IDE via macros), but it also added features which are of little or no value to most VB developers and which only serve to clutter the interface. The automatic customization features of the IDE will help remove much of this clutter.

In addition, VB 2005 reintroduces Edit and Continue, a feature that many developers consider essential to the overall "VB experience" but which was missing in earlier versions of VB.NET. Edit and Continue allows a developer to examine a program in the debugger, modify the code and have those changes immediately reflected in the running application. Many VB developers have come to rely on this not just for debugging but for writing large portions of their applications as well. (Microsoft calls this style of programming "opportunistic development.")

Other changes to the IDE designed to lower the barrier to VB developers include the following:

Zero impact projects. Prior to .NET, VB allowed developers to write, compile, execute, and debug code without having to save any files or projects to disk. VB developers would often start up a second instance of VB to experiment with code until they got it just right and then copy the code over to their main projects. Unlike the initial releases of VB.NET, which require that both the source code files and the project files be given a name and saved to disk before they could be compiled, VB 2005 offers lightweight projects and will automatically save them to a temporary directory.

Hiding generated code. Many of the tools within Visual Studio generate code on behalf of the developer. The UI designer for Windows Forms, for example, automatically generates and maintains the code that describes the controls that make up a form as well as their positions and other properties. Although this code is necessary, most VB developers do not want to see it.

Prior versions of VB.NET tried to hide this code by collapsing it in an outline-style view and marking it as "Designer Generated" code, but many developers want it completely hidden, as it was in VB 6. VB 2005 accomplishes this through the use of partial classes—a language feature that allows code generated by the tools to be kept in a separate file from code written by the developer. A VB developer who looks at the source code corresponding to a form will see only the code he or she wrote.

Drag-and-drop data. VB 2005 includes several new graphical design tools to streamline the process of building applications that access databases and Web services. Data-access design tools were important to pre-.NET VB programming but were missing in the initial releases of VB.NET and its IDE. (For an illustration of one of the new data access design tools, see "VB Brings Back Drag and Drop Data".)

My Classes Provide Shortcuts

For many VB developers, the largest change that came with .NET was the switch to the unfamiliar, cross-language APIs of the .NET Framework. Although the .NET Framework follows what many programmers regard as modern, object-oriented, design principles, VB developers have found it somewhat daunting compared to the original, VB-specific APIs, and have had difficulty finding the ".NET equivalent" of tasks they used to know how to do.

VB 2005 provides a new set of VB-specific helper classes, known as My Classes, that provide shortcuts to many of the commonly used .NET Framework APIs. For example, a file can be read by a single line of code that uses My.Computer.FileSystem instead of three lines of code that use System.IO.StreamReader.

The new My Classes APIs don’t replace any of the functions of the .NET Framework. Instead, they build on top of the existing functions, making frequently used functions easier for VB developers to find and use.

Language

VB.NET included a number of changes to the VB programming language, most of them driven either by technical differences between the .NET Framework and the older VB runtime or by the desire to support the .NET Common Language Specification—a subset of language features supported by the .NET Common Language Runtime (CLR). Arguably, many of the changes made in the VB language were improvements, but they nonetheless represented change for VB developers.

With VB 2005, Microsoft is adding even more features to the VB language, including support for "Generics"—a new feature of the .NET Framework designed to simplify the task of creating certain types of reusable components. For VB programmers, it's not clear that these new features will add enough value to offset the additional complexity they bring.

C#: Streamlining Code Writing

The C# language has occupied a unique and somewhat awkward position since its introduction in 2002. On the one hand, it was designed hand-in-hand with the .NET Framework and had no legacy or backward-compatibility problems to wrestle with. On the other hand, it tries to fit in between Visual C++ and VB—two commercially successful products with millions of satisfied customers.

With the 2005 releases, a distinction is beginning to emerge in the types of developers who are likely to use C# and those likely to use VB, and Microsoft is responding by beginning to differentiate between them, at least in terms of their IDE features.

Microsoft believes that C# appeals to code-centric developers: developers who are comfortable working primarily in the source code editor rather than relying on visual designers, but who still want to use a simpler language than C++. As a result, many new C# IDE features concentrate on making the editor a more productive place to write code, even though C# 2005 still supports the full range of visual design tools, as will future versions.

Expansions. With the 2005 version, C# extends the IntelliSense automatic code completion features first introduced in VB 5.0. For example, in addition to helping developers by automatically providing a list of functions that can be used with a given object, C# now includes programming language constructs themselves and will automatically provide a skeleton implementation for many common programming tasks. (For an illustration of this, see "Expansions Streamline Coding".)

Refactoring. In addition to writing new code, developers must frequently modify existing code in several predictable ways. By providing ways to automate the refactoring of existing code, C# 2005 helps reduce the likelihood of introducing new bugs. The kinds of refactoring that C# 2005 can assist with include the following:

  • Extracting a block of code from one function and making it a separate function
  • Taking a variable used within a function and making it a parameter to the function
  • Renaming a function and updating all the references to that name throughout the project
  • Taking a block of code and making it conditional by surrounding it with an "if" statement, or making it repetitive by surrounding it with a "for" or "while" statement.

C++: Bridging .NET with Native

For C++, the most important VS 2005 features support mixing managed code (which executes under control of the CLR) and unmanaged code. Unlike VB.NET and C#, Visual C++ can build applications with managed code, unmanaged code, or both. The ability to use either managed or unmanaged code is particularly important for ISVs with large unmanaged C++ code bases looking to leverage managed code over the next two to three years. In particular, WinFX, a new set of APIs for managed code, will be built into "Longhorn" and available as an add-on for Windows XP and Windows Server 2003. Many ISVs might want to target WinFX without having to start over from scratch.

Language

In VS 2005, C++ provides support for building three types of .NET applications:

Verifiable applications or components are those that consist entirely of managed code and restrict themselves to language features and APIs that can be verified by the CLR. For instance, the C++ language traditionally allows programmers to treat data of one type (such as an integer) as a different type (such as a floating point number) without any safety checks. Such conversions are not allowed by the CLR, and code that uses them would not be verifiable. In addition, verifiable code is not allowed to make direct calls to the underlying OS or other native code.

Producing verifiable code is particularly important in conjunction with SQL Server 2005. SQL Server 2005 allows developers to write server-side database code (such as stored procedures and triggers) using any .NET language. However, it only supports verifiable code—a measure meant to protect against poorly written or malicious code.

Pure application or components also consist solely of managed code but, unlike verifiable code, they are allowed to use the full range of C++ language features and to make direct calls to the OS or other native code.

Hybrid applications or components are composed of managed code and native code.

In addition to providing additional options for the type of code that C++ generates, Microsoft is overhauling the Managed Extensions to C++ (known informally as Managed C++) to make .NET code written in C++ easier to read and write and to dispel the idea that C++ is a second-class citizen in the .NET world.

IDE

In addition to compiler support for mixing managed and unmanaged code, VS 2005 includes several IDE improvements for C++ developers. For example, C++ developers tend to have large numbers of source code files open in the IDE at one time—50 or more is not unusual. For these developers, a new IDE Navigator can be brought up with a single keystroke to display the list of all open files and windows. The developer can use either the mouse or the keyboard to select a window or file. In addition, typing part of the name of a file will drill down to that file, allowing the developer to move quickly from one file to another.

Web: Building on ASP.NET

ASP.NET 2.0 includes a number of improvements that will make it very popular with existing customers and may help draw developers away from competing products such as Apache, including the following:

  • Systems for tracking Web site membership and personalizing the appearance of the site for each member
  • Master pages, themes, and skins, which allow Web developers to apply a consistent look and feel across all pages in a site
  • New controls for common tasks such as logging on to Web sites and making them easier to navigate.

In addition, VS 2005 includes several improvements that make it easier for sophisticated Web developers to build sites, including the following:

Directory-based projects. VS 2005 no longer requires developers to create solution files for their Web projects, eliminating one of the most cumbersome and difficult-to-understand aspects of Visual Studio for Web developers. Instead, developers can simply point VS 2005 at a directory containing a Web project and begin editing. In addition, VS 2005 no longer requires FrontPage Server Extensions to be installed on the Web server.

Support for inline code. ASP.NET has always allowed developers to use either "code-behind" development (in which the source code for the application is stored in a separate file from the Web page markup code) or "inline" development (in which the source code and the markup code are contained in the same file). VS.NET, however, supported code-behind only. Many Web developers prefer the inline model because it reduces the number of files that must be deployed and maintained. With VS 2005, inline code is fully supported, although code-behind remains the default.

Flexible HTML formatting. Although Visual Studio has always included built-in WYSIWYG (What You See Is What You Get) HTML editing, many developers opt to write HTML by hand or use one of the plethora of third-party tools. VS 2005 aims to better support those users in two ways:

  • It will not alter any existing HTML
  • It includes an almost mind-boggling number of options to control the formatting of any HTML it generates.

The combination of these features should enable Web developers to combine VS 2005 with other tools or to hand-author HTML with much less difficulty than before.

Many of these features first appeared in ASP.NET Web Matrix, a free, lightweight development tool that Microsoft offered as an alternative to the more comprehensive Visual Studio product. The addition of these features to Visual Studio along with the introduction of the low-cost Web Developer Express SKU of Visual Studio means that Web Matrix is no longer necessary and will be discontinued.

Resources

The VS 2005 home page can be found at msdn.microsoft.com/vs2005.

MSDN subscribers can download the latest beta of VS 2005 at the MSDN Downloads page at msdn.microsoft.com/subscriptions/downloads.

The documentation for the VS 2005 beta is available at msdn2.microsoft.com/library/default.aspx.

For more information on the Visual Studio Express Tools, see "Express Tools for Beginners, Hobbyists" on page 17 of the Aug. 2004 Update.

For an example of how C++ support for managed code is changing, see "The New C++" on page 18 of the Sept. 2004 Update.