Please wait while the page is being loaded Skip this advertisement >
Thursday | 4 December, 2008
Review: Visual Studio 2008 advances with few missteps
Solid upgrade to Microsoft's IDE holds improvements for users of every level; highlights, including language-integrated data queries, new graphical design surfaces, and support for Vista, Web 2.0 technologies, and multiple versions of .Net Framework, overshadow a few nits
Martin Heller (InfoWorld) 29/01/2008 10:00:40

Language-integrated queries with LINQ

LINQ is a generic mechanism with many possible components. LINQ brings data queries into the C# and Visual Basic languages, and makes the syntax for queries against in-memory data structures just like queries against file systems, XML files, and SQL databases.

Several of the LINQ components and providers shipped in VS08, including LINQ to Objects (strings, reflection, and file directories), LINQ to XML, and LINQ to ADO.Net. LINQ to ADO.Net includes two components: LINQ to DataSet and LINQ to SQL. The more ambitious ADO.Net Entity Framework and LINQ to Entities are not included in VS08, but may ship later this year as an add-on.

I tested LINQ to SQL in C# against a SQL Server 2000 database.

The Object Relational Designer worked well to create C# classes from the database schema, and IntelliSense worked well when I was writing LINQ queries. On the other hand, writing LINQ queries by hand against three related tables pushed the limits of my nascent LINQ skills, and I longed for the LINQ equivalent of VS08's graphical SQL Query Designer. I never did figure out how to write the LINQ equivalent of a SQL "SELECT DISTINCT" query.

IntelliSense, refactoring, unit testing, and metrics

When I was working on this small project, I found that the C# refactoring functionality (included in Professional and above) worked well and quite smoothly. When editing C#, the programmer can take advantage of automated refactoring. There is full IntelliSense support for LINQ. Code metrics are calculated only for managed code.

I also found that the code metrics for managed code (included in VSTS Developer and Team Suite) worked fairly well. I'm not sure that I agree with the way the metrics are calculated for code generated from design surfaces, but I can certainly see the overall utility of the metrics, especially in the context of team projects managed with TFS.

I used metrics such as cyclomatic complexity (a measure of the number of linearly independent paths through a program module) years ago to help me manage a large C project with a dozen programmers. I'm happy to see this technology introduced in VS08 for managed code.

I'm disappointed, however, that code metrics and code refactoring are not available for unmanaged C++ projects. On the other hand, C++ projects can use a very nice call browser: It gives you a compact view of the other functions that call a given function, and of the lines of code that do the calls.

I'm happy that Visual Basic projects have code metrics along with an incredibly concise syntax, great IntelliSense, and many code snippets. I'm disappointed that Visual Basic projects don't have code refactoring, although this functionality can be added using one of several third-party plug-ins.

I'm delighted to report that unit testing is now a feature of the Professional Edition. (It was a VSTS feature in VS05.) You can create unit tests and test projects for C#, Visual Basic, and managed C++ solutions. It was possible to do this before using the free open source program NUnit, but it's a little nicer having the unit test capability integrated with the IDE.

IntelliSense for JavaScript was one of the promised improvements in VS08. It's there, but at a cost: Although support for the sort of JavaScript used to write ASP.Net AJAX and Silverlight pages has been added, support for editing VBScript and Classic ASP has been dropped. As I am still maintaining a 1999 vintage Classic ASP site, I was more than a little annoyed to find that VS08 did a worse job with ASP pages than VS05, or indeed than Visual InterDev 6. Microsoft is considering restoring this functionality for a service pack to VS08. Meanwhile, people who still maintain Classic ASP sites should not abandon their existing tools.

Computerworld Buyer's Guide - Vendors Matched to this Article
The object-relational diagram in this image was automatically generated by dragging the tables from a database.
The object-relational diagram in this image was automatically generated by dragging the tables from a database.
Computerworld Buyer's Guide - Vendors Matched to this Article
Additional Resources
Executive Guides
Whitepapers
Zones
Zone logoZones provide focussed content from Computerworld and leading technology partners.
Newsletter Subscription
Sign up for our Computerworld newsletters!
RSS Feeds
Market Place

 

Smart SOA World Tour

Discover how SOA can create smarter outcomes for your business.

Attend and learn:

  • How SOA is helping leading companies to become more agile
  • Where you should be applying SOA processes in your company
  • The top SOA implementation mistakes to avoid

Click here for more information.
Whitepaper

Still Sneaking In: The Threats Your Security Tools Aren't Telling You About

Web 2.0 applications are all the rage, offering us tremendous value when it comes to collaboration and communication. They also open us up to new kinds of attacks however, and can cause problems in keeping systems and data secure. Read on to learn about the new attack methods and how you can defend yourself and your business.

Enterprise IT Buyer's Guide
Find Technology Vendors Fast
 
Find vendors by name | Find by category
Sponsored Links