views:

398

answers:

11

In the vein of Most Wanted Feature for C# 4.0, what would you like to see in the next version of VB.NET?

+1  A: 

Anonymous Methods, like C# instead of statement lambdas only.

Bob King
Why? What's wrong with (multiline) statement lambdas?
Konrad Rudolph
VB limits you to a single line.
Bob King
Not much longer, according to Paul Vick's blog! Multiline lambdas were originally planned for Version 9 but didn't make it due to deadlines.
Konrad Rudolph
Whoo hoo! That makes me pretty happy. I always thought that was the biggest slap in the face.
Bob King
+1  A: 

curly brackets.

I'll get my coat.......... :)

gbjbaanb
LOL some people have no sense of humour :) +1
Kev
cheers, everyone else has posted 'this or that c# feature' too. :-)
gbjbaanb
A: 

F#'s units of measure system, as language feature

Bob King
A: 

It is more of a .NET addition but, Java style Enums.

MagicKat
+3  A: 

Two categories.

C# catchup

  • An analog for C#'s yield keyword
  • An analog for C#'s better nullable type support
  • Auto properties
  • unsafe code

New features

  • Multiple setters for properties (IE: you could have a Uri property that lets you have separate setters that accept a Uri type and a String type, and it uses the type inference system to know which you mean to use. Of course, the setter would have to know how to convert the passed string and store it in the Uri backing the property)
  • Real String enums
  • Multi-line statements (ie, You can start any line with a semi-colon, which is ignored except that then the statement does not end until the parser reaches another semi-colon). It would be great for long string literals, for example, or for multi-line lambdas/delegates.
Joel Coehoorn
VB 9.0 does support the ? operator for Nullable
Bob King
Cool! learn something new every day. Question edited to reflect it.
Joel Coehoorn
Having a yield keyword would be awesome. Although, I heard that they are working on an Iterator keyword.
MagicKat
Auto properties made it, too...
Rowland Shaw
A: 

Anonymous Delegates

EDIT: Changed to reflect updated information.

MagicKat
… VB already has closures.
Konrad Rudolph
+3  A: 

From some other threads:

… both will hopefully be implemented.

Konrad Rudolph
I'd kill for Collection Initializers, too.
Bob King
+1  A: 

a verbatim string literal character like c# (@) so we don't have to constantly escape those pesky regexes.

marduk
erm … VB strings are already like C#'s verbatim strings. No escaping is needed (or indeed possible).
Konrad Rudolph
except for the double quote, or course
Bob King
So, you want a _reverse_ @ operator, so you can use constants like \n in your string.
Joel Coehoorn
+1  A: 

A few more:

  • Remove the need to use _ line continuation when adding attributes to classes/methods on the line above.
  • The ability to include linebreaks in string literals without having to concat to Environment.NewLine or vbCrLf (much too verbose for my tastes as is)
Joel Coehoorn
+1  A: 

I just want an old feature from VB6 that was dropped...

You used to be able to create a UI with several controls with the same name and they would become an array. I miss that.

(Yes, I know that you can do basically the same thing by dynamically creating a UI and put all of your controls in a collection, but you can't do it visually in the Drag-and-Drop UI editor, so creating these is a PIA.)

BoltBait
+2  A: 

My wishlist:

  • Support for multi-statement lambdas. I want to be able to create a lambda expression that has multiple statements in it.
  • Remove the limitation that all lambdas must be "Function"s so that I can write lambdas for Action() (or Action) parameters.
  • Always show "References" node in Solution Explorer (instead of having to enabled the "Show All Files" option)
Jeremy Wiebe