.Net languages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is a good source of unbiased info about the relative value of
programming in C#.Net vs VB.Net for a web-based application? Everyone seems
to like what is most familiar to them, and I am looking for objective
differences.
Thanks for the input.
 
I think that as of the .Net 2005 version the only differences will be

C# - Full pointers, bit shift operators, unsafe keyword, string literal
escapes ("\t" etc)
VB - Restircted pointers, On Error handling, ReDim Preserve

I dont think C# will ever be given On Error handling as most VB programmers
are moving to the Try ... Catch ... End Try exception handeling. Also, I
think ReDim Preserve will most like stay VB. On the other hand it is
resonable to expect that maybe after .Net 2005 VB will be given bit shift
operatiors. However, I don't think VB will be given string literal escapes.
Finally, I don't think VB will get full pointers or an unsafe keyword
equivalent because it can use the .Net Marshal object to get access to
memory locations.

So at .Net 2005 I think the main difference between the two will be purely
syntax cosmetics. I feel that VB has a friendlier syntax then C#. C# has a
more technical feel with all the curly braces and semicolons.

Who knows, .Net 2007 may only have one language VCB# (Visual C Basic Sharp).
:)

Robby
 
Hey Sam,

I'm a bit surprised that you have gotten very strong feelings from people.
As Robby pointed out, the languages are virtually identical as to
functionality (he seems to have hit on most differences). One source you
might check is a bookstore. There are a number of books that are written in
C# and VB versions by the same author. Find book XYZ for C# and XYZ for VB,
pop 'em open to the same topic and compare. In most cases you're likely to
find that the text is the same except that they cut-and-pasted the pertinent
version of the code. You'll also find that the programs follow the same
steps, using the same code except for what are really style differences (do
you prefer "Dim MyVar As SomeType" or "sometype MyVar;").

One specific book would be MS Press' books for MCSD prep. They tend to
cover both languages and (at least in the one I've read) will have the two
flavors of snippets with only sporadic mentionings to the effect of, "In VB
you would have to do this because it does not support this feature."

- John
 
Thanks so much for the input. I guess my other question is whether there is
any difference in portability outside MS platforms.
 
smk23 said:
Thanks so much for the input. I guess my other question is whether there is
any difference in portability outside MS platforms.
At the risk of oversimplifying, both VB (.NET) and C# are inextricably tied
to the .NET Framework not necessarily to Microsoft, so as the .NET Framework
goes, so go VB and C#. Currently, TTBOMK, we have Microsoft and the Mono
project.

http://www.mono-project.com/about/index.html

which has both VB and C# compilers.

If there are others, I'm sure more posts will appear here.
 
VB.Net and C# have equal portability. Remember, these are based on the .Net
Framework so any system that has the .Net Framework installed can use your
assemblies.

However, for maximum cross-platform compatabilty do not use any platform
specific namespaces, objects or features that are not fully Common
Language Specification (CLS) compliant. I think only the Microsoft.Win32
namespace is platform specific so avoid using any objects in that namespace.
An example of an non-compliant CLS feature are type parameters in generic
classes in VB defined with the Of keyword. I think this may change as I
could find nothing stating that type parameters where not CLS compliant for
C#, .Net 2005 is still in beta. All features that are not compliant will
state so in the documentation. Sticking to .Net Framework objects and CLS
compliant features in both VB, C# and any future .Net language is the best
way to ensure crossplatform compatibilty.

Robby
 
Robby said:
VB.Net and C# have equal portability. Remember, these are based on the .Net
Framework so any system that has the .Net Framework installed can use your
assemblies.

However, for maximum cross-platform compatabilty do not use any platform
specific namespaces, objects or features that are not fully Common
Language Specification (CLS) compliant. I think only the Microsoft.Win32
namespace is platform specific so avoid using any objects in that namespace.

No - there's also the Microsoft.VisualBasic namespace, which many
VB.NET programs will use without the developer really knowing. While
Mono has ported many of the classes within this namespace, I suspect
there are still a few gaps.
 
Robby said:
I think that as of the .Net 2005 version the only differences will be

C# - Full pointers, bit shift operators, unsafe keyword, string literal
escapes ("\t" etc)
VB - Restircted pointers, On Error handling, ReDim Preserve

Actually, the differences are more compliated than that. VB adds the My
namespace and C# adds two rather significant features: anonymous methods and
iterators.(Unless things have changed significantly and escaped me)

Anyway, for web applications, there is virtually no difference, but as far
as code structure goes, I think C# and VB will likely begin to influence
designs differently.
 
Some people consider C# a "cleaner" and more "oop-like" language than VB.
Both languages have features with the other is missing. If you turn Option
Strict=On VB is as much typesafe as C#.

But at the end, behind all .NET languages in the same runtime library and
the same functionality.

So if you or your team feels more confortable with VB, then use it, and if
your team feels more comfortable with C-style syntax use C#.
 
Daniel,

You make me curious, why you write C# and not C, while you are not writing
VB.Net but VB?

Cor
 
Cor Ligthert said:
Daniel,

You make me curious, why you write C# and not C, while you are not
writing VB.Net but VB?

I'm not writing VB.NET or VB, I just simply didn't bother to prefix .NET to
the name VB.

Also, AFAIK, in whidbey VB is no longer VB.NET, it is just VB8\VB 2005. Even
C# isn't labeld C#.NET any longer, whereas it was in 2k3.
 
I don't think there are project breaking differences between C# and
VB.NET.
The power language remains managed C++ which in Visual Studio 2005
generates more optimized IL than C# or VB.NET.

Regards,
Jeff
 
Daniel,

I can of course post a message to the OP wherein I write something about C
languages in the same way as you and others did about VB. I don't do that,
there is enough written in this newsgroups about this.

However when people show as you do that they apparently have few knowledge
about the differences between the VB.Net version and classic VB than in my
opinion would they not give a reaction.

You are not the only one by the way, while there are others who did it very
correct.

Just my opinion.

Cor
 
However when people show as you do that they apparently have few knowledge
about the differences between the VB.Net version and classic VB than in my
opinion would they not give a reaction.

I am well aware of the differences. However, classic VB is well on its way
down . The .NET name is being dropped from almost all products(including C#)
and VB.NET will no longer *be* VB.NET. Beyond that, VB == Visual Basic, C# =
C-SHarp, C would be pretty close to Managed C++. There would be very little
sense in droping the # I would think.

Anyway, this discussion was within the context of .NET, asking about VB.NET,
thus it isn't to much of a stretch to figure out that VB==VB.NET.

And my message was to correct a fallacy. He said that the languages would be
pretty equal except for a set of differences that were already there. I
pointed out that each language is diverging and there are a number of
differences beyond the very minimal list he posted.
 
Daniel,

That the Net name *will be* dropped does not mean that it *is*.

The IDE of VB.Net is very forgiving full (and so am I, not that there is
something to forgive here), however you as C# man, should know that direct
correct syntax gives better results, especially in C#.

:-)

Cor
 
VB.Net is a RAD language and VS.Net supports many RAD features like
providing automatic indentation, automatic casing and an
easy-to-understand English-based syntax.

C# does not provide any of the above and has a technical syntax. For
Windows apps., VB.Net provides the same interface as VS6.0 in that any
form can be made the startup form unlike in VC#.Net.

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 
Back
Top