VB6, VB.NET and dynamic typing

A recent reader emailed to wax poignant about VB6, and ask about dynamic typing – among other things – in VB.NET.  although I feel that static typing has a more firmly established place than ever in software development, I commiserated with him in this response:

A lot of people agree with you.  There is even a well-established petition at http://classicvb.org/ that states these and a lot of other problems with VB.NET, and the .NET Framework in general.

However, you have to remember that VB.NET is a language, and VB6 is a program, language and framework all in one.  As I pointed out in Chapter 1, they are designed to do different things.  A lot of the things that you could do in VB6 are considered bad practice now, due to scalability and other issues, although many are coming back into vogue. 

For instance, you point out the Variant issue.  What you are saying here is that VB6 is dynamically typed and VB.NET is strongly typed.  Coding for a strongly typed system is a lot slower than for a dynamically typed system.  You will, however, have a lot fewer errors with a statically typed system because any typing issues will usually be caught at compile time.

I have always found it interesting that many community members belittle VB6 for being a 'hack' out of one side of their mouth, and then extol the speed and ease of Ruby out of the other side of their mouth, never realizing that the dynamic typing system is a common defining characteristic of both 'languages'. 

I should add that dynamic typing is coming back in VB10 (as it is in C# 4.0) with the dynamic language runtime.  Hopefully that will return some of the flexibility to the language that you are looking for.

Comments are closed

Bill Sempf

Husband. Father. Pentester. Secure software composer. Brewer. Lockpicker. Ninja. Insurrectionist. Lumberjack. All words that have been used to describe me recently. I help people write more secure software.

PageList

profile for Bill Sempf on Stack Exchange, a network of free, community-driven Q&A sites

MonthList