Alex Rivera | Logout

Why doesn't VB.NET 9 have Automatic Properties like C# 3?

Asked 2008-09-23T17:04:22.737
11

Would having a nice little feature that makes it quicker to write code like Automatic Properties fit very nicely with the mantra of VB.NET?

Something like this would work perfect:

Public Property FirstName() As String
    Get
    Set
End Property

UPDATE: VB.NET 10 (coming with Visual Studio 2010 and .NET 4.0) will have Automatic Properties. Here's a link that shows a little info about the feature: http://geekswithblogs.net/DarrenFieldhouse/archive/2008/12/01/new-features-in-vb.net-10-.net-4.0.aspx

In VB.NET 10 Automatic Properties will be defines like this:

Public Property CustomerID As Integer
Edit
Report

2 Answers

1

There's no particular reason really. It's been always been the case that even when VB.NET and C# are touted to be equally powerful (and to be fair, they are) their syntaxes and some of the structures sometimes differ. You have two different development teams working on the languages, so it's something you can expect to happen.

answered 2008-09-23T17:15:21.557
-3

automatic properties are not necessary in vb the concession one makes by using an automatic property is that you can not modify the Get and Set.

If you dont require those, just make a public data field.

VB has had automatic properties for years. They just called them something else.

answered 2010-03-27T20:05:13.320

Your Answer