Live from Microsoft Build 2016
Posted: Tuesday, March 29, 2016 | Author: Chris Morabito
fresh ideasDay 3
Entity Framework Core 1.0
The successor to Entity Framework 6, originally called Entity Framework 7, has been rebranded as Entity Framework Core 1.0, as part of Microsoft’s .NET Core cross-platform effort.
As with the other parts of .NET Core, not everything from EF6 will make it into EF Core, especially in the initial 1.0 release. Some parts of Entity Framework are changing drastically, meaning that it will not be straight-forward to port an existing application from EF6 to EF Core. For these reasons EF6 will continue to be the right choice for many applications in the near future.
That said, EF has undergone restructuring to make the framework more lightweight, modular, and extensible–individual components are only loaded when needed, and can easily be replaced and extended. Most impressively, all this work has resulted in massive performance improvements. Upgrading from EF6 to EF Core can easily make performance 80% faster, while enjoying reduced memory and CPU usage. Unfortunately, the missing features make it difficult to decide on using EF Core 1.0 initially, but the improvements they’re making show a glimpse of a bright future ahead for Entity Framework.
Day 2
.NET Overview | ASP.NET Core 1.0 | The Future of C#
I’m combining these 3 sessions into a single summary because together they comprise a trilogy of sessions on the future of .NET and Visual Studio.
.NET Standard Library
At present, with Microsoft’s open-sourcing/cross-platform effort and their Xamarin acquisition, there are 3 versions of .NET: .NET Framework (for Windows), .NET Core (cross-platform, for modern app needs and developer workflows), and Xamarin’s Mono runtime (for mobile devices). These 3 silos mean that there are 3 sets of base classes, making it hard to share common code among apps targeting, for instance, Windows and iOS. The .NET of tomorrow will fix this. There are no announcements yet, but the goal is to have a common “.NET Standard Library” upon which Framework, Core, and Xamarin will be built–“one library to rule them all”. Each member of the family will obviously have specialized features unique to their target platforms, but the bulk of the framework and most of Microsoft’s innovation will reside with the Standard Library.
ASP.NET Core
ASP.NET is undergoing massive changes alongside the development of .NET Core. The new version, ASP.NET Core, is compatable with both .NET Framework 4.6 & .NET Core 1.0. WebForms, MVC, and Web API are all unified under a single controller class. Microsoft is also reworking ASP.NET to be modular, only loading components explicitly referenced by your code. This modularity has resulted in much faster and lighter-weight framework, that impressively outpaces Node.js in request throughput. Native support for NPM, Bower, and Gulp (with the ability to bind to ASP.NET build events) have also been added; and *.csproj files have been ditched in favore of a project.json file, similar to package.json or bower.json files, for easier cross-platform loading. In a move to become more compatible with frameworks such as Angular, ASP.NET Core can optionally ditch Razor syntax in favor of an HTML attributes (all with and asp- prefix).
Visual Studio vNext
Visual Studio 2015 Update 2 is out now, but Microsoft is hard at work on the successor to VS2015, for now called Visual Studio “15”. There are many exciting new features, including but not limited to:
- Faster install time (the on-stage demo completed in 1.5 minutes)
- Highlighting of matched Intellisense substrings with bold styling
- Spell-checking for suggested “using” statements
- Automatically add references to projects within the current solution
- Automatically add NuGet packages (with the ability to undo)
- More code style settings (eventual goal is to have settings in a file in the project folder)
C# Version 7
The next iteration of the C# language standard is under development. The C# team’s ongoing effort is to add new features to the language to keep pace with other modern languages and development needs. They try to add favorite features from languages like Python and JavaScript, while avoiding cluttered syntax and keeping the language consistent. New features include:
- Binary number literals
- Digit separators
- Local functions, which inherit scope from their parent functions (similar to JavaScript)
- Tuples
- String templating
- Pattern matching (If a pattern is matched, declare a new variable matching the pattern in scope)
- Switch statements: now support any type, not just primitives, and cases can contain conditionals
- Ref variables are now supported as return types and local variables
Angular 2
Angular 2 is in the final stretch of its beta, growing ever closer to release candidate. Version 2 is a significant departure from version 1, that aims to enable new deployment scenarios and to improve performance 5x. These goals are achieved by embracing the latest HTML technologies, including Service Workers and Web Workers. Angular 2 decouples the templating engine from the DOM, which allows views to be rendered server-side, called “Angular Universal”. The new version is also working toward what are called “progressive web apps”, which aim to provide a native-like user experience by caching website code client-size, and allowing offline data storage. Google has also partnered with Microsoft and has written the entirety of Angular 2 in TypeScript. Angular 2 is an exciting and much-needed update to Angular 2, and I’m excited for the day that it reaches it’s stable release.
Panel: Cross-Platform at Microsoft
This panel discussed 4 popular technologies for building cross-platform applications: Apache Cordova, C++, Unity, and Xamarin. Cordova wraps an HTML/JavaScript web app in a native container, for distribution on a wide range of platforms. Cross-platform C++ can be achieved with Visual Studio 2015 (see earlier post about C++ code in Visual Studio 2015). Unity is a cross-platform game engine that uses the Mono runtime for scripting. Xamarin provides C# implementations of native Android & iOS APIs, and compiles code written in C# to native Android/iOS machine code.
Cordova has the advantage of being able to update an app without re-submitting it to an app store, because it’s just a wrapper around a web app. C++ provides the “closest to metal” execution, and therefore has performance benefits. Unity is extremely popular for games, and has a great live-rendering editor. Xamarin allows you write all of your code in C#, share common code between projects, and .NET-ifies the platform-specific APIs available to your app.
Microsoft is making a clear push to make their technologies the go-to choice for developers, regardless of development or target platform. Their recent efforts releasing Visual Studio Code, open-sourcing .NET Core, bringing Ubuntu to Windows, and acquiring Xamarin are strong examples of this. Hopefully we can see a future where your target platform doesn’t dictate the tools you can use to write your code.
Keynote
Yesterday’s keynote focused on Windows, today’s keynote focused on cross-platform, cloud, and services. Main focuses were Microsoft’s recent acquisition of Xamarin, new technologies in Azure, developer features for Office, and work being done by Microsoft partners.
Earlier this year, Microsoft acquired Xamarin, a company that had been building a cross-platform mobile development framework for C#. The purchase was extremely predictable for anyone who’s been watching Microsoft in recent years, it made a lot of sense for Microsoft to bring Xamarin’s technology in-house, but there was an open question as to how Xamarin would be available going forward. Microsoft answered that question in the best-possible way: Xamarin will be available for free across all editions of Visual Studio (including the free, community edition). This is huge for cross-platform developers, and is a logical extension of Microsoft’s quest to make the .NET framework available across all operating systems. The Xamarin framework is being open-sourced, alongside the .NET Framework, and will enable C# developers to write code to target Windows, Mac, Linux, Android, & iOS clients!
Day 1
HoloLens Demo
I was incredibly excited to have the opportunity to try out HoloLens, Microsoft’s new “mixed reality” technology. The device is a self-contained headset that overlays 3D holograms on the world around you. It works by using cameras and other sensors to gain awareness of the world around you, and 2 small transparent screens (one for each eye) to display the holographic images. More details on the hardware can be found here.
The demo I experienced is called “Destination Mars” and began its life as software called OnSight, developed by NASA’s Jet Propulsion Laboratory. Originally a tool for members of the Curiosity rover team to visualize the Martian surface, it has been transformed into an experience for the public that will soon find its home at Kennedy Space Center.
This morning, before the keynote, we received tickets with assigned times to enter the demo. Attendees entered in groups of 8, and the demo took about 15 minutes. Before beginning, technicians measured our interpupillary distances (IPD) and we were instructed on how to adjust and fit the HoloLens device. (Our guide assured us that the IPD measurement step was only to expedite the demo process, and that the device is capable of calibrating itself.)
After fitting our HoloLens devices, we entered the demo space–a dimly-lit, empty room whose walls, floor, and ceiling were mostly black, save for some white contour lines and other decorative graphics. The demo began with an introduction by a holographic Buzz Aldrin, and then we were presented with 3 scenes of Martian terrain. We were encouraged to walk around to experience the Martian surface, and holographic markers directed the user’s attention to areas of interest and highlighted certain features of the terrain.
HoloLens is less immersive than the promotional videos would have you believe. The holographic field does not encompass your entire field of vision, but is limited to a rectangle in the middle of your view–imagine a 65-inch TV positioned about 6-8 feet in front of you, and you have some idea of what the experience is like. This holographic field is your window into the 3D world of HoloLens. The head tracking is amazingly fluid, and the 3D effect is stunning. The rendering of the Martian terrain was absolutely incredible, and the ability to crouch down to get a closer look and look all around gave an impression of the environment unlike anything I’ve ever seen.
HoloLens feels as much like the future as the Mars colony depicted in “Destination Mars”. I’m excited for the day that we can render maps derived from terrain models, LiDAR, and other 3D datasets in an environment similar to this.
SQL Database Technologies for Developers
This session detailed the new features coming to SQL Server 2016. Most of the features already exist in Azure SQL Database–the database technologies group has been operating under the principal to develop for the cloud first; then, after 2-4 years, these changes get bundled up and issued as a new release of SQL Server.
2 important security features that have been added are always encrypted columns and dynamic data masking–both are extremely useful for sensitive data such as social security numbers or patient data. Always encrypted columns mean that the values of a field are encrypted throughout the whole database environment, including queries, and only can be decrypted by the application code. Dynamic data masking uses functions to transform the results of a query to protect it (e.g. to only show the last 4 digits of a SSN, “XXX-XX-1234”). Both of these provide tools to protect sensitive information at the database level, alleviating the need for applications to do it, and helping to ensure that the data can’t be intercepted.
My favorite improvement? Spatial queries. In SQL Server 2016, the engineering team worked to re-implement spatial queries as native code instead of T-SQL, resulting in a massive performance improvement–as much as 10x faster!
What’s New in TypeScript
The TypeScript team may just be my favorite group at Microsoft. The work they’re doing to fix the parts of JavaScript that give web developers headaches is astounding. To quote presenter Anders Hejlsberg: “JavaScript has some quirks, but we can teach a compiler about the quirks”.
For those unfamiliar, TypeScript is a superset of JavaScript, which adds syntactic sugar and other language features to force JavaScript to become a better version of itself, more suitable for developing large projects, with features such as strongly-typed variables. TypeScript’s popularity is skyrocketing, seeing a 15-to-20-fold increase in downloads over the last year.
TypeScript 2.0 will be released in a couple months, likely late May or sometime in June. New features include:
- Non-nullable types
- Control-flow-based type analysis
- Async/await
- Readonly properties
- Declared this type in functions
Type definitions for 3rd-party libraries will also be easier to install. Instead of requiring additional modules like Typings to install, type definitions will be packages as NPM modules, allowing them to be installed thusly: npm install “@types/library-name”
What’s New in Microsoft Edge
It was a year ago, at Build 2015, that Microsoft officially announced Edge, the successor to Internet Explorer, and just a short 8 months ago that it reached stable release. When Edge debuted, IE was 20 years old and showing its age, so Microsoft chose to ditch compatibility for interoperability with the Web at large. Edge has seen growth on-par with Google Chrome, in its first month, and currently is used by over 150 million monthly active users.
Since its release, Edge has received 12 update releases–including 128 new features or substantial changes and 6527 bug fixes. The latest Edge builds have overtaken Firefox on HTML5test, now sitting behind only Chrome and Opera.
The most eagerly-anticipated feature coming to Edge in the forthcoming “annual update” for Windows 10 is extentions. A vast departure from the ActiveX controls or yore, Edge will support JavaScript extensions similar to Chrome. Extensions will be installed via the Windows Store, starting with a small core set of extensions to prove out the platform, with others to be added over time. Other features coming for end users include:
- Customizable “New Tab” page: drag/drop, remove/pin, manual add, and get app links for top sites; and a customizable news feed
- “Ask Cortana” context menu action to perfom a context-aware look-up of selected text
- Swipe to navigate back/forward
- Improved favorites management
Short term priorities for the Edge team are to focus on extensions, accessibility, fundamentals (security, performance, & efficiency), new web standards, and openness & community. Speaking of openness, Microsoft has open-sourced their JavaScript engine, ChakraCore, and it is now available as an alternative to Chrome’s V8 runtime in Node.js
Finally, biometric authentication is coming to the web–the next version of Edge will support FIDO 2.0 authentication using Windows hello.
You really can’t go wrong with Explorer or Edge, @Microsoft. pic.twitter.com/8YPBUISbWo
— Ford Motor Company (@Ford) April 29, 2015
Holoflight: Visualizing Flight Data in 3D
This was a quick presentation from IdentityMine, who built a flight-tracking application for HoloLens. Their app visualizes flight tracking data using the Unity game engine. They wrote their own handler to load Bing Maps terrain and imagery data, and dynamically sized 3D airplane icons based on distance from the viewer.
Top 6 Reasons to Bring Your C++ Code to Visual Studio 2015
Visual Studio 2015 brought a lot of changes to make C++ code easier to write, faster to compile, and faster and safer to run. The 2015 linker runs on average 2x faster to run, compile times for even large applications have been cut to a fraction of what they were in VS2013. 2015 also adds whole-program code optimization–this increases compile time but can improve runtime performance. Support for Intel Memory Protection Extensions and control flow guards also make programs compiled with VS2015 more secure.
There are several features to aid developers in writing code. A new PDB format adds improved intellisense. “Rename” refactoring can now be done–no more find-and-replace! Quick fixes such as converting dots to arrows can be made. And Visual Studio can automatically restructure things; such as moving function declarations/definitions, and extracting blocks of code into their own functions.
Microsoft’s love affair with Linux continues, VS2015 can compile and remotely-debug native Linux applications.
Visual Studio can now also write native code for Android and iOS applications. For Android apps, VS has its own emulator and the debugger supports both Java and C++ code. For iOS, code can be written in VS, but needs to be connected to a Mac with XCode for emulation and debugging.
Keynote
As is usually the case, the first keynote session focused on Windows. Microsoft will be release an “anniversary update” to Windows 10 (for free) bringing notable changes to development, inking, Cortana, and gaming.
Perhaps the most interesting update is that Windows will natively support the Bash command line (bash.exe instead of cmd.exe). Microsoft has partnered with Canonical to implement a Linux subsystem, based on Ubuntu, which will enable developers to run shell scripts and use component such as Emacs.
Win32 & desktop .NET apps are seeing some love too. A new conversion tool will allow you to bundle traditional desktop apps–including games–as Universal Windows Apps, which can then be distributed through the Windows Store. There will also be support for installer frameworks such as Wix.
Microsoft is integrating pen stylus support more deeply in the operating system. They’re adding new components to make it easier for developers to support ink input. Inking is also more intelligent, with Cortana being able to recognize handwriting and provide context when appropriate. As part of this portion, they also demoed an update to Sticky Notes, a useful little Windows accessory that hasn’t seen any love since Windows 7. This portion featured a couple interesting map demos, showing the ability to drop 2 points and draw a line between them to get distance and directions, and the ability to draw on a 3D terrain and have your line drape on the terrain surface.
Cortana is getting more deeply integrated into 3rd party applications. New APIs will enable developers to expose functions of their app to Cortana, and for Cortana to provide context back to the app. Cortana support is also coming to Outlook (previously limited to the Windows Mail & Calendar apps), so she has access to your inbox and calendar.
“Conversations as a platform” is Microsoft’s new vision of the future, citing personal assistants and bots as the new apps. In this future, Microsoft envisions that we won’t use apps but conversation to interact with computer systems to do tasks such as order a pizza. I’m very skeptical of this vision, but Microsoft is going after it with a new Bot Framework, and integrations with Cortana and Skype.
Day 0
I’m back in San Francisco, ready for another week of Microsoft developer goodness! Build 2016 kicks off tomorrow with the keynote at 8:30am PDT. I’ll be updating this blog and my twitter feed throughout the conference. Check back regularly for the latest from the Moscone Center.
Also, check out Microsoft’s Channel 9 and the @msdev Twitter account for session live-streams and other updates.