C#.NET vs VB6

jace808

Freshman
Joined
Jul 6, 2003
Messages
37
Location
SC, USA
Most everyone I work with is fluent with VB6 and that's what we right most of our tools with. I myself want to move to C#. However, my boss told me that it's not gonna happen and we must all keep with VB6 since it's what we all know. He did tell me if there were some major reasons that we should all switch over to .NET then it may be a possibility. I have already started learning C# and feel like I've waisted my time. I don't know enough about C# and .NET to be able to give him any advantages. So would you kind people please give me some reasons that .NET is more powerful/useful/advantagous(sp?) over VB6?
 
  • It's fully object oriented, like C++. All data types are classes (even String and Integer and the like), giving you much more control over how they are used.
  • .NET assemblies (DLLs in this case) do not require registration with regsvr32, eliminating the concept of "DLL Hell" that was almost unavoidable when using many COM DLLs. .NET assemblies simply need to be included with your application for them to be used.
  • It comes with a wide variety of objects that VB6 did not have. Regular expressions, GDI+ (graphics library), ADO.NET, XML readers, full Socket implementations, printing functionality and support for streams (which can be used for sending and receiving data over networks, to hard drives, through memory, etc) are just a few examples.
  • The .NET framework is, in theory, cross platform. If you write a fully .NET Framework compliant program (i.e. without Win32 API or unmanaged code), then it should, with minimal changes, compile on another implementation of the .NET framework for another operating system. This may not apply to you right now, but it's still good to know that if you need to move away from Windows, your code doesn't become totally useless.
Just some examples. :)
 
You could also talk to your boss about moving to VB.NET instead of C# as I think he would think about that more becuase from what you say it seems he likes VB6.
:)
 
VolteFace said:
  • It's fully object oriented, like C++. All data types are classes (even String and Integer and the like), giving you much more control over how they are used.
  • .NET assemblies (DLLs in this case) do not require registration with regsvr32, eliminating the concept of "DLL Hell" that was almost unavoidable when using many COM DLLs. .NET assemblies simply need to be included with your application for them to be used.
  • It comes with a wide variety of objects that VB6 did not have. Regular expressions, GDI+ (graphics library), ADO.NET, XML readers, full Socket implementations, printing functionality and support for streams (which can be used for sending and receiving data over networks, to hard drives, through memory, etc) are just a few examples.
  • The .NET framework is, in theory, cross platform. If you write a fully .NET Framework compliant program (i.e. without Win32 API or unmanaged code), then it should, with minimal changes, compile on another implementation of the .NET framework for another operating system. This may not apply to you right now, but it's still good to know that if you need to move away from Windows, your code doesn't become totally useless.
Just some examples. :)

Copy, Paste, and Email the boss. :D Some good thoughts there... mine if I plagarize a bit? :D:D:D
 
mutant said:
You could also talk to your boss about moving to VB.NET instead of C# as I think he would think about that more becuase from what you say it seems he likes VB6.
:)

And see that's the thing... we all have VS.NET for install and a few have installed and started playing with VB.NET and from what I understand if you write code in say VB.NET then it will translate directly to C# and vice versa. I told my coworkers that and they had a valid argument... comments would be lost and the code wouldn't be as nicely formatted and organized. :(
 
Due to C#'s "freestyle" nature, code that is written in C# can generally look much nicer than code written in VB.NET. However, on the other extreme, it can also look horrendous, moreso than VB.NET. :p You just need to put time into it. And generally you wouldn't bother converting the code. You can mix different kinds of projects into one solution; you could make DLLs in C# and use them in VB.NET. This is useful because C# and VB.NET do have some slight differences; for example, C# supports operator overloading and unsafe code blocks (allows you to use pointers within C# code, C++ style), while VB.NET has more ease of use when working with events, among other things. The diversity in the .NET languages can come in handy, not only in terms of functionality, but people coming from just about any previous languages can feel at home; people who are used to C-style syntax will feel comfortable with C#, people who are used to the BASIC style of syntax will be more comfortable with VB.NET.

However, I recommend starting with C# if you are just beginning. For whatever reason, VB.NET provides a set of VB6 compatability functions that work like the previous ones in VB6. For example, you can use Mid(string, 2, 4) like you could in VB6, but the "good" way to do it is string.Substring(2, 4). The Mid function is part of the Microsoft.VisualBasic namespace, which is provided mostly for backwards compatability and should generally be avoided. This can be very confusing to newbies, and cause them to develop bad coding habits if they get into the habit of using the old familiar VB6 methods. Thankfully, C# does not provide these compatability functions, and so it forces you to get used to developing .NET Framework compliant code.

And yeah go ahead and send that stuff to your boss. :)
 
I personally think having only one language with a group of developers is better then having 2. Everything goes most smoothly becuase you dont have to convert code from one to another just to see excetly how it works. I suggest everyone from your workplace gets together you talk about moving to the preferred language.
:)
 
Personally I think it's a bad idea to argue for a language when you know nothing about it. You should learn the language well enough to make arguments for it based off of your own experiences. If not how are you going to argue against VB6 when a co-worker says "but with VB6 I can do this, this and this with such and such performance."
 
Mutant: VB.NET and VB6 are two different languages IMO. VB6 code does not convert "smoothly" to .NET.
 
wyrd said:
Personally I think it's a bad idea to argue for a language when you know nothing about it. You should learn the language well enough to make arguments for it based off of your own experiences. If not how are you going to argue against VB6 when a co-worker says "but with VB6 I can do this, this and this with such and such performance."

Point taken Wyrd... the thing is... in my mind C++ is a powerful language in my mind while VB is just a "n00b" language. With this in consideration I know C# is going to be better I just don't know why. :D

It's like I've heard of a Lamborghini and I've even seen a Lamborghini, but I've never driven one, but I know it would be superior to my Dodge Intrepid. :P
 
That Lamborghini also costs more, has higher insurance, and breaks down far more then your sturdy Dodge Intrepid which gets the job done at a much lower cost.

You need to fully understand what you're getting into before diving in head first. Otherwise you could find yourself trapped in quick sand.
 
All languages in Microsoft .Net are identical except for C++ and minor function differences(Microsoft.VisualBasic, etc) between languages. All .Net languages compile to MSIL therefore are exactly the same, its just the syntax of your choice. You like VB use VB.Net, you like C syntax use C#, you can mix and match as has already been said though.

C# has no real advantage over VB.Net apart from the unmanaged pointer handling and operator overloading.

Maybe you can see if you can get your boss to buy a book of C# and a book on VB (So the company pays for it) and see which one you like better, it'll also show the new features of VB that its been given as part of .Net too
 
Last edited:
AndreRyan said:
All languages in Microsoft .Net are identical except for C++ and minor function differences(Microsoft.VisualBasic, etc) between languages. All .Net languages compile to MSIL therefore are exactly the same, its just the syntax of your choice. You like VB use VB.Net, you like C syntax use C#, you can mix and match as has already been said though.

C# has no real advantage over VB.Net apart from the unmanaged pointer handling and operator overloading.

Maybe you can see if you can get your boss to buy a book of C# and a book on VB (So the company pays for it) and see which one you like better, it'll also show the new features of VB that its been given as part of .Net too

See that's the thing... I've bought 3 C# books ($130.00) out of my pocket(takes too long to get stuff when working for the goverment) and have gone through about 300 pages. I never seen C++ before so this was my first experiance with C period. What I saw was so much more than VB. Less time coding and more organized structuring. I find it hard to even go back to VB projects now... I was really digging the C# solution. :(
 
jace808 said:
See that's the thing... I've bought 3 C# books ($130.00) out of my pocket(takes too long to get stuff when working for the goverment) and have gone through about 300 pages. I never seen C++ before so this was my first experiance with C period. What I saw was so much more than VB. Less time coding and more organized structuring. I find it hard to even go back to VB projects now... I was really digging the C# solution. :(

VB.NET is not the same as VB6. C# is not the same as C++. C# and VB.NET are almost identical except for syntax. When working with .NET you should only be considered with learning the .NET framework, not the syntax of the language.

I think you're confused that C# is in some way related to C++, and VB.NET is no different then VB6. Either is not true.

If you learn C# your time is not wasted if you wanted to do VB.NET instead. Once you learn how to program in the .NET framework, switching between VB.NET and C# isn't a big deal.

If you're going to get a VB6 company to transfer to .NET, your best shot is to argue the use of VB.NET over VB6.
 
My company have recently made the switch from VB 6 to .NET Development.

I understand if you write code in say VB.NET then it will translate directly to C# and vice versa

Although true there are tools out there, which will do this... I wouldn't sell it as a major benefit by far the best one is you can debug and step through code seamlessly through languages.

I also wouldn't focus on converting the whole team in one go... how we eventually changed was small applications for clients, which proved to be much easier to write in C#.

Next time a small project comes up weigh up what is the best language to write it in... suggest writing in .NET.. Only really works for small applications otherwise risk of failure to your boss is too great. Start working in your own time on little applications related to your line of work, and show these to your boss.
 
Thanks for all the different input guys. :D I'm very glad to have found this forum. You all seem very knowledgable and insightful to the whole .NET schema so I will have to take to heart what most of this thread has to say. Thanks again. :D My vision is much clearer now and I feel I know where I need to go with this now. :)
 
Back
Top