views:

3620

answers:

7

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
+1  A: 

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#.

Lou Franco
+2  A: 

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...

torial
+1  A: 

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.

dguaraglia
the languages *are* equally powerful; the tools provided by ms differ in functionality.
hometoast
+5  A: 

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.

Konrad Rudolph
I don't think VB.NET gets more thought before a feature is implemented than C#. I'm c'mon that just isn't the case.
Chris Pietschmann
I'm not saying that the C# developers are less careful; I'm saying the production cycle is faster and features get introduced into the language and then get later upgraded. This is definitely the case with iterator methods (try recursing them!) and probably automatic properties.
Konrad Rudolph
@Konrad: Iterator methods in VB? Where? When?
Meta-Knight
+4  A: 

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.

Joel Coehoorn
+2  A: 

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.

soccerazy
A: 

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.

greg
C# has public fields as well. And they aren't automatic properties in either language - there is a difference.
Mark Brackett