Re: C# Vs VB.NET
- From: Lucvdv <replace_name@xxxxxxxx>
- Date: Thu, 31 Mar 2005 11:32:33 +0200
On Thu, 31 Mar 2005 06:58:38 +0100, Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
wrote:
> <"=?Utf-8?B?U2FyYXRoIEJhYnU=?=" <Sarath
> Babu@xxxxxxxxxxxxxxxxxxxxxxxxx>> wrote:
> > Can anyone let me know why most companies prefer C# when the same task can
> > be accomplished using VB.NET in a simpler and easier way..?
>
> Perhaps because your idea of simpler and easier isn't theirs?
The question is who is wrong.
Neither and both, IMO: C# will be easier for C/C++ and Java developers,
VB.Net will be preferred by those who were used to VB6.
VB requires some more typing, but I find that makes the result more
readable. I've seen C/C++/C# code where almost every } is followed by a
comment to indicate what statement it belongs to, VB is self-documenting in
that regard.
In the DirectX SDK you find sample code for VB and C# that only differs in
syntax, where program structure and even comment text are fully identical
because it was written in one language and then simply syntax-translated to
the other. Translation can usually be done line by line, keyword by
keyword (the most work is C# to VB, finding the right } and replacing it by
the right keyword each time).
> Personally I find C# simpler, partly because as a language it's so much
> smaller, without all the legacy functions that VB.NET carries around
> with it.
Legacy functions are an extension you don't have to use.
Just leave Microsoft.Visualbasic.Compatibility out.
> I suspect if I used VB.NET regularly, the thing I'd miss most from C#
> is the "using" statement - it's so much easier to write
>
> using (Stream s = ...)
> {
> ...
> }
>
> than manually putting the try/finally in the right place.
I don't see the relation to exception handling, or else I missed something
in C# (I haven't used it much).
The VB equivalent is
With s As Stream = ...
...
End With
Different syntax, exact same thing (AFAIK).
.
- Follow-Ups:
- Re: C# Vs VB.NET
- From: Philipp Schumann
- Re: C# Vs VB.NET
- From: Jon Skeet [C# MVP]
- Re: C# Vs VB.NET
- From: Mattias Sjögren
- Re: C# Vs VB.NET
- From: Lucvdv
- Re: C# Vs VB.NET
- References:
- C# Vs VB.NET
- From: Sarath Babu
- Re: C# Vs VB.NET
- From: Jon Skeet [C# MVP]
- C# Vs VB.NET
- Prev by Date: RE: Foreground threads and garbage collection
- Next by Date: Enumerating threads
- Previous by thread: Re: C# Vs VB.NET
- Next by thread: Re: C# Vs VB.NET
- Index(es):
Relevant Pages
|