First impression of Windows 8: Wonderful

Last Tuesday I had a wonderful evening: coming home from a run on an endorphin high, I sat down in front of my computer with a plate of strawberries and ice cream watching the Steven Sinofsky Windows 8 keynote at Microsoft’s BUILD conference. And boy was it awesome. I couldn’t stop smiling.

The big thing: Metro everywhere

As regular readers of this blog know, I am big fan of the Metro Design Language that Microsoft has used in Windows Phone 7 as well as on Zune and Xbox. So it is great news that the primary interface for Windows 8 will be Metro style. It’s a bold departure from the kind of UI that has served Microsoft and its users so well since Windows 95. And it is also refreshingly different from the two other major platforms for PCs and devices today: Mac OS X/iOS, which are becoming more and more the same from a UI perspective, relying on the UI concepts of “grid of icons” introduces with the first iPhone in 2007, and Linux/Android which just seem dated.

Paul Thurrott has good coverage of BUILD on the SuperSite for Windows, including several screenshot galleries (1, 2, 3, 4), but to really appreciate the new possibilities, you have to check out the keynote video on Channel 9. It will show you the myriad ways that Microsoft is reimaging Windows.

The basic proposition is, I guess, that Windows should be the only computing platform you will need. It will run just as well on classic Intel-based PCs as it does on ARM-based tablets an maybe even phones. Metro will be common UI for all these platforms as well as you Xbox, so you won’t have to learn different UIs for the different kind of device categories. To control it, you will be able to use touch, a stylus, a mouse and/or a keyboard, depending on the type of device and what you feel like. It is sort of the single computing platform that I had been dreaming about in a blog post a couple of weeks ago. I think this is a wonderful idea and I really hope that Microsoft can deliver on this promise.

The big question, of course, is whether users will go along with this. I know several people whose first order of business when they get a new version of Windows is to turn off the new UI features to make it look like the previous version of Windows. Even if it is just little things like the Aero glass effects in Vista and Windows 7. Since the Metro style interface is such a big departure, I am concerned users might not give it a chance and revert back to the old desktop interface at first. This would be a shame, as this new interface really has a lot to offer (see for yourself in the keynote video) and should be huge improvement in terms of usability for many people. I only hope Microsoft will be successful in convincing users of its advantages. This is, after all, Windows, so success or failure of Windows 8 is a big deal to Microsoft and hundreds of millions of users.

Finally better Windows Live integration

Right now, Windows and Windows Live have precious little integration (read about my troubles integrating SkyDrive into Windows Explorer). With Windows 8, Microsoft is improving this area in a big way, for instance by  including support for SkyDrive right out of the box. And the maybe most important thing for users is the way Windows pulls together their content from all the Windows Live services and other accounts such as Facebook and LinkedIn that have been associated with one’s LiveID. You can see this in Windows Phone today, the way it lights up with your content (contacts, email, pictures) as you log on with your LiveID for the first time. In Windows 8 even more things will be synced, such as application settings, bookmarks et cetera. It’s great stuff.

Miscellaneous

And then there is WinRT a new set of new APIs for developers that are accessible from XAML and C# or HTML5 and JavaScript (so no abandoning of .NET as some had rumored). And there is also better integration with Windows Azure, Microsoft’s cloud computing solution. This should allow some really interesting applications that store their state in the cloud allowing users to work with the same app in the same state on multiple devices.

Final thoughts

Windows 8 is a big deal. Both for Microsoft and the billion or so Windows users. I am very excited to get my hands on the developer preview (already downloaded it, but unfortunately I don’t have a machine here to install it on).

It is also worth noting that while Windows 8 has a clear tablet focus, it is thankfully not an iPad or Android clone, but so much more. As I said earlier, Windows 8  will pretty much run on all your computing devices and is therefore the only OS you will ever need.

Delphi XE2 at Delphi Days 2011

Embarcadero USB KeyYesterday I attended the Delphi Days 2011 in Cologne, the official launch event of Delphi XE2 in Germany as part of the Embarcadero World Tour. It was the first time I’ve been at a developers conference and it was exactly as I expected.

Of the approximately 280 attendees all but a handful were male and with a greater variety in their configurations of facial hair than I have ever seen in one place. Embarcadero and the other sponsors had a couple of freebies (which is where I picked up the USB key shown n the right) and a raffle with very generous prices at the end. A good dozen people ended up with free versions of Delphi, other tools and one even got an iPad 2. Alas, I wasn’t one of these people, but then again, what would I do with an iPad?

Highlights

Of course the most important part was to see Delphi XE2 with its brand-new 64Bit compiler and get answers to some questions about it. In the words of David I, this is “the biggest and best release Delphi”, and I agree. For a couple of years it had seemed that Delphi was stalling and like so many others I now use C# and .NET as my primary development platform. But the wait is over, and XE2 is packed with a ton of new features. Check out this Embarcadero Developer Network article to see all the things new in this release.

There are quite a few interesting features there. Based on questions from the audience yesterday, the one people are most interested in was FireMonkey, which could be described as the Delphi version of Microsoft’s Windows Presentation Foundation (WPF). In a sense replaces the VCL as the UI library of choice for Delphi developers as it is vector-based, takes advantage of the GPU and allows some cool UI effects. It certainly looked interesting, but based on what I saw in the demos, it doesn’t seem to be as full-featured or as capable as WPF. There is also no equivalent to Expression Blend, a tool that allows designers to work UI design while programmers code the logic behind the UI. UI design has to be done using the Delphi IDE. The FireMonkey designer in Delphi works a little different from the VCL designer, and the Embarcadero sales person doing the demo was clearly having some trouble with that. I expect, at least initially, many Delphi developers to have the same issues.

FireMonkey is, however, cross-platform and it was cool to see the same Delphi application being compiled for Win32, Win64 and Mac OS X and iOS. And it seems that Cross-platform is (again) an important part of Embarcadero’s strategy. One thing to note is that there is no support for Linux as of yet. Just like Microsoft no longer sees Linux as a threat to Windows on the desktop, Embarcadero seems to view the Mac and iOS as the more viable platform. And those poor MAC developers that have to put up with Xcode could sure use a nicer development environment.

Consequently everybody on stage was working on a MacBook and using the Platform Assistant application (the successor to Remote Debugger, if I’m not mistaken) that comes with Delphi, one could easily debug a Mac application while running Delphi inside a virtual machine such as Parallels or VMware Fusion.

More bits, more headaches

The part that interested me most, though, was the new 64Bit compiler that allows applications written in Delphi to take advantage of more than 4GB memory on 64Bit machines running a 64Bit version of Windows (no 64Bit Mac apps just yet). While I had sort of hoped that the move from 32Bit to 64Bit would entail little more than a recompile, there are actually a couple of things to consider before making the switch. Most importantly, it’ might not even make sense to switch, because your application may actually be slower afterwards.

Here are the (in my mind) most important things to consider/look out for when thinking about 64Bit:

  • Data types: Integer remains 32Bit while Pointer is now 64Bit (see Raymond Chen’s blog for the reasons why Microsoft chose the LLP64 model for Windows as well as this MSDN article). Watch out for instances where one assumed the two would be equal. NativeInt was introduced to work around this, as it will always be the same size as Pointer.
  • Any bit-wise operations (shr, shl, and, or, not and xor) can result in unexpected behavior when 32Bit and 64Bit values get mixed. Note that if a number like 1 appears as a literal in your code, it is assumed to be an Integer, i.e. a 32Bit value.
  • Previously, the Delphi compiler hadn’t used any optimizations that were processor or vendor specific, such as SSE, but as the x86-64 spec includes SSE, the compiler now uses it. This results in dramatically improved Double performance. One demo of a Mandelbrot set showed a massive performance boost after recompiling for 64Bits and setting the $EXCESSPRECISSION OFF compiler flag.
  • Exception handling works different in Win64, so there is no longer a performance penalty when entering and leaving a try…except or try…finally block (see Uwe Schuster’s blog for details). However, someone from the audience mentioned that there could be no more than 16 such blocks nested at any time, which (if true) would be quite a limitation.
  • Under the new standard calling convention of the 64 Bit Windows API up to four parameters are passed via registers, which should be much faster than the previous convention to pass them on the stack. Inside Delphi code, however, the convention has always been to pass up to three parameters via registers, so this may be only of little importance to Delphi programmers.
  • The Extended data type is no longer 80Bits but only 64Bits.
  • Watch out for the types expected by Windows API functions. If you have been casting something to Integer to pass it as the LParam of PostMessage, this will no longer work, as LParam is now 64Bit.
  • Watch out for the alignment of data structures, and in order to conserve space, order fields from the largest to the smallest data type.
  • If you haven’t already done so, you will have to move to Unicode in order to be using Delphi XE2 with its 64Bit compiler.

For more information about Delphi 64Bit be sure to also check out these articles:

Conclusion

The bottom line, I think, is that 64Bits is not a no-brainer. There are some situations where it absolutely makes sense, but one should carefully weigh one’s options before putting in all the work to work around the issues mentioned above and then end up with a slower application.

Books Worth Reading

Over the past couple of months I have read a few books that I wanted to talk about on this blog. My reviews (if you want to call them that) of each as too short to warrant their own article, so here they are combined into one list.

The first book on the list is Zero Day: A Novel by Mark Russinovich, author of the fine Sysinternals tools; tools that rely on every day. He has also written a couple of extremely dense technical books on the internals of the Windows operating Systems. So it came as a a surprise to me when I heard that he was writing a novel. I thought he should be working on Windows Azure not fiction. So while this may not be the greatest work of fiction ever produced, this book is noteworthy for a couple of things. First and foremost, it draws attention to the fragility of all those computerized systems that we depend on so heavily for our daily lives and illustrates how easily a couple of determined individuals can disrupt them. Also, the book is  a lot more graphic than I had expected. I didn’t mind necessarily, though I failed to see how detailed descriptions of the physical features of the female characters was really adding to the progression of the story. Finally, this is the only novel I know of, that features an appearance of WinDbg. As can be expected from someone as technical as Mark Russinovich, the depiction of the technological aspects is very accurate, there is none of the technical mumbo-jumbo and outright silliness you see in TV series, movies and the like (I am looking at you, Password: Swordfish). Overall, a pretty good book that raises some important points.

Next up is The Story of Stuff by Annie Leonard. I had already written on this blog about her film of the same name. The message of the two is the same: we are consuming way more than we should, and it is not even making us as happy as we wish it did. Only the book backs it up with a ton of figures and research and even contains some helpful hints on what each and every one of us can do on an individual basis or where one can turn for more information. This book together with No Impact Man (which I wrote about here) has fundamentally changed the way I view my place in the world and the responsibility I have towards this planet. These books are the reason you see environment posts on this blog.

Facts and Fallacies of Software Engineering by Robert Glass. This one I had on my wish list for a long time, before I decided to buy and read it. The book contains a number of interesting facts about my profession, some of which I knew, some of which I didn’t know. That’s OK because I am not a software developer by training and this book was a great help in making up for that. Another great book in that category is Coder to Developer by Mike Gunderloy, which is a bit more practical in that it contains all the info you would need to get a basic understanding of the work and the tools of a software developer. What I found most amazing about Facts and Fallacies was that the basic research quoted by the author in support of his theses was often from the very early days of the software field. The fact that a book such as this is still necessary after that long speaks volumes to the way old wisdom is ignored in favor of the latest fad in our field.

The Master Switch by Tim Wu is the story of the various information empires that have come and gone over the past 150 years or so. I personally remember only the latest one: the dotcom boom (and bust). But is interesting to see the similarities between say the internet boom and the advent of amateur radio. Both carried the promise of leading to greater democratization by brining information to the masses. It is also interesting what kind of sabotage companies got away with in the past. There is the story of a phone company stealing their competitors wires. In another instance one company was required to let its competitors to install switching equipment on their premises to connect to their network. Because they didn’t want that, they simply left open a window in the room housing the equipment and soon enough birds were living their, destroying their competitors equipment.

Finally there is The Filter Bubble by Eli Pariser. The author makes an very good point about how harmful the increasing personalization on the internet can be. By seeing only what we like, we no longer encounter anything that we may not like, but that is important for us in order to be informed citizens. I have actually noticed this on myself: I have a couple of dozen RSS feeds set up in Outlook to keep me up to date on topics that I care about. Because I know I should know about current affairs to understand the political landscape and make an informed decision come election time, I have included a couple of news sites. But more often than not I find myself checking tech blogs or movie trailers before I even look at the much more serious but considerably less entertaining political headlines. This actually links to something mentioned in The Master Switch. In an era when there were just a handful of broadcasting companies, everybody was watching the same programming. It gave people something to talk about and more importantly it allowed the nation to be rallied behind a common cause. Nowadays, thanks to personalization, everybody can live in their own little world, where they only see the news they like and go forever without encountering a single dissenting opinion. An opinion that might might otherwise have made them rethink some of their positions and notice that there is more to it than they might have realized before.