Jon
--
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
A watched clock never boils.
"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...
I'd add to Kevin that behaviour of some things are different in VB.NET and C#
I recomend to read O'Reilly ".NET Gotchas" book about these differences
JS> Is there any difference between these "languages" any more or are
JS> they just syntactically different but represent the same thing? A
JS> long time ago VB was more for "noobs" while something like C++ was
JS> for experts. While you could also do one thing in the other it
JS> wasn't always easy. Seems now that .Net has made these languages
JS> fundamentally the same but only syntactically different?
JS>
JS> Jon
JS>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Regards,
John
"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...
> Is there any difference between these "languages" any more or are they
There is one fundamental difference - C# supports pointers / unmanaged code
and VB.NET doesn't. However, for the vast majority of programmers, that is a
non-issue...
"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...
> Is there any difference between these "languages" any more or are they
> just syntactically different but represent the same thing? A long time ago
> VB was more for "noobs" while something like C++ was for experts.
Not true. VB was good at a lot of things. I know lot of smart people (me
included) who were using VB back in the day. Developing ASP sites was a
charm with COM dll written in VB and VBScript for ASP.
A similar thing with win apps VB provided a fast, easy environment to
program.
Right now there is barely any difference between C# and Vb.net that you find
on a daily basis. Just the sintaxis , that IMO is much better in C# than in
VB
This is a 1.1 list. Some may or may not apply in 2.0.
VB.NET has no "using" directive.
VB.NET does not do automatic namespacing. Whenever you put in a new folder
and/or class, C# puts in "namespace MyCompany.Technology.Args" for you.
In VB.NET you have to ~remember to put in "namespace
MyCompany.Technology.SomethingElse". Or everything defaults to the default
namespace.
VB.NET does not provide pre-build or post-build steps.
(there is a work around available for this , one is build rules ex
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=a3326eb3-a468-4f67-91a8-f84469fc49e2
)
VB.NET has no built-in comment->documentation generator
(see previous forum post about GhostDoc)
(there is a work around available for the default c# functionality, but
there is no equivalent GhostDoc feature)
See demo at
http://channel9.msdn.com/Showpost.aspx?postid=121822
VB.NET regions are not as flexible as c# regions.
The key here is that you can place a region ~~inside a function (in C#),
thus breaking up the implementation into logical pieces.
VB.NET does not allow the application the <NonSerialized> attribute to
events (you can in C# by using the Field: modifier).
As a result, there is no simple way of telling the runtime not to serialize
the event fields.
This results in serializing objects that you didn't expect, resulting in a
larger stream.
If the object handling the events is not Serializable, then the
serialization process will throw an exception.
( See http://www.codeproject.com/vb/net/serializevbclasses.asp for more info
and workaround )
VB.NET has less features with its static code analysis (as in, when you go
to Build / Build Solution).
Issues like : functions that don't return values, uninitialized variables,
unused variable declarations, etc...
Development time (in c#) is slightly decreased by finding these issues at
compile time.
VB.NET does not have ... Increments/Decrements. a++;a--;
VB.NET does not have operator overloading. C# has Operator Overloading.
(see http://www.csharphelp.com/archives/archive135.html)
VB.NET has no multiline comment syntax
VB.NET has no within-the-line comment syntax
VB.NET has no multiline string syntax
VB.NET has a limit on line continuations (I think the limit is 10?)
When asking the question, you may want to include.
Have you programmed in both?
What percentage have you programmed in C#? In VB.NET?
Some people make comments without experience in both, thus the differences
don't stand out to them.
"Jon Slaughter" <Jon_Sl...@Hotmail.com> wrote in message
news:12ho51g...@corp.supernews.com...
C# is managed code only just like VB.NET, it allows for unsafe code
contructs which allow some (restricted) pointer usage, but unsafe !=
unmanaged.
Willy.
C# programmers more often come from a C++ or Java background and are
more likely to have a strong understanding of CS in general and OOP in
particular.
VB.NET programmers more often come from a VB6 / VBScript background
and will often not have the same CS education and OOP experience.
Of course there are a log of great VB.NET developers out there, but
when talking about which language to choose for your organization the
programmers you'll attract by choosing C# vs VB.NET should be
something to consider.
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
(and yes we generally prefer a c# background over a vb.net background)
> C# is managed code only just like VB.NET, it allows for unsafe code
> contructs which allow some (restricted) pointer usage, but unsafe !=
> unmanaged.
You're right of course - I meant to say "unsafe"...
Apologies...
ive been using both for a couple years now, and using each differs per
situation, C# is a nice language that has some advantages and disadvantages,
as with VB. with these languages i think it comes down to mainly preference.
The only big detail i can think of is that VB writes alot of code for you. VB
is not case sensitive, which can be good and can be bad. Ive found that the
VB compiler does a better job at finding all errors at once then the C# one.
It also gives the exact location of errors, which is nice. C# however, as
stated earlier, gives access to unsafe code, which can be very useful if used
properly and when needed.
--
-iwdu15
Not really to do with the differences - others have pointed out some of
those - but I moved from VB6 to VB.Net, then to C#.NET.
I found the VB6 to VB.NET jump a bigger one than subsequently moving onto
C#, so that might indicate how much the differences are...?
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.