Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Any difference between VB.net and C#.net

1 view
Skip to first unread message

Jon Slaughter

unread,
Sep 28, 2006, 2:28:04 PM9/28/06
to
Is there any difference between these "languages" any more or are they just
syntactically different but represent the same thing? A long time ago VB was
more for "noobs" while something like C++ was for experts. While you could
also do one thing in the other it wasn't always easy. Seems now that .Net
has made these languages fundamentally the same but only syntactically
different?

Jon


Kevin Spencer

unread,
Sep 28, 2006, 2:56:22 PM9/28/06
to
All programming languages are fundamentally the same but only syntactically
different.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

A watched clock never boils.

"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...

Michael Nemtsev

unread,
Sep 28, 2006, 3:03:09 PM9/28/06
to
Hello Jon,

I'd add to Kevin that behaviour of some things are different in VB.NET and C#
I recomend to read O'Reilly ".NET Gotchas" book about these differences

JS> Is there any difference between these "languages" any more or are
JS> they just syntactically different but represent the same thing? A
JS> long time ago VB was more for "noobs" while something like C++ was
JS> for experts. While you could also do one thing in the other it
JS> wasn't always easy. Seems now that .Net has made these languages
JS> fundamentally the same but only syntactically different?
JS>
JS> Jon
JS>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


John J. Hughes II

unread,
Sep 28, 2006, 3:04:36 PM9/28/06
to
Both compile down to CLR so in concept there is no difference in the
resulting code. There might be a couple small things that might be easier
to accomplish in one or the other but I would suggest just using whichever
you are more comfortable in.

Regards,
John

"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...

Mark Rae

unread,
Sep 28, 2006, 3:10:07 PM9/28/06
to
"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...

> Is there any difference between these "languages" any more or are they

There is one fundamental difference - C# supports pointers / unmanaged code
and VB.NET doesn't. However, for the vast majority of programmers, that is a
non-issue...


Ignacio Machin ( .NET/ C# MVP )

unread,
Sep 28, 2006, 3:49:26 PM9/28/06
to
Hi,

"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...

> Is there any difference between these "languages" any more or are they
> just syntactically different but represent the same thing? A long time ago
> VB was more for "noobs" while something like C++ was for experts.

Not true. VB was good at a lot of things. I know lot of smart people (me
included) who were using VB back in the day. Developing ASP sites was a
charm with COM dll written in VB and VBScript for ASP.

A similar thing with win apps VB provided a fast, easy environment to
program.


Right now there is barely any difference between C# and Vb.net that you find
on a daily basis. Just the sintaxis , that IMO is much better in C# than in
VB


sloan

unread,
Sep 28, 2006, 4:06:57 PM9/28/06
to

Here is my list. My company was solely a VB.Net shop, and this is the list
used to show some differences.
Here is as concrete as I could get, with no commentary.
This way my best attempt. If there are workarounds, please politely list
them.
I'm not trying to start an old and dead horse war, just listing what
concrete items I have found.

This is a 1.1 list. Some may or may not apply in 2.0.


VB.NET has no "using" directive.


VB.NET does not do automatic namespacing. Whenever you put in a new folder
and/or class, C# puts in "namespace MyCompany.Technology.Args" for you.
In VB.NET you have to ~remember to put in "namespace
MyCompany.Technology.SomethingElse". Or everything defaults to the default
namespace.


VB.NET does not provide pre-build or post-build steps.
(there is a work around available for this , one is build rules ex
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=a3326eb3-a468-4f67-91a8-f84469fc49e2
)


VB.NET has no built-in comment->documentation generator
(see previous forum post about GhostDoc)
(there is a work around available for the default c# functionality, but
there is no equivalent GhostDoc feature)
See demo at
http://channel9.msdn.com/Showpost.aspx?postid=121822


VB.NET regions are not as flexible as c# regions.
The key here is that you can place a region ~~inside a function (in C#),
thus breaking up the implementation into logical pieces.

VB.NET does not allow the application the <NonSerialized> attribute to
events (you can in C# by using the Field: modifier).
As a result, there is no simple way of telling the runtime not to serialize
the event fields.
This results in serializing objects that you didn't expect, resulting in a
larger stream.
If the object handling the events is not Serializable, then the
serialization process will throw an exception.
( See http://www.codeproject.com/vb/net/serializevbclasses.asp for more info
and workaround )

VB.NET has less features with its static code analysis (as in, when you go
to Build / Build Solution).
Issues like : functions that don't return values, uninitialized variables,
unused variable declarations, etc...
Development time (in c#) is slightly decreased by finding these issues at
compile time.


VB.NET does not have ... Increments/Decrements. a++;a--;


VB.NET does not have operator overloading. C# has Operator Overloading.
(see http://www.csharphelp.com/archives/archive135.html)

VB.NET has no multiline comment syntax

VB.NET has no within-the-line comment syntax

VB.NET has no multiline string syntax

VB.NET has a limit on line continuations (I think the limit is 10?)


sloan

unread,
Sep 28, 2006, 4:08:29 PM9/28/06
to

PS

When asking the question, you may want to include.

Have you programmed in both?
What percentage have you programmed in C#? In VB.NET?

Some people make comments without experience in both, thus the differences
don't stand out to them.

"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...

Willy Denoyette [MVP]

unread,
Sep 28, 2006, 4:17:01 PM9/28/06
to

"Mark Rae" <ma...@markNOSPAMrae.com> wrote in message
news:%23HiD3Gz...@TK2MSFTNGP05.phx.gbl...

| "Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
| news:12ho51g...@corp.supernews.com...
|
| > Is there any difference between these "languages" any more or are they
| > just syntactically different but represent the same thing? A long time
ago
| > VB was more for "noobs" while something like C++ was for experts. While
| > you could also do one thing in the other it wasn't always easy. Seems
now
| > that .Net has made these languages fundamentally the same but only
| > syntactically different?
|
| There is one fundamental difference - C# supports pointers / unmanaged
code
| and VB.NET doesn't.


C# is managed code only just like VB.NET, it allows for unsafe code
contructs which allow some (restricted) pointer usage, but unsafe !=
unmanaged.

Willy.


Samuel R. Neff

unread,
Sep 28, 2006, 4:48:51 PM9/28/06
to

The differences in the languages are minor and sloan did a great job
summarizing them for 1.1 (most are no longer differences in 2.0).
However, we've found that there is a big difference in the _average_
VB.NET programmer vs the _average_ C# programmer.

C# programmers more often come from a C++ or Java background and are
more likely to have a strong understanding of CS in general and OOP in
particular.

VB.NET programmers more often come from a VB6 / VBScript background
and will often not have the same CS education and OOP experience.

Of course there are a log of great VB.NET developers out there, but
when talking about which language to choose for your organization the
programmers you'll attract by choosing C# vs VB.NET should be
something to consider.

Sam

------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.

(and yes we generally prefer a c# background over a vb.net background)

Mark Rae

unread,
Sep 28, 2006, 4:54:22 PM9/28/06
to
"Willy Denoyette [MVP]" <willy.d...@telenet.be> wrote in message
news:%23zMuRsz...@TK2MSFTNGP03.phx.gbl...

> C# is managed code only just like VB.NET, it allows for unsafe code
> contructs which allow some (restricted) pointer usage, but unsafe !=
> unmanaged.

You're right of course - I meant to say "unsafe"...

Apologies...


iwdu15

unread,
Sep 28, 2006, 9:31:02 PM9/28/06
to
l just add my 2 cents...

ive been using both for a couple years now, and using each differs per
situation, C# is a nice language that has some advantages and disadvantages,
as with VB. with these languages i think it comes down to mainly preference.
The only big detail i can think of is that VB writes alot of code for you. VB
is not case sensitive, which can be good and can be bad. Ive found that the
VB compiler does a better job at finding all errors at once then the C# one.
It also gives the exact location of errors, which is nice. C# however, as
stated earlier, gives access to unsafe code, which can be very useful if used
properly and when needed.
--
-iwdu15

james

unread,
Sep 29, 2006, 11:49:58 AM9/29/06
to

"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...

Not really to do with the differences - others have pointed out some of
those - but I moved from VB6 to VB.Net, then to C#.NET.

I found the VB6 to VB.NET jump a bigger one than subsequently moving onto
C#, so that might indicate how much the differences are...?


Samuel R. Neff

unread,
Oct 2, 2006, 4:18:55 PM10/2/06
to

I think the jump from VB6 to VB.NET is harder than the jump from VB6
to C#. The thing is with VB.NET people expect it to be just the next
version of VB and think things are the same but it's really a totally
different language with very different concepts. When transitioning
instead to C# the language itself is completely different as well so
people are expecting other changes and it's an easier transition.

Sam


------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.

0 new messages