"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.c om> wrote
in message news:uF******** ******@tk2msftn gp13.phx.gbl...
Are there anything that i can do in one language and cannot in
other?
For example, in VB .NET a single class method can implement several
interface methods. This trick, as fas as I know, is not possible in C#. In
fact, most of the differences between the languages are subtleties like
this one. I think there is no fundamental task you can do in one language and
cannot in the other.
There are a few things each can do that the other can't (and I suppose you
can argue about how "fundamenta l" these things are). At the moment, VB can't
overload operators and can't use unsigned types natively (it can use the
primitive unitXX classes, for example, but not directly like their signed
cousins) - this one in particular is fairly odd, considering that VB
recently introduced shift operators. Also, VB can't directly manipulate
pointers without the help of classes in the system.runtime. interop namespace
and GC handles to pinned references (although to be fair, C# also requires
pinned references, though the syntax is slightly different).
At any rate, with the next version of VS, VB will be able to handle all
these features except the direct pointer manipulation AFAICT. Do note
however, that direct pointer manipulation is not considered part of the core
CLI, and must be marked as Unsafe code. However, VB can still manipulate
pointers, so in this case, it's not as if it can't be done, it will just be
different.
And finally why C# seems to be a sort of standard in industry?
I think because it has been initially designed for .NET while VB.NET is
rather an improvement to VB6.
Actually, if memory serves, C# was going to be an independant project, and
then got merged/morphed into the Common Language specs/framework as well.
However, as you mentioned, unlike VB, C# has no clear and direct
predicessor. It's another "C-like" language.
I'm not sure what the original poster means by industry standard. I'm
willing to wager there is far more code in VB than C# at the moment -
especially if you concider older VB/VBScript/ASP code and migrations
thereof. Fundamentally, if you are using .NET, you writing IL code. The
syntax that gets you to the IL (whether it's VB, C#, FORTRAN, or even COBOL)
is in essance slightly less relevant. So basically, instead of doing what
Sun did with Java - which was to create ONE master language everyone had to
learn - the .NET team gave programmers a choice of syntax. If the programmer
is more familiar with VB, then VB.NET will be his best choice to enter the
..NET world, while other programmers who are more familiar with Java/C/C++
will find it easier to use C#. As always, I recommend that everyone learn
both - they aren't entirely different, and the hardest part is learning the
framework (which they both share). This will make you a far more valuable
resource, and doesn't take much effort.
One thing to note in addition is that C# has been submitted to international
standards - which means that others can write their own implementation of C#
based on the official specification. VB.NET, on the other hand, is
proprietary property of MS. But that's about the only "standard" that you
can concretely quantify.
-Rob Teixeira [MVP]