C# or VB.NET

feurich

Well-known member
Joined
Oct 21, 2003
Messages
168
Location
Holland
Hi there,

Im having some thoughts about switching to C# for writting my applications.
But I cant 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 youre more comfortable with (or the one your company says is the standard, as is my situation).

Both sides have their good points, but heres some Ive 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# doesnt (so those darn blue-squiggly lines dont go away until you do another compile).

C# doesnt 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 youre doing.


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

So actually what you both are saying is that c# hasnt 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 im 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 im 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 wont 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 doesnt but that doesnt 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. Im in the process of learning C# but Ill most likely also pick up VB.NET as well, just depending on how some projects go for me. Ive not programmed in VB before, but Ive done basic, business basic, even bbx coding. Ive also worked in c/C++ so I dont 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 its less heavy as syntax and I also love his case sensitive part (some hate it hehe).

What I also like is that you dont 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". Its not a little walk in a park ! Its programming ! Enterprise will propably work with your program ! Dont let the work to a "user-friendly" dont 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
 
Youre 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.

Whats life without challenge !?
 
Arch4ngel said:
Youre 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.

Whats 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 youre part right ! Design is really important for the user wholl use this program. If he dont understand what he see ... its 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 cant understand this component and dont rush on it to understand it... theyre still dumb.

Remember... anyone can create a good design. Even an artist can create one with basic component. But its 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 isnt 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 dont 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 isnt 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 dont like.

PlausiblyDamp totally got my points!!!
 
Back
Top