Some potential language ideas for future versions of VB

Mads Torgersen recently gave a talk called “The Future of C#”, where he described some potential C# ideas that are on the minds of the team at Microsoft. He showed glimpses of a delightful IDE experience that deeply understands your code and that helps with diagnostics and refactorings. On the language front, he showed no…

23

What would you like to know about "how we do language design for VB and C#" ?

On June 6th I’ll be speaking at the Norway Developer Conference in Oslo, on the subject “How we do language design at Microsoft (VB/C#)”. It will cover topics like how we designed Async, how we run our week-to-week language design process, where we get ideas from, how we recognize and respond to user requests and…

12

Req28: Override events

[This post is part of a series, “wish-list for future versions of VB“]   IDEA: Allow you to override an event. This idea requires some explanation. Currently, both VB and C# allow you define events in interfaces, and implement them: Interface I1     Event e As Action End Interface   Class DI : Implements I1…

2

Req27: Allow query syntax in For Each

[This post is part of a series, “wish-list for future versions of VB“]   IDEA: Allow “For Each x In collection Where x>10”, and other query expressions. We should allow this kind of code: For Each x In collection Where x > 5 Currently we’re forced to use awkward workarounds: For Each x In From…

7

Req26: allow With as a modifier on expressions

[This post is part of a series, “wish-list for future versions of VB“]   IDEA: We should allow “With” as a modifier on expressions. Currently the “With” object-initializer syntax is only allowed on constructors, e.g. Dim x = New S With {.p = 1, .q = 2} This is rather limiting. It would be good…

5

Req25: With and From should be allowed together

[This post is part of a series, “wish-list for future versions of VB“]   IDEA: With and From should be allowed together. It’s just a silly oversight that they’re not. For example, we should allow this: Dim x As New List(Of Integer) With {.Capacity = 10} From {1, 2, 3}   Provisional evaluation from VB…

1

Req24: warnings where "Nothing" isn’t null

[This post is part of a series, “wish-list for future versions of VB“]   IDEA: Emit a warning where “Nothing” is used in a likely-incorrect way. 99% of users think that “Nothing” means the same as C#’s “null”, i.e. a null reference or empty nullable — but it isn’t. Nothing is instead the same as…

7

Req23: Make more keywords contextual

[This post is part of a series, “wish-list for future versions of VB“]   IDEA: Make more keywords contextual, rather than reserved. At the moment lots of words like “Event” and “Next” and “AddHandler” are reserved keywords. If you want to have variables or methods with these names then you have to put them in…

2

Req21: Allow unambiguous types from ambiguous namespaces

[This post is part of a series, “wish-list for future versions of VB“]   IDEA: Allow unambiguous types from ambiguous namespaces. This request arises from VB’s powerful “import” feature, which is more flexible than that of C#, but which introduces problems. I’ll explain by example:         Dim x As ComponentModel.INotifyPropertyChanged         ‘ In Winforms apps, this…

3

Req20: Range expressions

[This post is part of a series, “wish-list for future versions of VB“]   IDEA 1: Allow range expressions as a literal for IEnumerable. For instance,         ‘ This expression         Dim x = 5 To 14           ‘ should be syntactic sugar for this one         Dim x = Enumerable.Range(5, 10)   IDEA…

8