Computing.Net > Forums > Programming > VB.net or C#?

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

VB.net or C#?

Reply to Message Icon

Original Message
Name: jhunt303
Date: February 14, 2006 at 07:45:33 Pacific
Subject: VB.net or C#?
OS: XP
CPU/Ram: 2.8/1024
Model/Manufacturer: HP
Comment:

Having read that Delphi is being sold and will (most likely) disappear, our company is looking into an alternative IDE for small database apps.
Any comments on the advantages of VB over C# and Visual Studio are most welcome!


Report Offensive Message For Removal


Response Number 1
Name: SN
Date: February 14, 2006 at 08:22:52 Pacific
Reply: (edit)

It depends on which version you use...But if you use the latest version (.NET 2.0 & VS 2005), there's not that many significant differences between the two languages...They mostly differ in syntax, and the average C# developer is perfectly comfortable writing VB.NET code, and vice versa. VB.NET has some shortcuts like 'With' and 'My', but C#, being modeled after C++ and Java, is a more terse language in general (It doesn't have the cumbersome Next, Then, Loop, End If, et al).

In 2003, VB.NET lacked the intellisense support for describing methods, classes, and parameters in xml comments that C# had, but they leveled the playing field in '05.

Personally, I prefer C# syntax for these reasons:
1. Ternary operator: ?: - much better than IIF.
2. Shorter, but equally clear, syntax. Dim x as Integer as opposed to int x.
3. Multi-line comments /* comment*/
4. Multi-line strings, string escape characters, and the @ string operator.
5. Multi-line commands without having to use the line extender character '_'.
6. C# allows you to specify parameters as output parameters (keyword out), which lets you pass values in without initializing them.

VB.NET has some goodies (optional parameters, My, and With, as well as the fact that VS macros are written in VB.NET), but all in all it is intended to ease the suffering of VB6 programmers coming into .NET, not as the primary choice for people switching platforms entirely like you are.

For a syntactical comparison, See this handy VB.NET and C# comparison.

Good luck,
-SN


Report Offensive Follow Up For Removal

Response Number 2
Name: jhunt303
Date: February 14, 2006 at 08:50:18 Pacific
Reply: (edit)

Thanks SN, that link is excellent. What are your thoughts on VisualStudio 2005?


Report Offensive Follow Up For Removal

Response Number 3
Name: SN
Date: February 14, 2006 at 09:07:29 Pacific
Reply: (edit)

I've been using it since November 7th, the day it was released. So far, I've been very happy with it. The compile and continue is less helpful than I envisioned, but it's still very handy. The watch features have been very nicely improved, and if you're doing windows forms applications (which I assume you are, coming from delphi), you're going to love the new ClickOnce deployment technology...After having spent literally hundreds of hours writing my own for version 2003, seeing that Microsoft did it in v2005 was bittersweet.

But by far the feature that I like best in .NET 2.0 is the introduction of generics. I'm a huge fan of strongly typed languages, and generics allow you to enjoy the benefits of strong typing while gaining the flexibility of weakly typed scripting langugages. The new System.Collections.Generic namespace is my new best friend.

-SN


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software