Visual Basic .NET - Criticism

Criticism

When first introduced, many long-time Visual Basic users complained about Visual Basic .NET because initial versions dropped a large number of language constructs and user interface features that were part of VB6 (which is no longer sold by Microsoft), and changed the semantics of those that remained; for example, in VB.NET parameters are (by default) passed by value, not by reference. Detractors refer pejoratively to VB.NET as Visual Fred or DOTNOT. One major complaint was that "edit-and-continue", the ability to fix bugs by changing source code in a running program when it is paused at a breakpoint and continue running the code, had been eliminated: this feature was a major productivity aid that had attracted many developers to VB6.

Many of the changes were necessary because they needed to reflect differences between Windows Foundation Classes and equivalent classes in the .NET framework (e.g., for user-interface controls): in addition, certain changed features, such as restricting the scope of local variables to the block where they were declared, and passing parameters by value (which is the only means permitted in Java) make code less error-prone. Reduced risk of error was also the justification for removing features such as computed gosub/goto and the elimination of line numbers (both a legacy of the BASIC language's FORTRAN heritage.) In general, the idea was to make the .NET libraries, rather than language-specific libraries, perform most of the work, so that code written either in VB.NET or C Sharp would compile to almost identical intermediate-code.

However, many of these semantic changes were not backward-compatible with much existing code, and existing code required rewriting and testing, a significant expense when the body of code was non-trivial in size. As author Joel Spolsky noted, "It was the first time a Microsoft upgrade did not respect the work that users did using the previous version of a product."

To Microsoft's credit, Visual Studio supported some degree of automatic translation to VB.NET when VB6 code was pasted into Visual Studio. Also, the VB.NET compiler reported multiple errors (up to a user-specified threshold - e.g., 100 errors) all at once instead of one at a time, with fixes to the source reducing the error list through a process of background compilation. Despite this, adoption of VB.NET was still delayed until 2005, when Microsoft finally reintroduced edit-and-continue: this feature was also made available to C sharp developers.

It is simpler to decompile languages that target Common Intermediate Language (CIL), including VB.NET, compared to languages that compile to machine code. Tools such as .NET Reflector can provide a close approximation to the original code due to the large amount of metadata provided in CIL. This is also true of early versions of Visual Basic (prior to VB5), which could not compile to native code.

Visual Basic 6.0 programs that are mainly algorithmic in nature can be migrated with few difficulties, but certain types of code are more troublesome, namely :

  • Database support: .NET's framework for database access, ADO.NET, emphasizes disconnected operations, which use database-server resources as economically as possible by releasing them when not in use. This results in more scalable code than if the older Data Access Objects or ActiveX Data Objects were used, but the code is also more complex.
  • Graphics: .NET has new (and more powerful) libraries for graphics.
  • Unmanaged operations: .NET, like Java, emphasizes security, so unmanaged code is used only as a last resort.

Other syntactical differences relate to changes made to bring VB.Net into alignment with other .Net languages, such as zero-based arrays (all .Net arrays are 0 to n-1 subscript, whereas classic VB arrays were one-based by default, 1 to n subscript), and structured exception handling (classic VB used a proprietary ON ERROR mechanism); such changes can be difficult or impossible to convert automatically, and converters typically flag such problem areas for manual conversion.

In addition, the required runtime libraries for VB6 programs are provided with Windows 98 SE and above, while VB.NET programs require the installation of the significantly larger .NET Framework. The framework is included with Windows 7, Windows Vista, Windows XP Media Center Edition, Windows XP Tablet PC Edition, Windows Server 2008 and Windows Server 2003. For other supported operating systems such as Windows 2000 or Windows XP (Home or Professional Editions), it must be separately installed.

Microsoft's response to developer dissatisfaction focused around making it easier to move new development and shift existing codebases from VB6 to VB.NET. An offering in 2005 was the VBRun website, offering code samples and articles for:

  • Using VB.NET to complete tasks that were common in VB6, like creating a print preview
  • Integrating VB6 and VB.NET solutions (dubbed VB Fusion)

Read more about this topic:  Visual Basic .NET

Famous quotes containing the word criticism:

    Like speaks to like only; labor to labor, philosophy to philosophy, criticism to criticism, poetry to poetry. Literature speaks how much still to the past, how little to the future, how much to the East, how little to the West.
    Henry David Thoreau (1817–1862)

    ... criticism ... makes very little dent upon me, unless I think there is some real justification and something should be done.
    Eleanor Roosevelt (1884–1962)

    Unless criticism refuses to take itself quite so seriously or at least to permit its readers not to, it will inevitably continue to reflect the finicky canons of the genteel tradition and the depressing pieties of the Culture Religion of Modernism.
    Leslie Fiedler (b. 1917)