C# or VB.NET

feurich

Centurion
Joined
Oct 21, 2003
Messages
170
Location
Holland
Hi there,

I'm having some thoughts about switching to C# for writting my applications.
But I can't find a really good reason for switching.
Can someone explain to me when to write a project in C# or when to write it in VB.NET ?

Cire :D
 
The short answer is just use the one you're more comfortable with (or the one your company says is the standard, as is my situation).

Both sides have their good points, but here's some I've noticed in working both sides of the argument:

C# only allows for one indexed property per class (see Indexers in MSDN). In VB.net, you can have as many as you want.

Background compilation - VB.net has it, C# doesn't (so those darn blue-squiggly lines don't go away until you do another compile).

C# doesn't do much implicit casting for you, which I think is a good thing as you really have to think your logic out and realize what it is you're doing.


Now, before this thread gets crazy, I'll just head for cover... :cool:
 
mocella is right, with which language you feel more comfortable??? I'll go for C#, that's because we develop here using C++, I don't like that much VB, but I've to say it has many features C# doesn't
 
So what your saying

So actually what you both are saying is that c# hasn't got alot of advantages over VB.NET. Actually VB.NET has some over C#.....
But then the question risses why is there C# ...this is actually the question i'm asking myself. I think in reflection on what has been said in this post there are no real technical reasons for C# to exsist only commercial reasons.
Please correct me if i'm wrong.

:rolleyes:

Cire
 
C# does have a few features that are missing from VB - operator overloading, conversion function overloading, a more efficient event dispatch syntax, support for the using statement with IDispatch are a few that spring to mind.
 
When I first started looking at .NET I rather had the same question as you did. Over the past bit while looking into things this is how I have come to view things.

VB.NET has an appeal to those who used VB before .NET. C#.NET has an appeal to those who have used C/C++.

C#.NET was written from the ground up as a new language for the .NET environment. VB.NET is really VB written for the .NET environment.

Personally I won't attempt to make a statement claiming one is superior over another or anything like that as I am not sure it is ever possible to defend that type of statement. Each language has some things the other doesn't but that doesn't make one superior over another.

What the folks have been saying is true, go with the one you are most comfortable with depending on what your prior background is. I'm in the process of learning C# but I'll most likely also pick up VB.NET as well, just depending on how some projects go for me. I've not programmed in VB before, but I've done basic, business basic, even bbx coding. I've also worked in c/C++ so I don't mind learning both C# and VB.NET as they are just some of the many languages I have had to work with over time.
 
On my part I prefer C# because it's less heavy as syntax and I also love his case sensitive part (some hate it hehe).

What I also like is that you don't have to EXPLICITLY specified that a conversion of INT toward STRING must be explicit (Option Explicit in VB) and that you MUST also declare all your variable (Option Strict am I wrong?).

I like that a language is less "user-friendly". It's not a little walk in a park ! It's programming ! Enterprise will propably work with your program ! Don't let the work to a "user-friendly" don't understanding programmer who prefer not to write more line not be sure that the program EXACTLY does what you want.

N.B.: This last paragraph was pure opinion. Everyone who feel concerned, send me a private message. And girls... want a lunch with me ? :D
 
You're right... on my part... I wished to learn VB.NET only to have one more language in my CV. But I learn C# for the pure fun of programming. For me... VB.NET = Newbie and C# = Pro. Just like VB6 means Easy and C++ means Hard.

What's life without challenge !?
 
Arch4ngel said:
You're right... on my part... I wished to learn VB.NET only to have one more language in my CV. But I learn C# for the pure fun of programming. For me... VB.NET = Newbie and C# = Pro. Just like VB6 means Easy and C++ means Hard.

What's life without challenge !?

My opinion is simple, the most important or programming challenge for me are come from design, industry knowledge... but not programming language
 
Ya you're part right ! Design is really important for the user who'll use this program. If he don't understand what he see ... it's finish !

However... as you might see... some component create difficulty to beginner. Even if they are more practical in some situation, beginner will go on much easier components (remember the famous label and textbox !? :D). So maybe they can also create a good design... but if they are programmaticly dumb and can't understand this component and don't rush on it to understand it... they're still dumb.

Remember... anyone can create a good design. Even an artist can create one with basic component. But it's the programmation behind all this design that matters.

Want a good design !? Go see an infographist.
Want a good program !? Go see a programmer.

However... the programmer can also do a good design with what he have.
 
I think bungpeng was refering to software design, not UI design. I tend to agree with him on this one - getting the software correctly designed and planned is a lot more important than choice of language, especially under .Net where most languages are very similar in what they can do.
Vb.Net isn't really that much easier than C#, the core principles are the same, the basic language structures and runtime support are the same. This is one of the ideas behind .Net - allow people to choose the language that suits them rather than force them into a particular language. People can focus on solving problems rather than struggling with a language they don't like.
 
Foundation

What I would like to know is when the code from C# or VB.NET is translated by the MSIL for the JIT-Compiler(runtime engine), is there any difference between the code from C# or VB.NET ?

Is there less code when translated from C# or more code ?

This makes one language faster then the other when running it.
Or am i talking BS here.....

:-\
 
The output from any .Net compiler will generate similar, but not exactly the same MSIL, for a given construct. Some things seem to be slightly more optimised in C# than VB but other things are vice versa....
The JIT compiler will generate its machine specific code from this MSIL so again there will be slight differences. Not sure how much this will add up to performance wise though. If you are using VB simply avoiding the VB language elements that have .Net equivalents and always ensuring Option Explicit is on and Option Strict is on will force you to write code with correct type conversion etc. This can result in more optimal MSIL being generated.
Also remember that as .Net matures the language compilers will get more tuned as will the JIT engine itself.
 
PlausiblyDamp said:
I think bungpeng was refering to software design, not UI design. I tend to agree with him on this one - getting the software correctly designed and planned is a lot more important than choice of language, especially under .Net where most languages are very similar in what they can do.
Vb.Net isn't really that much easier than C#, the core principles are the same, the basic language structures and runtime support are the same. This is one of the ideas behind .Net - allow people to choose the language that suits them rather than force them into a particular language. People can focus on solving problems rather than struggling with a language they don't like.

PlausiblyDamp totally got my points!!!
 
Back
Top