Download
Microsoft Visual Studio 2010 & .NET 4 RC

Microsoft Visual Studio 2010

Denver Visual Studio User Group   www.DenverVisualStudio.net 

 
 
 Review Details

Denver VS UG - Home    

     Also see Reviews and How To Review.
   
 
No Starch Press: The Book of Visual Basic 2005, .NET Insight for Classic VB Developers (No Starch Press)
Author(s): by Matthew MacDonald www.prosetech.com
Published: 2006, 1-59327-074-7, 474 pages
Publisher (more . . .):  No Starch Press
 
 
   
 
 Review
 

 

 Four out of Five Stars
  Reviewed: July, 2006
  Reviewer: Richard Grier
 
       Matthew MacDonald takes on the challenging task of bringing “Classic VB” (read VB6) programmers up to speed on programming with Visual Studio 2005 using Visual Basic. He admits that the difficulty of this task is increased by several things. First, Classic VB was “easy.” Second, Visual Basic in the mold of Visual Studio .NET is not so easy. Third, some VB programmers are fossils; when you’ve been using VB as long as I have, and I’m one of the originals, making the transition takes a non-trivial amount of effort.

     So, Matthew’s task is simple on the face, and more difficult in implementation. How to take the things that Classic VB programmers “know” and provide them with the new way of doing things? How to make this both complete and painless? And, most importantly how to justify the effort required getting there from here?

     What makes Classic VB so attractive? It had easy entrée. That is, one could get started writing programs that did useful things with only a little prior knowledge, and a simple willingness to open Visual Studio, drop some controls on a form, and then to start writing code to manipulate the UI and data created and consumed.

     What is it about Classic VB that suggests that it is worthwhile to move to Visual Basic 2005? The simple things are easy, and the complex things require much more work. Also, though VB6 is “object oriented” language, it doesn’t provide many of the classical object-oriented idioms that C++ and Java programmers find to make their lives both interesting (in the Chinese curse way), and productive. And, at the end-of-the-day, productivity is what VB programming is all about. The aspects of improved productivity that Visual Basic 2005 offers over VB6 are easy to state, but harder to explain. Matthew does a good job in this area. Here are some facilities that .NET provides that were either missing, or hard to achieve using VB6:

• Improved UI design, and support for Windows XP styles
• True class inheritance (forms and non-visual objects)
• Multithreading
• Web Services and XML
• Regular Expressions
• Windows Services

     Perhaps one of the most compelling reasons to adopt .NET is the removal of COM objects (DLL Hell) as a daily concern. Deployment and maintenance of .NET programs simply is smoother than for VB6!

     With these improved facilities comes the burden of learning some new syntax (still VB, but a much more extensive vocabulary), learning what the .NET Framework (class libraries AKA Types) contain, how to apply them, and how to design using the object-oriented methods that now are available.

     So, does the book do the job? Yes, for the most part. Let me highlight a few areas that are well served:

• Getting Started. The IDE (Integrated Design Environment) is similar to the one that Classic VB programmers are used to, but some much capability has been added that a detailed, step-by-step introduction to the IDE is useful. Matthew does this well.
• Moving common elements from a VB6 design paradigm to that of .NET. Some of these are databases (ADO vs. ADO.NET, Server Explorer, and how data binding works); how to employ the new UI design techniques both to make an interface RAD and to take advantage of the design styles and conventions that have become common and in demand; how to enhance the UI using new controls and tools; how to print – which can be a trial.
• How to apply real object-oriented design and implementation to make programming simpler, more productive, and (ideally) more reliable.
• Code snippets.
• Web applications (an introduction to ASP.NET).
• How to explore the .NET Framework and library system.
• Exception and error handling. Bug-proofing and code debugging are well covered.
• Control sub-classing.
• How and why to use threading.
• Serialization.
• Working with the Registry.
• Using embedded resources.
• Creating a .NET component (User Control).
• Creating and consuming XML data.
• Creating and using Web services.
• Setup and deployment of applications.

     OK, so there were some “misses,” and I’d be remiss if I didn’t mention some of these. If you want information in moving VB 6 code these areas, you will need to go elsewhere:

• Serial communications (the VB6 MSComm communications control). Get a copy of my book. This is handled using the .NET Framework 2 System.IO.Ports classes.
• Winsock communications (the VB6 Winsock control). This is handled using the .NET Framework System.NET.Sockets classes. Actually, I think the author intended to cover this, since it is mentioned in the book Introduction.
• Web browsing (the VB6 Internet Control). Use System.Net classes and/or the Webbrowser control.
• Reports (such as Crystal Reports). Crystal Reports in on included in the Express version of VB 2005, but is available in higher editions, and VSTS (admittedly beyond the scope of this book) has extensive reporting capability.
• Using COM components and ActiveX controls in .NET programs. There are a huge number of pre-compiled COM objects available. The only satisfactory way to tackles some programming problems requires their use (and deployment). This topic needs discussion.
• What do you do when you need to fall back on the Windows API for functionality that even the huge .NET Framework does not include? PlatformInvoke (P/Invoke) for calling Windows API functions is not discussed. This is not exactly the same for .NET as it was for VB6.

     And, lastly, a few “misses” of .NET features that may be a determining factor when making the decision to move from VB6 to .NET:

• Creating a Windows Service is not discussed.
• Compact Framework (such as Pocket PC).
• Disconnected systems.
• Use of Regular Expressions.
• Localization/globalization (resources are discussed, but this area is left mostly blank).
• Code signing.
• Delegates are discussed, but are given short shrift, in my opinion.
• Threading is covered, but some of the negative aspects of its overuse are left to the imagination. Threads are not “free” (even free threads). Performance tuning and optimization are issues that are worth mentioning.
• Software testing and automated test systems.

     I’ve been programming using VB .NET since the beta of Visual Studio 2002, and the 10 years prior to that beta using earlier versions of VB. So, there are lots of things that I know… And, many more that I simply do not know. I haven’t had the time, or the need, to explore more than a small fraction of all of the capabilities of the .NET framework. What areas did I find to be of most value? Why, the areas where I work least. These are ADO.NET and databases, Web Services, and XML data. What information did I actually want (today), but had to look elsewhere? Windows Service creation and deployment – I’m writing an essay on this subject to include on the CD ROM that accompanies my own book, an evolving creature.

     Would I recommend this book to a prospective vb6 to .NET programmer? Yes, without reservation. While I mentioned a number of areas that I found lacking, those probably are in the 5-10% category. The vast majority of readers will find excellent value in this book.

     One last complaint and one that I understand from a publisher’s perspective: why source code for examples is not included in machine readable form? Sure, the answer is cost. However, it is a great feature to make it available on the web, if it cannot be included with the book. Matthew does this on his site: www.prosetech.com.


Richard Grier, Microsoft MVP - Visual Basic, Hard And Software, Author of Visual Basic Programmer's Guide to Serial Communications, 4th.

Dick is a consultant specializing in embedded system design and implementation, PC systems analysis, real-time data acquisition and control, embedded GPS (Global Positioning System satellite receivers), data communications (modems, both asynchronous and synchronous, RS-232, RS-422, and RS-485, fiber optics, network TCP/IP and UDP, Internet/www, and wireless communications), PC user interface design and implementation on Windows desktop,  Pocket PC or WinCE systems, scientific, laboratory, industrial machine control and GIS applications.
   
  Top
  Copyright © 2000 - 2010 Denver Microsoft® Visual Studio User Group.
All Rights Reserved. Please see Notice