Fadi Nassri

we r about to start developing a new project

som of the team dont know C# and know Vb.net

if the syntax is the only different, No problem to use VB.net

can any one tell me if there is any different.

thank you




Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

Suprotim Agarwal

Hi,

Language, be it C# or VB.NET, should be seen as only a tool to accomplish a task. The main objective is to be able to capture the business requirements properly Smile

Check this link to get a detailed comparison.

HTH,
Suprotim Agarwal

-----
http://www.dotnetcurry.com
-----






Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

Fadi Nassri

thank you

i want to know if there is any different in concepts like:

inheretance, pointer, opject orianted concepts, data type .........

because I used to C#.






Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

Suprotim Agarwal

Hi,

I believe most of your doubts related to data types, inheritance etc will get solved once you read that article.

HTH,
Suprotim Agarwal

-----
http://www.dotnetcurry.com
-----






Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

vinoth kumar.R

Apart from syntax there are lot of advantages in c#.

it is better to choose c# instead of vb.net






Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

David Anton

A lot Then list some of them.

I can only think of three: anonymous methods, assignments within expressions, and unsafe code. The first two can be worked around in VB, while the third is avoided by most C# programmers.

VB also has a few syntax features not available in C# (types within interfaces, properties with parameters, and static local variables). Again, these aren't important enough to affect the language choice.

But the differences do not amount to much. The main reason to choose C# over VB, or VB over C#, is style preference - choose whichever will make more of your developers happy. Or use both - the C# developers produce C# assemblies, while the VB developers produce VB assemblies.






Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

Zamial

C# is the preferred choice by the 'better' programmers and as such over time C# developers get paid more than VB developers for the same work, whilst this is fundamentally unfair that's how the market works.

So C# is the more lucrative choice and there are more jobs available in C# in the UK

C# is case sensitive.

C# forces you to think more about what you are doing as it never lets you get away with it. VB I believe does alot of implicit castings where C# will not compile.

But really it's all about the Framework and the IDE and C# and VB are too similiar to worry. I believe VB allows optional parameters and C# does not.

I prefer to be called a C# proggie instead of basic Smile. It's totally personal preference and depends on your background, or may be more it depends what the market in your area wants. Play smart go where the work and the money is cause the difference between them is minimal.

Assignment and Equality differ in each language (syntax mind you)

C# offers unsafe code but i'm not sure if it's restricted to C# only.

There is more reasons but there pointless imo, you just make your choice. I suggest C# if your in the UK.

Finally I would like to share a quote with you that will stick with me forever regarding the subject of case sensitivity.

In C# of course Robert and robert are not equal to each other and in VB you cannot do that as robert will become Robert.

I heard people argue that English is not a case sensitive language either and hence VB is not. The following quote shows case does matter.

"and the gentleman helped my uncle Jack off the horse".

"and the gentleman helped my uncle jack off the horse".

I hope that proves that case sensitivity does matter Big Smile





Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

JohnWein

Syntax is the only difference, no problem using VB.net or C# or C++. If you target the .Net Framework any of the languages can accomplish the same thing. I think it is easier for a C# programmer to use VB syntax than for a VB programmer to use C# syntax. In the Visual Studios you can mix an match projects written in differenct languages, so it should not hinder a program to have portions written different languages.





Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

IsshouFuuraibou

There are some differences in the languages themselves in how they behave with some things:

Like was said, VB has Optional parameters where as C# provides parameter overloading

One suprising difference is the way switch statements are handled. In VB they are run-time based comparisons (from what I've found) but in C# they are compile-time hash table indexed jumps (in other words, it doesn't execute each case statement until it finds the proper one during runtime). This means that in C# a switch/case code does not work the same as a VB switch/case code.

Other than things like that, they are pretty much the same: They both utilize the base class library which is the same regardless of language it is used in. (see article about differences, and another)

There used to be more differences in flow control, being able to have unsigned integers in VB, using declaration ( using( object ) { .. } ).

So it really depends on the scope of the application: it might be best for it to be done in one language (small project) or for you to utilize the resources you have and develop a modular project using VB.Net and C#.Net and have the parts utilized inside the project (large project). One thing to be careful is that if you make a C# assembly for use in VB.Net you'll have to program such that nothing accessable to the VB.Net differs by only case.





Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

H. Tony

a few days ago some one also asked about VB.NET local static variable, which is not supported in C# but implemented as a 'hack' in VB.NET, which is another difference. it's more than just syntax.





Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

David Anton

Local static variables are not unique to VB - C++ also has them (as well as other VB 'hack's like default parameter values). C# attempts to clean out some of these, since there are work-arounds, but you should be aware that many parts of VB that appear to be VB hacks or strangeness also exists in C++.






Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

ImDaFrEaK

No, it only proves that the writer lacks the knowledge to properly use commas. Smile






Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

ImDaFrEaK

Both VB and C# are compiled to the CLR (Common Language Runtime). Therefore neither are actually running in realtime in the language you program them at to start with. It takes milliseconds or whatever to compile either language and the rest is up to the system. In .NET all languages are equal. They hold the same access to .NET as the other and the objects work exactly the same. Differences are within the language itself such as syntax and initializing ect... Some Objects such as value types initialize different in C# than VB. Just know the differences to do what you need to do and you will get the same results. VB also allows late binding which I always turn off but can allow you to work more as if you were scripting. Either way. I do both. They are both fun languages. C# will make you feel like you know more b/c of the syntax, early binding, ect... but VB is much faster and easier to write for especially in VS 2005 b/c the IDE helps you pick up on mistakes as you are typing. Choose either and have fun! Smile There are hundreds of differences but they actually perform the same Smile






Re: Visual C# General Is there any different between VB.net and C#.net other than Syntax?

sriesch

JohnWein wrote:

In the Visual Studios you can mix an match projects written in differenct languages.

If you plan to mix and match C# and VB, keep in mind that VB allows optional function parameters but C# does not, so it might not be seamless and you might need to do some tweaking to actually get the two to work together. (Just encountered this recently when I tried to reference a function in a .dll written in VB from within a C# program, and could not without specifying the optional argument.) Not sure how many other obstacles like this there might be out there.