C# vs. VB for windows development?

Status
Not open for further replies.
So I'm trying to decide to which language I should commit my time. Microsoft seems to promote C# as a replacement for VB, but they are still actively promoting/developing VB. I've done some research on this, but I would appreciate any opinions from the Ars community.

Maybe I'm barking up the wrong tree? Is Java or C++ a better solution?

If anybody has some book recommendations it would be appreciated as well.

Thanks.
 

HitScan

Ars Tribunus Militum
2,523
Subscriptor++
If you're talking C# vs VB.Net, then it really doesn't matter unless you need a feature that only one of them has, or prefer the syntax of one over the other. They're basically the same language (most constructs compile into the same IL code) You could also look into Managed C++, or regular C++, play around with a few simple programs and decide on your own. (that's the best way, really. :) )

HitScan
 
If you currently program in VB, then VB.NET may be more familiar.

If you've had any experience with C-based languages (C, C++, Java, Objective C) you'll probably prefer C#.

The two languages have almost identical feature sets (only one difference as far as I can tell: VB does not support operator overloading)

C# is superior to Java for Windows development. If you want cross-platform (it doesn't sound like you do), either use Java or wait for the upcoming .NET ports to other OS's (I know of three projects in the works).

I personally started programming in VB3, took a six year break, dabbled in C++, learned Java, and now program exclusively in C#. I personally find VB to be too loose for my tastes; you may not agree.
 
But it does support optional function parameters...
Operator overloading is very different from function overloading (which is similar to the optional function parameter thing you're talking about)

Operator overloading defines an operator, like addition or subtraction. I can create a "Fraction" class, define the addition operator, and write this:

Code:
Fraction myFract1 = new Fraction(5,4);//   <-5/4
Fraction myFract2 = new Fraction(2,3);//   <-2/3

Fraction Sum = myFract1 + myFract2; // Sum = 5/4 + 2/3 = 23/12
In my opinion, a language should not be considered fully OO unless it supports operator overloading, because without it user-defined types lack basic functionality that the base types enjoy.

It may not seem like much here in this example, but imagine having to replace every operator in a complicated mathematical function with a method call. The code quickly becomes unreadable.

I've had long, angry arguments with programmers who do not share this view, however...

[This message was edited by Thanatos on April 01, 2002 at 19:19.]
 

fejta

Ars Scholae Palatinae
844
Half the point of .NET is that you don't need to be tied down to one language.

There is no reason why you can't do most of your coding in one language, until you decide something else is easier in another.

Essentially every time you declare a class you can decide which language you feel will get the job done faster for that class.

That being said, getting proficient in C# will benefit you more if the time should ever come to move to another language, since almost all languages these days use syntax similar to C/C++.
 
Yes, Microsoft is pushing C# hard, but not necessarily as a replacement for VB. C# is Microsoft's attack on Java, hence their focus is on building support for it.

Which language to use will depend on what you want your programs to do. If it's going to be relatively simple applications that do the standard "get data from user; check data; add data to database; summarize data and spit out report" stuff, then either VB or C# will be fine. However... if down the road a few months, or years, you expect that you might be pouring over books looking for some Windows API call that will let you do some funky out-of-the-ordinary stuff, then I suggest you go with C#. Because the APIs were written with C++ in mind, and the syntaxes match up better. (That's not to try to say you can't do it in VB; you can. Just takes a little bit more work.)
 

DaleDBeast

Wise, Aged Ars Veteran
172
...In my opinion, a language should not be considered fully OO unless it supports operator overloading,...

Here we go again with the "OO purity" demagogeries. Please do your part to relieve your brother programmers across the world from another useless "shouting mules" contest.

On topic, I started in C way back when, moved to VB for 10 years, recently migrated to C#, and am now doing VB.net, because I found that outside of having unmanaged code in C#, it really doesn't matter between the two. EVEN when accessing the Win32 API.

A C# program can only be intrinsically faster than a VB.net program when it's not really a C# program at all, but embedded Assembler or C. Don't let anyone tell you different.
 
Status
Not open for further replies.