@LarHel, yes, all features work fine when down-targeting.
There's one corner of string interpolation to mention... we'll let you write
Dim x As FormattedString = $"hello {p.Age:0.00}"
x.FormatString ' String with value "hello {0:0.00}"
x.Args ' Object array with one element, p.Age
This will only work if the "FormattedString" type is present. This will be built into .NET4.6, but it will also be available in a NuGet package for people targeting older versions of the framework. Similar to what we did with Microsoft.Bcl.Async
It will take you about 30 minutes to write an analyzer that enforces the rule "no ?. is allowed". You can add the analyzer as a reference to your projects. This will give a compile-time error (both on dev machines and on your team build server) anytime anyone uses the ?. operator.
Clarification: two of the features mentioned "NameOf" and "String Interpolation" aren't yet in VS2015 Preview; they'll come along presently (prior to the final release of VS2015).
@carlospinedag, I'm curious if you've tried the "IL Support" extension on the Visual Studio gallery? It's a third-party extension that people use to put IL directly into their VB/C# projects. Hasn't yet been updated for VS2015.
@squizfloats - You've got the right idea. This is a situation where the overall API design is forcing you to have an async signature, even though your method itself isn't async in its implementation.
Please watch the next video in the series. That discusses EXACTLY this case. Actually it discusses it in the guise of "MemoryStream". Obviously Stream has to have async APIs since most streams (disk, network, ...) are asynchronous in nature. But when you come to implement MemoryStream, it has no natural async implementation. And so it uses Task.FromResult exactly as you described.
The video talks about several useful micro-optimizations specifically for this case. Worth considering.
Comments
UWP - getting started with win2d
@Thomas, maybe the difference is that I'm using "Option Strict On" (under ProjectProperties>Compile), and you're using "Option Strict Off"?
I sometimes forget about it since I set it to be my default (under Tools > Options > Projects And Solutions > VBDefaults)...
UWP - port from 8.1 universal app to Win10
This video is just a warmup. Please also check out the next video in this series - https://channel9.msdn.com/Series/Creating-a-Universal-App-in-VB/UWP-port-from-phone81-to-phone81--Win10?wt.mc_id=EntriesInArea
It's a port of a "real" app, and uses Shared Projects, and gets huge startup-time wins thanks to debugger PerfTips and .NET Native.
What's New in C# 6 and Visual Basic 14
@Andre, just to note, lack of await in catch/finally has a very easy workaround. For instance, instead of
Try
stuff1
Catch ex As Exception
stuff2
Awaitr.CloseAsync()
End Tryyou can instead write
Dim t As Task = Nothing
Try
stuff1
Catch ex As Exception
stuff2
t = r.CloseAsync()
End Try
If t IsNot Nothing Then Await t
What's New in Visual Basic 14
@LarHel, yes, all features work fine when down-targeting.
There's one corner of string interpolation to mention... we'll let you write
This will only work if the "FormattedString" type is present. This will be built into .NET4.6, but it will also be available in a NuGet package for people targeting older versions of the framework. Similar to what we did with Microsoft.Bcl.Async
What's New In C# 6.0
If you wish to enforce a team policy that no one is allowed to use ?. there's now a really easy way to do it. Look at Alex's video about "analyzers": https://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/714
It will take you about 30 minutes to write an analyzer that enforces the rule "no ?. is allowed". You can add the analyzer as a reference to your projects. This will give a compile-time error (both on dev machines and on your team build server) anytime anyone uses the ?. operator.
What's New In C# 6.0
@Kintar - I don't like videos either :) All of Mads' material is on the C#/VB project site here in a lot more depth - https://roslyn.codeplex.com/wikipage?title=Language%20Feature%20Status
Also we'll be putting up a blog post about the new features early next week - https://blogs.msdn.com/b/csharpfaq/
What's New in Visual Basic 14
Clarification: two of the features mentioned "NameOf" and "String Interpolation" aren't yet in VS2015 Preview; they'll come along presently (prior to the final release of VS2015).
.NET 2015 & Managed Languages
@carlospinedag, I'm curious if you've tried the "IL Support" extension on the Visual Studio gallery? It's a third-party extension that people use to put IL directly into their VB/C# projects. Hasn't yet been updated for VS2015.
https://visualstudiogallery.msdn.microsoft.com/530dc77a-a9b0-43bf-9ae2-9498b0ec15da
Tip 4: Async Library Methods Shouldn't Lie
@Joao, thanks for the pointer. I think that MSDN page has poor guidance. I'll contact the authors of it.
Tip 4: Async Library Methods Shouldn't Lie
@squizfloats - You've got the right idea. This is a situation where the overall API design is forcing you to have an async signature, even though your method itself isn't async in its implementation.
Please watch the next video in the series. That discusses EXACTLY this case. Actually it discusses it in the guise of "MemoryStream". Obviously Stream has to have async APIs since most streams (disk, network, ...) are asynchronous in nature. But when you come to implement MemoryStream, it has no natural async implementation. And so it uses Task.FromResult exactly as you described.
The video talks about several useful micro-optimizations specifically for this case. Worth considering.
Creating Async Libraries That Are Modular, Reusable and Fast, in Microsoft Visual C# and Visual Basic
I uploaded the source code for this session here: https://blogs.msdn.com/b/lucian/archive/2013/06/28/talk-the-complete-async-three-talks-from-teched-europe-2013.aspx
Three Essential Tips for Using Async in Microsoft Visual C# and Visual Basic
I uploaded the source code for this session here: https://blogs.msdn.com/b/lucian/archive/2013/06/28/talk-the-complete-async-three-talks-from-teched-europe-2013.aspx