Question

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
Was it helpful?

Solution

One reason many features get delayed in VB is that the development structure is much different than in C# and additionally, that often more thought goes into details. The same seems to be true in this case, as suggested by Paul Vick's post on the matter. This is unfortunate because it means a delay in many cases (automatic properties, iterator methods, multiline lambdas, to name but a few) but on the other hand, the VB developers usually get a much more mature feature in the long run (looking at the discussion, this will be especially true for iterator methods).

So, long story short: VB 10 will (hopefully!) see automatic properties.

OTHER TIPS

It also wasn't as big of a pain point in vb.net, since visual studio will automatically create 90% of the skeleton code of a property for you whereas with C# you used to have to type it all out.

If you want to do properties a little quicker, try code snippets. Type: Property and just after typing the "y", press the Tab key :-).

I realize this doesn't answer the particular question, but does give you what the VB team provided...

I know this post is old so you may already know but VB is getting Auto Properties in next version of VS.

Based on response to feedback and Channel9.

C# and VB.NET don't exactly line up on new features in their first versions. Usually, by the next version C# catches up with some VB.NET features and vice versa. I kind of like literal XML from VB.NET, and hoping they add that to C#.

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top