Monday, September 19, 2011

Windows 8–my first thoughts

Unless you are living under the rock you would know that Microsoft unveiled details about Windows 8 at the //build/ conference last week. I had the privilege to attend the conference and see it live first hand. I am also fortunate to be one of the first few developers to get my hands on a Windows 8 Samsung tablet with a developer preview OS on it. It was a busy week and Microsoft had a lot to say (there were over a 100 breakout sessions), so much so that the entire first day and a good part of the second day was just dedicated to the “big picture” keynotes. Even more details about the nitty-gritty will emerge now that the cool crowd can all talk about it but here’s my first thoughts on what I have heard so far.
Before the //build/ The buzz that Microsoft managed to create for the //build/ was amazing. Partly because of the PR strategy of only selectively sharing very few details before the conference day. Although some would argue it was not such a great strategy especially when it comes to the .Net and Silverlight developers of the world, I would say they pulled it off fairly well. The media was all over it and the space was ripe with rumors which means it had the attention. Although, being a C# developer I was a little frustrated about the “new HTML5/JavaScript” app development platform in the first video, that little agitation made sure I paid attention to what was going on and grabbed the opportunity to go to the conference with both hands. And I wasn’t disappointed. Read on to know why..
Gut check at the conference If I had to summarize the conference in word I would choose “massive”. Everything was huge about it. There were about 5000 people attending, over 100 sessions, the convention center was huge but they still had to use nearby hotels for some of the sessions and so on. The atmosphere there was electric. After the first days keynotes I talked to a few folks and I could only hear good things about what was being announced. It was a big happy crowd, myself included. I couldn’t think of anything that Microsoft could have done to make these developers happier. They had something for everyone. JavaScript/HTML Devs – Check, .Net/Silverlight/XAML guys – check, C++ – Check, H/W & drivers guys – Check, IT Folks – Check, Cloud folks – Check and to top that they gave away a developer level Samsung tablet to all the attendees. In addition, they also included a docking station and a keyboard as well making sure these devs have no excuses to start building some cool apps. The other noticeable thing to see was the focus on performance and simplicity. In a way it was not a choice if they want to run Windows on ARM based processors but still it was refreshing to see. The APIs that I have seen so far seem to be well designed and abstracts away a lot of heavy lifting the OS is doing for the developers. All in all it all felt good apart from a few minor nitpicks.
New application & development Model A really dumbed down version to summarize Windows 8 will be to say it actually packs two OS into one single image – one is a tablet OS and the other is an enhanced version of Windows 7. And that statement isn’t incorrect until you really get into the theoretical definition wars. It’s just easier to talk like Its two OS into one so that’s what I am going to do.
The “old” OS works just like you would expect. It supports all the runtimes that we all familiar with aka Win32, .Net and Silverlight. If you target this OS, not too much has changed for you apart from getting a refined Windows 7 with better performance characteristics.
The center of the show however is the new touch first metro style OS. “Fast and fluid” as they kept saying. If you have worked on a phone or a tablet platform before, this new OS should feel very familiar to you. It has all the niceties (or restrictions depending on who you talk to) of a sandboxed application environment, restricted access to the system, touch first design, crisp look and feel, app suspension model and an environment where the OS is looking after system resources (memory, battery life, CPU) for the user.
This new OS takes a lot of “inspirations” from some worthy predecessors like iOS, Android and Windows Phone. In fact if you have done any windows Phone development you should feel right at home with Windows 8. A lot of the concepts like app tomb-stoning, push notifications, declaring capabilities, live tiles, application packaging, app certification etc apply straight from windows phone with one BIG difference - the runtime. Windows phone uses a “Silverlight-like” runtime especially designed for the phone. For windows 8 however, the new metro style apps use a completely new runtime called Win RT (Windows RunTime). My first reaction to WinRT was subdued. I felt it was just one more runtime in the mix as different groups within Microsoft couldn’t sort out their politics and the consistency across platforms was “sacrificed” for the lack of better words. But it wasn’t long before I realized that WinRT was actually the touch of genius that made a lot of this possible. For instance look at diagram below describes the numerous programming models available to the developers now. Notice the WinRT as the core of the green section (the new “OS”) being used from all the different programming platforms aka C#/XAML, JS/HTML and C++/XAML. How does that happen you might ask? Well read on.. 

The magic sauce called WinRT Its no secret that If you want the ultimate performance you have to be as close to the hardware as possible. The more layers you have to go through before hitting the metal the slower you will be. I can imagine the windows team had a few choices to make when they first embarked on this new bold journey of developing the metro style OS. They could have repurposed Silverlight (the light weight runtime of choice at that time) as the windows phone team did and used it for the new OS but my guess is the performance and the scale just wouldn’t have cut it. Again, you would be a layer on top of the OS/Win32 which slows you down. Plus they wanted to support the JavaScript/HTML stack as well. So It doesn’t surprise me that they chose to go with writing a new runtime from scratch. The new WinRT is written in C++ as a part of the OS itself. Completely native to the OS, not a layer on top of win32. As far as rendering engine is concerned the story is two fold. The HTML stack uses the same rendering engine as IE10 underneath whereas XAML has its own rendering engine. Both however use DirectX and hardware acceleration underneath – no more GDI. So its written in C++? Hmm? So how do you call it from JavaScript one might ask, wouldn’t that have to be some wrappers and layers before the call hits WinRT? Well not exactly. WinRT uses metadata projections to expose all the information about the APIs in all different non c++ languages that WinRT supports aka JavaScript, C# and VB. So even though from JavaScript you are calling APIs that feel natural to the JavaScript developers you are actually calling native OS components underneath giving you the performance that would be hard if not impossible to match with any other runtime. The API call itself is an extremely light weight VTable call. That to me is the touch of genius. You are getting the best performance the OS has to offer as well as the reach to the millions of already skilled developers who can start building apps in their language of choice. Remarkable!
The rough edges So anything other than awesome? Well, It’s a developer preview OS. And there are some noticeable rough edges as to be expected. After using the device for about 5 days I have encountered a few of those and I can say the same for quite a few people at the conference. One of the most common thing the presenters said during the sessions was “the demo gods are not happy it seems” so there was a fair bit of SNAFUs happening. But I am taking heart in something that Sinofsky said during the keynote “we are driven by quality and not dates”. I hope he holds true to that. Here’s sincerely hoping that the execution engine at Microsoft delivers and they don’t release the product with some obvious rough cuts like they did in windows phone. The other noticeable void was Office. There was no mention of Office next at all neither of a metro style Office apps. That definitely is concerning.
iPad killer? One common question that circled around during the conference was not so much if W8 will kill iPad but does it stand a chance to compete in that space? My personal view is it does. It’s a bold new OS. Think of it as a OS-X and iOS bundled together and it works on a whole slew of hardware platforms including ARM based (although the ARM support is not released yet) devices. So that definitely gives an edge to Microsoft before one asks the question of the eco system. Will Microsoft be able to generate enough interest to create a good number of “quality” apps on windows platform? Notice the focus on quality. In terms of number of apps windows phone had a higher number than the apple app store when compared taking the age of the platform into account but a lot of the apps were just not up to the mark. The time will tell how the app eco system evolves but that’s just a part of the eco system story. I know its easy to focus on the app eco system given the state of the industry right now but there is the other part of the eco system which is hardware. The eco system of devices that windows has built around it is unmatched and I will not be surprised if this eco system evolves beyond anybody’s guess. Tablets that duel as an enterprise power machine when docked is a very certain reality. Even though we live in the touch first world, the power of keyboard and mouse should not be underestimated especially for enterprise applications that require a lot of text entry and precision of the mouse. Half a billion USB devices out there don’t have a port to plug-in to in the Apple eco system. Add to that the new USB 3.0 standard which I am sure will bring the next generation of devices to the market. Enterprises are complicated and convoluted they need all the openness and extensibility they can get that’s one of the reasons Microsoft has a strong hold in that space. The blowout tablet market that Apple has created is something that Microsoft could actually leverage to its advantage. To me it’s a net new opportunity and there is room for more than one players in that space. All in all, I expect some healthy competition in the years ahead.
In summary Windows 8 is a bold new step which I think is in the right direction. The idea of making the platform available to not only existing developers of Microsoft stack but also extending to the slew of web developers out there is remarkable. And its not just OS, the server and cloud, dev platforms and other groups inside Microsoft had stuff to share. As Steve Ballmer mentioned in his keynote, “If Windows 8 is windows reimagined, they are in the process of reimagining Microsoft and windows 8 is an import step towards that goal”. Lets see how it evolves!