Are you serious? Did you look at the page? When was the last time you used a
ufloat in C#? A BitAnd in VB.NET? This page was created by people/a person
that doesn't understand either language, much less the dozens of nuances in
how they behave.
A few examples...
ufloat, udouble, and DateTime are not C# types. DateTime is a system type
used in C#, but is no more a C# type than UInt is a VB.NET type.
Dim f As Double = 2.5
Dim i As Integer = CType(f)
and
double f =2.5;
int i = (int)f
are ONLY equivalent because they selected the special case of Banker's
rounding. Try 3.5. These are certainly NOT equivaelent except in special
cases for any of the fractional values (VB.NET rounds, and C# truncates).
That's four things that are just wrong and we aren't even out of the Data
Types section yet.
I will acknowledge that they got the first section - Comments - correct.
The got the constants section technically correct, except that anyone who
sets Pi as a constant does not understand the capabilities of the framework.
The difference between VB and C# behavior with enums, is actually
interesting, but they fail to explain why a 100% framework scenario would
have different behavior (the important part of that example). What happens
is that C# is being stupid (in this particular case, not in general) and
failing to recognize that an enum is a special case of a particlar type of
integer. VB.NET recognizes this and calls the WriteLine overload for the
proper integer (Int32, since its a default - which they fail to show the
syntax for changing). C# effectively does
Console.WriteLine(CObj(Status.Pass)) (where Status.Pass is an enum value).
Is that enough? I quit after less than 20% of the page. I don't have time to
track down that many problems in other people's work. I stand behind what I
said. The layout is nice, too bad there is so much incorrect, incomplete,
and misleading information on the page.
I realize that the MS page is inadequate. But a page that is full of
incorrect information is signifciantly less helpful.
FWIW, I am forwarding this post to the author's of the page. They can decide
what to do with it. I make mistakes and expect people to point them out. But
if I ever post something with four errors in the first 20 lines, I assure
you I'll pull it down until I figure out why I made so many mistakes and get
it fixed.
--
Kathleen Dollard
Microsoft MVP
Author "Code Generation in Microsoft .NET"
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in message
news:eC**************@TK2MSFTNGP09.phx.gbl...
Whats is incorrect !
Kathleen Dollard wrote: Jorge,
It's a nice layout. Unfortunately it contains incorrect information.
"Jorge" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl... Hello , check
http://www.harding.edu/USER/fmccown/...t_csharp_compa
rison.html
Kind Regards
Jorge
-----Original Message-----
Does anyone know a document which list syntactic
difference between C# and VB.Net?
If Yes, please help me out.
Thanks
.
--
Best Regards - OHM
O_H_M{at}BTInternet{dot}com