.NET

Reply
Valued Contributor
kidcoach
Posts: 70
Registered: ‎05-02-2003
Message 11 of 14 (48 Views)

Re: C# 2005 vs VB.NET 2005

09-13-2006 02:26 PM in reply to: *Bob
One of the smaller "niceties" in C# over VB.NET is case sensitivity. Here's an example:

// stores the first name
private string firstName = "";

// gets or sets the first name property
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}

Ya can't do that in VB :smileywink:
Distinguished Contributor
cgay
Posts: 125
Registered: ‎08-02-2005
Message 12 of 14 (48 Views)

Re: C# 2005 vs VB.NET 2005

09-14-2006 12:11 AM in reply to: *Bob
Use whichever .NET language you want. Make your own decision based on research and personal preference.

There is quite a large list of languages to choose from for .NET
Somewhere greater than 50.
http://www.dotnetpowered.com/languages.aspx

I like both VB and C#. I use both. They each solve similar problems in slightly different ways.

As far as VB using legacy code, I believe that the real story (please verify this for yourself) is that some of the functions in the VB namespace produce less than optimal IL than their .NET equivalent functions (not sure which ones, but rest assured it IS managed code, not legacy unmanaged code). Other functions produce the exact same IL because they just call into the .NET function(s). Either way it doesn't matter. Just use the .NET Framework methods in the BCL and all is well.

As far as "niceties" I like the VB ‘MY’ namespace.

And you could do this in VB instead:

' stores the first name
Private m_firstName = String.Empty

' gets or sets the first name property
Public Property FirstName() As String
Get
Return m_firstName
End Get
Set(ByVal value As String)
m_firstName = value
End Set
End Property

Still just as concise as your example. :smileyhappy:

Regards,
C
Valued Contributor
kidcoach
Posts: 70
Registered: ‎05-02-2003
Message 13 of 14 (48 Views)

Re: C# 2005 vs VB.NET 2005

09-14-2006 07:12 AM in reply to: *Bob
' stores the first name
Private m_firstName = String.Empty

Yes, you could, but now in intellisense, you have a bunch of variables starting with m_. Extra typing.
Mentor
MarkPendergraft
Posts: 375
Registered: ‎06-27-2005
Message 14 of 14 (48 Views)

Re: C# 2005 vs VB.NET 2005

09-14-2006 03:56 PM in reply to: *Bob
Bob, i think you said it yourself. You've read in several articles that there isn't enough of a difference between the two to consider one over the other.
So here is my advice. Whichever one you are more familiar with, go with it. When you feel really comfortable with it, check out the other one. I'm sure you will find that they really aren't that different. It's just like AutoCAD, typically there is one answer for every problem, but at least 2 ways to get there. the way you feel most comfortable with will be the fastest.
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.