As expected, Day 2 at the PDC had people with more expectations and hopes of being exciting than day 1 did.
A much better keynote from Steven Sinofsky laid out the details on how Windows 7 was built with users in mind, how they like to share the user pain etc with funny videos thrown in to the mix. Also IE9 was announced with better standards and HTML5 support, including rounded corners in css.
There was a hardware devices walkthrough that showed us variety of devices and laptops with touch, sensor, location-aware capabilities. The biggest surprise was when Sinofsky announced that Microsoft was giving away a custom-built multi-touch laptop to every attendee. Now it all made sense, why Microsoft had cut various corners at the conference including no breakfast, no party.
Scott Guthrie, the developer folk hero (that’s what the press calls him), made an awesome presentation of new capabilities in Silverlight 4. The key thing was how Silverlight now is going to be the #1 development platform for a .Net developer and still target business apps, games, and a variety of other applicable scenarios across OSs. It’s amazing how they delivered exactly what the developers have been asking for since Silverlight 3, in such a short time span. He attributed the success to some innovative ways of managing development.
Key takeaways from ScottGu’s keynote:
Silverlight 4 Beta out now – RTM early 2010
General
- Printing Support
- Implicit Styling
- WebCam/Microphone Support
- RichTextArea Control
- Right-Mouse Button Events
- Drag-n-Drop/Clipboard Access
- UDP/Multicast Support in Networking
Out of the Browser Improvements
- Elevated Trust
- WebBrowser Control
- Controlling the Window
- Notification Windows (e.g. Outlook popup’s)
- COM Integration
Data Binding Improvements
- Binding to DependencyObjects (used to be FrameworkElement)
- StringFormat Markup Extension
- TargetNullValue Markup Extension
- FallbackValue Markup Extension
- Support for IDataErrorInfo and new INotifyDataErrorInfo for reporting validation errors.
- Binding to String Indexers
- GroupDescription support on CollectionViewSource for simplified grouping.
iPhone support from streaming media – IIS smooth streaming in Silverlight
There was a quick demo by Scott Hanselman on drag and drop and rich support for Silverlight in VS 2010, along with RIA services. To me, Silverlight 4, VS 2010 and RIA Services try to provide the kind of platform that ASP.Net 2 with VS 2005 provided. Allowing developers not to think too much about the underlying behaviors and magic, just make things work. With RIA Services, write validations once and they will be applied to both server and client side, also developers don’t have to worry about async behavior of Silverlight. There is also magical Intellisense support for RIA services on the Silverlight client side, the moment anything changes on the server side. This all happens inside Visual Studio. Magic!
I won’t go much in to SharePoint 2010 and it’s supposed awesomeness, as it’s not directly related to our work. If you are interested check out the keynote.
Another interesting announcement is the Microsoft Live Labs product called Pivot. Pivot makes it easier to interact with massive amounts of data in ways that are powerful, informative, and fun. Basically it’s a way to do rich data visualization. I asked the guy at the Pivot booth, if Xaml itself can be viewed as Pivot data. Right now they don’t support that. May be in future. Doesn’t stop me from thinking the possibility of doing it on our own, by using WPF RenderBitMap. If you need a Pivot invite, let me know.
Moving on, I attended Scott Hanselman’s session on ASPNet MVC Ninja tricks. He mostly covered the hidden potential of T4 templates and how one can use them with MVC. Talk was entertaining as usual, Some notes from the session.
- Set MvcBuildViews flag in the csproj file to true, to be able to do type-checking compile time errors on MVC views
- Use T4 to get compile time errors for dynamic/string references in views (like image filenames)
- Html.EnableClientValidation provides automated json-based client side validation on domain objects and properties
- Html.DisplayForModel just spits out the values from the model object – easy to troubleshoot, verify
- UIHint attribute on a model object property for “Phone” maps to Phone.ascx, that way now we can have generic way of rendering a type in the UI
- DataAnnotations is getting better and adding more and more stuff like UIHint attribute above.
Many Core, parallel computing session by Stephen Toub (Sr Prog Manager of Parallel Computing platform) was pretty good. The session on PLINQ also provided a lot of tips on what to use and when. Some notes from the session.
Performance tips when using PLINQ
- Avoid/Reduce Memory allocations inside delegates and linq queries, use value types (structs may be) if you’ve to use Anonymous types
- Set in app.config of an application
- Avoid true and false sharing - Recently accessed memory locations are stored in a fast cache
- Use expensive delegates, computationally expensive delegates is the best linq. Cheap delegate over long sequence may have overheads
- Write simple plinq queries, use AsParallel only where you want to in the linq query
- Choose the right partitioning
- a. Arrays and Ilists are partitioned statically, because we know the length before hand
- b. Other collections like Ienumerable are done in chunks of a few at a time, in to the buffer
- Measure always if it works
- Find a bottleneck if it fits a data-parallel pattern, try plinq
- Use Parallel extensions related toolwindows for debugging inside visual studio
More at Code.msdn.microsoft.com/perfextsamples
After the session, had a chat with Stephen Toub, specifically around the idea of using it for a com component used by ASPNet. He said that he is not so sure about this scenario as a case for PLINQ. Once the website hits saturation, the ROI may not yield enough benefits. However during non-peak periods the response time can speed up. He concluded that the best approach might be to try Parallel.For or Parallel.ForEach rather than using IParallelEnumerable based linq queries. PLINQ is mostly used in scenarios where a large number of computation has to happen in batch, performing the same task everytime. The way to look at parallel computing is to look at it as breaking up of your program in to several tiny pieces of task. These tasks should be independent of each other and not have side effects. Now you can parallelize them using Parallel extensions and/or PLINQ.
How about powerful features like sequence operators, pattern matching etc from F# are brought to C#. Talked to an architect from VS langauges platform about this. It looks like there are no such plans atleast in the near future. Both languages are meant to serve specific purposes and things in mind.
From Luca’s session on Fututre of languages, the next new features in C# are going to be
- Compiler as a service – this will enable a C# interactive tool just like F# interactive today, inplace compile and run
- Asynchronous Programming – Async prefix to api methods, with yield keyword marking async operations, without changing readability of code
- Immutability – like F#, immutability without having to worry about state changes can be a cool addition to C#
As you know the C# 4 already supports declarative, concurrent and dynamic behaviors.
Another super cool technology I am excited about is Reactive Extensions (Rx) to .Net. Primarily looked at as Linq 2 Events, although it’s much more than that. Rx introduces duality to IEnmerable and IEnumerator, by providing IObserverable and IObserver. Enables us to write inline code that subscribes to events and the callback is pushed iteratively to the piece of code inside the subscription. Erik Meijer’s session on Rx was pretty much the same as the channel 9 videos you might have seen already. Worth a watch if you are new to Rx. This is part of Silverlight 4. Now it’s backported to .Net 3.5 and available for download on devlabs. System.Reactive namespace is where Rx comes from.
One of the other edutaining sessions was Windows Identity Foundation by Vittorio Bertocci, don’t miss that one. With WIF we now have another addition to Foundation technologies. This is moving to a Claims based / Federated security model. Soon I think enterprise apps and websites moving to this approach and will fundamentally change the messiness of the authentication/authorization code for better.
As there were too many sessions overlapping each other, I couldnt’ catch up on all of them, but I have begun to watch the videos and aim to cover the missed ones. Will write more blog posts as I learn more.
Must watch PDC Presentations, recommend you to watch wmvhigh version in Windows Media Player, because you can forward/rewind etc
- CL09 How Microsoft Visual Studio 2010 Was Built with WPF 4 by Paul Harrington
- CL16 Optimizing for Performance with the Windows Performance Toolkit by Michael Milirud
- CL19 Building Line of Business Applications with Microsoft Silverlight 4 by David Poll
- CL20 Improving and Extending the Sandbox with Microsoft Silverlight 4 by Joe Stegman
- CL22 Advanced Topics for Building Large-Scale Applications with Microsoft Silverlight by John Papa
- CL24 XAML Futures in Microsoft .NET Framework, Microsoft Silverlight and Tools by Michael Shim, Rob Relyea
- FT11 Future Directions for C# and Visual Basic by Luca Bolognese
- FT20 F# for Parallel and Asynchronous Programming by Luke Hoban
- FT23 Extending the Microsoft Visual Studio 2010 Code Editor to Visualize Runtime Intelligence by Bill Leach, Gabriel Torok
- FT24 Building Extensible Rich Internet Applications with the Managed Extensibility Framework by Glenn Block
- FT35 Microsoft Visual C# IDE Tips and Tricks by DJ Park
- FT52 Microsoft Perspectives on the Future of Programming by Butler Lampson, Erik Meijer, Don Box, Jeffrey Snover, Herb Sutter, Burton Smith
- FT59 ASP.NET MVC 2: Ninjas Still on Fire Black Belt Tips by Scott Hanselman
- SVC01 Lap Around the Windows Azure Platform by Manuvir Das
- FT03 Manycore and the Microsoft .NET Framework 4: A Match Made in Microsoft Visual Studio 2010 by Stephen Toub
- CL01 Microsoft Silverlight 4 Overview by Karen Corby
- VTL04 Rx: Reactive Extensions for .NET by Erik Meijer
- SVC02 Windows Identity Foundation Overview by Vittorio Bertocci
Recent Comments