VB vs C# vs C++ vs J#

C

chuckdfoster

Just wondering this...

Are there any advantages of using one language over another? I currently
use VB, but notice that most code samples on the internet and this forum are
normally in C# (I think).
 
N

neilmcguigan

let the flame war begin.

if you know VB, might as well stick with VB so you can leverage (some)
of the knowledge.

i like C#, as I think it's very elegant.

other than style though, not too many differences, when it comes to the
resulting CLR code.
 
M

Mark Rae

Are there any advantages of using one language over another?

Almost none...
I currently use VB, but notice that most code samples on the internet and
this forum are normally in C# (I think).

C# has one important feature which is not supported in VB.NET, namely
unmanaged code e.g. pointers etc.

I've never needed to use unmanaged code.
 
A

agapeton

Microsoft uses C#. The framework is written primarily in C#. Major
parts of Vista is written in C# (various WPF components). Microsoft
Expression is written in C#.

You do the math...
 
K

Kevin Spencer

C# can do some things that VB.Net cannot. Most developers don't need to do
these things. If you're asking this question, you probably don't need to do
these things either. Otherwise, they are simply different languages that
compile to (virtually) the same MSIL.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
E

Edwin Knoppert

A terrible lack again for VB's like me.
Byte pointers etc are so handy.
Another hit for us, MS keeps putting us in the child corner this way.
Well, at least they gave us a few handy things like the stringbuilder which
helps a little.
of course calling the winapi using some asp.net structures is going so bad.
Not trivial at all.
Examples... hopeless!

I still use PowerBASIC for unmanaged parts.
Unf. the dll loading is another bad issue.

Poor!
 
T

tdavisjr

Use whatever you feel comfortable with. Most code samples are in C# as
those developers are more comfortable with C# probably because they
come from a C++ or Java background. However, I do encourage you to
learn how to read C# since more code samples are in C#. One word of
warning. Once you learn C# you probably won't use VB as your primary
language anymore. I fell into this trap.
 
J

Jon Paal

Are there any advantages of using one language over another?

YES !
The one you know always works better :)
 
N

Nathan Sokalski

I am a VB.NET person, although I do believe that most ASP.NET developers
should learn to read, if not write, in both, because you may be forced to
use one language or the other depending on where you work. As for when you
have the choice, I would recommend, like most of the other people that
responded to this thread, that you use whichever one you are most
comfortable with. As far as the unmanaged code thing, it is true that you
will rarely, if ever, need it. However, I would expect that the rare
situations that you do would be when writing custom classes that would be
used for many different applications. Because of this, I would simply make
an entirely separate project so that you can still use your preferred
language for the application, and simply include the .dll from the custom
class which you write using whatever language it requires.
 
V

Vaibhav

Can you specify some of those things?
Kevin Spencer said:
C# can do some things that VB.Net cannot. Most developers don't need to do
these things. If you're asking this question, you probably don't need to do
these things either. Otherwise, they are simply different languages that
compile to (virtually) the same MSIL.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
C

chuckdfoster

That is kinda what I thought, but just had to make sure. As for unmanaged
code...what is it?
I have learned to read C# and translate it to VB, but can only write VB.
Thanks for everyone's input.
 
J

JIMCO Software

chuckdfoster said:
Just wondering this...

Are there any advantages of using one language over another? I
currently use VB, but notice that most code samples on the internet
and this forum are normally in C# (I think).

In addition to what you've already heard, C++ is not used for writing
ASP.NET applications and J# does not support partial classes.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

Merry Christmas from JIMCO Software!
 
K

Kevin Spencer

C# supports use of unmanaged code, such as C code, with pointer support. C#
supports operator overloading, although I've heard that VB.Net 2005 supports
this. I haven't had a chance to check it out for myself. C# supports
anonymous methods.

Other than those few items, they are functionally the same. I find the
unmanaged code aspect to be useful to me, but I have often run into
situations in which I need it. Again, most developers do not. It is useful
particularly if you work with graphics a lot.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
M

Mark Rae

I have learned to read C# and translate it to VB, but can only write VB.

Do yourself a *HUGE* favour, and learn to write in C#. For one thing, your
earning potential doubles instantly! Since you posted in an ASP.NET forum,
I'm assuming that you can already write client-side JavaScript, so writing
C# should be an impossible task for you...
 
M

Mark Rae

One word of
warning. Once you learn C# you probably won't use VB as your primary
language anymore. I fell into this trap.

You say that like it's a bad thing... ;-)
 
J

Jeff Louie

Well, with .NET 2.0 the languages are no longer equal and can now
collaborate
on an assemble. VB has the My namespace, C# has anonymous methods, C++/
cli produces optimized MSIL, is especially good at interop and has
compile time
templates and const behavior. A C# programmer should have no trouble
reading
the new C++/cli syntax and a C++ programmer should have no trouble
reading
C# code. A C++/cli programmer and C# programmer can collaborate on a dll
generating netmodules and linking to a single assembly. A C# programmer
can
call code in C++/cli:safe netmodule compiling to an exe that contains
the C++/
cli:safe netmodule and vice versa.

Regards,
Jeff
 
S

Steve C. Orr [MVP, MCSD]

C++ is only for propeller heads and I can barely understand why J# even
exists.

That brings it down to the only two languages that matter for web
development, VB.NET and C#.

VB.NET has more functions than C# can therefore save you more time because
you write less code.

So I suggest you save yourself headaches by sticking with VB.NET which is
just as capable as C# (if not more so) in all things that really matter to
most web developers.
Note that it wouldn't hurt to hedge your bets by learning enough C# to
understand the differences between the two languages.
 
S

Steve C. Orr [MVP, MCSD]

The only reason Microsoft does so much of their development in C# is because
they are migrating from a C++ environment so the switch is more natural.

On the other hand, Chuck is migrating from VB, therefore a VB.NET migration
will be more natural for him. This is why Microsoft made both C# and
VB.NET. So I suggest you recalculate your "math".
 
K

Kevin Spencer

VB.NET has more functions than C# can therefore save you more time because
you write less code.

Come on, now, Steve. That's just not intellectually honest. All of these
functions are available to C# through the Microsoft.VisualBasic namespace!
;-)

--

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
R

RCS

There is a much bigger issue with the VB.NET vs C# war - and that is with
finding answers to problems -or- learning how to do something. On the
newsgroups and many websites - there are FAR more examples in C#, than
VB.NET - I suspect because VB.NET developers are typically not the types to
go into deeper subject matter. They are the "crank out a working
application" type of developers.

For example, I was working on making my own validator (inheriting from
BaseValidator) - and I found next to no examples in VB - everything was in
C#. And likewise, *all* of the VB.NET developers I know - would've just
"done it another way", rather than create their own validator (which now
works great, by the way!)

So - one thing to factor, is if you are a developer who frequently likes to
push the envelope or extend existing functionality - language choice should
be a consideration. Because if I was writing everything in VB.NET - I'd
spend half of my time translating examples and help from newsgroups from C#.

Oh - and one thing that is key, regardless of your language of choice - it
is critical for you to be comfortable in both languages. I blew a half-day
trying to find what the VB.NET version of "extern" was - and another
half-day trying to find how to manually wire an event (the equivalent of
+=)...

It will make you a more valuable developer to be solid in both languages.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top