Me, You and Design Patterns in VB.NET
page 2 of 2
by David Simmonds
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 18041/ 28

Design Patterns in VB.NET – A Castle in a Ghetto?

VB. NET as a serious language

Almost every VB.NET programmer has been plagued with passionate pleas to “Learn C# and save your career!”  So some folks might be wondering if I am some kind of pied piper leading them further down the “wrong road” with this tutorial.  They might be asking, “Why a Design patterns tutorial in VB.NET?”  After all, design patterns are an advanced topic for serious enterprise developers, right?   Should not this topic be discussed in the domain of C#, C++ or Java?  So even though you have a history in VB and lots of experience in it why not just give in to the pleas and go with C# as a serious developer?

Well, because the concept of C# as a more serious language is an absolute fallacy.  Most of the literature I have read comes to a point in the language-choice when the author boils it down to the issue of comfort level.  VB6 versus Visual C++ was a big issue because VB6 was not object oriented.  However, in the .NET incarnation, VB has come of age and is fully object oriented and so VB versus C# is a non-issue.

Why the stigma?

One of the problems with Visual Basic is the “BASIC” part of the name (and it does not help either that the B stands for Beginners!).  There is also the long partial OO legacy.  Then there is the supposed carryover of undesirable, unstructured features from VB6 (like weak type checking).  Well, I think Microsoft can solve this problem easily.  Name the thing Visual B or Visual B++ or B# or something else that distinguishes it; anything to prevent people from having to go to group therapy because their career is built on something “BASIC.”  Now granted, Microsoft has not helped with a few regressive moves like allowing programmers to use win-forms without declaring them, harking back to VB6 days.  However, complaining about that sort of thing is like saying you do not want to come and enjoy a sunny Jamaican vacation because you are married and Jamaican women are too beautiful.  Well, enjoy the vacation and resist the temptation. Simple… right? J 


V for verbosity?

I am a verbose person, VB.NET is a VerBose language.  Quite frankly, that is why I like it.  I am someone who uses variable names like “ForeignCurrencyConversionRate.”  You have to remember that with a simple press of CTL-spacebar, you can bring up your variable names.   Putting your classes into namespaces also helps to quickly access your classes.   Therefore, long variable names and class names are not that big a deal.  Sure it makes it easier to reverse engineer when you build to IL, but then there is obfuscation software available to help you prevent this; so even that is not a big deal.


VB.NET versus the “serious alternative” C#

VB.NET was made for implementing AND demonstrating design patterns due to its very explicit nature.  With C# you know what is happening, but because of its leaning towards silence you can miss a trick or two.  The beauty of VB.NET for showing how design patterns work is its very verbosity.  At every turn it screams “This is what is happening in this statement” and so it is somewhat self documenting.  You do not have to worry, like you have to in C#, whether that little colon thingy has interface implementation or class inheritance behind it.  

What others think about VB.NET versus the “serious alternative” C#

Finally, I want to provide a comment from an author.  Here is the comment from Francesco Balena on the use of C# versus VB.NET:

Francesco Balena - Programming Microsoft Visual Basic .NET version 2003 

“ … .NET moves most of the functionality from the language to the .NET Framework itself.  For example, the .NET Framework includes classes for opening, reading, and writing text and binary files, so there is no point in having this functionality embedded in programming languages. … All .NET languages can use these classes, and therefore all languages have the same capabilities in creating applications with a rich user interface, without having to resort to low-level, advanced techniques such as subclassing. …  C# is actually a great language that takes the best ideas from other languages, such as C++ and Java. But the truth is that C# and Visual Basic .NET are roughly equivalent… The two languages have the same potential, so you are free to choose the one that makes you more productive. Execution speed is also equivalent for all practical purposes, because the C# and Visual Basic compilers generate more or less the same code.”


Why spend so much time defending VB and quoting authors who do not think that VB.NET is inferior to C#?  Well, writing about design-patterns in a 2nd class language would be a bit like building a mansion in the ghetto or a plaza in quicksand.  That is why I have made such an effort to assure you that VB.NET is very much 1st class.  If you are very good at VB.NET, then you do not need to learn some other language before taking your O-O skills to the next level.  Convinced yet?


Balena, Francesco. Programming Microsoft Visual Basic 2003. Core Reference, Microsoft Press, 2004. ISBN: 0735620598

Duel, Michael. Non-software examples of software design patterns. Object Magazine, Jul 97, p54.

Fischer, Tom, John Slater, Peter Stronquist and Chaur G. Wu. Professional Design Patterns in VB.NET: Building Adaptable Applications. Apress, 2003. ISBN: 1590592743

Gamma, Erich and Helm, Richard and Johnson, Ralph and Vlissides. Design Patterns, Elements of Reusable Object-Oriented Software. Addison Wesley, 1994. ISBN 0201633612

Holub, Allen. Holub on Patterns: Learning Design Patterns by Looking at Code. Apress, 2004. ISBN: 159059388x

Kuchana, Partha. Software Architecture Design Patterns in Java. AuerBach, 2004. ISBN: 0849321425

Tabor, Bob. 2400-video series, Learn Visual Studio.Net, 2003.


View Entire Article

User Comments

Title: What is this   
Name: Ashish Manasvi
Date: 2008-04-11 7:23:54 AM
I think people should post their article with proper headings. The heading of this article and the content are entirely different.
Why we have such things on this good website??
Title: Complete time waste   
Name: Deepak Sharma
Date: 2006-07-11 1:51:29 AM

I thought we are speaking on design patterns but here we see people trying to defend to c#.

With good site like yours, you should be careful having articles.
Title: Where's the beef?   
Name: Whoever
Date: 2006-07-06 2:58:14 PM
I was waiting for the actual discussion about each (or any) of the design patterns, utilizing VB.NET, but... Where is that? This seems like an article stating, "This is what I'm going to talk about, and why" but then doesn't actually go on to discuss any of that. Am I missing something? Is there a hidden link to a URL which DOES discuss any/all design patterns using VB.NET? This article does not seem to include any.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-07-23 5:35:05 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search