Second Preview of Kraig Brockschmidt’s free ebook is coming on Monday

672611 eBook.inddThe Second Preview of Programming Windows 8 Apps with HTML, CSS, and JavaScript is going well. We’re up to 12 chapters in this release (from four chapters in the First Preview), all chapters are final, and we’re just putting together the PDF and the ebook’s companion content.

Come back to our blog on Monday to find the announcement post with the Second Preview’s download links. In the meantime, here’s an excerpt from the ebook’s Introduction:

Introduction

Welcome, my friends, to Windows 8! On behalf of the thousands of designers, program managers, developers, test engineers, and writers who have brought the product to life, I'm delighted to welcome you into a world of Windows Reimagined.

This theme is no mere sentimental marketing ploy, intended to bestow an aura of newness to something that is essentially unchanged, like those household products that make a big splash on the idea of "New and Improved Packaging!" No, Microsoft Windows truly has been reborn—after more than a quarter-century, something genuinely new has emerged.

I suspect—indeed expect—that you're already somewhat familiar with the reimagined user experience of Windows 8. You're probably reading this book, in fact, because you know that the ability of Windows 8 to reach across desktop, laptop, and tablet devices, along with the global reach of the Windows Store, will provide you with tremendous business opportunities, whether you're in business, as I like to say, for fame, fortune, fun, or philanthropy.

We'll certainly see many facets of this new user experience throughout the course of this book. Our primary focus, however, will be on the reimagined developer experience.

I don't say this lightly. When I first began giving presentations within Microsoft about building WinRT apps, as they are called (and also referred to as Windows Store apps in consumer contexts), I liked to show a slide of what the world was like in the year 1985. It was the time of Ronald Reagan, Margaret Thatcher, and Cold War tensions. It was the time of VCRs and the discovery of AIDS. It was when Back to the Future was first released, Michael Jackson topped the charts with Thriller, and Steve Jobs was kicked out of Apple. And it was when software developers got their first taste of the original Windows API and the programming model for desktop applications.

The longevity of that programming model has been impressive. It's been in place for over a quarter-century now and has grown to become the heart of the largest business ecosystem on the planet. The API itself, known today as Win32, has also grown to become the largest on the planet! What started out on the order of about 300 callable methods has expanded three orders of magnitude, well beyond the point that any one individual could even hope to understand a fraction of it. I'd certainly given up such futile efforts myself.

So when I bumped into my old friend Kyle Marsh in the fall of 2009 just after Windows 7 had been released and heard from him that Microsoft was planning to reinvigorate native app development for Windows 8, my ears were keen to listen. In the months that followed I learned that Microsoft was introducing a completely new API called the Windows Runtime (or WinRT). This wasn't meant to replace Win32, mind you; desktop applications would still be supported. No, this was a programming model built from the ground up for a new breed of touch-centric, immersive apps that could compete with those emerging on various mobile platforms. It would be designed from the app developer's point of view, rather than the system's, so that key features would take only a few lines of code to implement rather than hundreds or thousands. It would also enable direct native app development in multiple programming languages, which meant that new operating system capabilities would surface to those developers without having to wait for an update to some intermediate framework.

This was very exciting news to me because the last time that Microsoft did anything significant to the Windows programming model was in the early 1990s with a technology called the Component Object Model (COM), which is exactly what allowed the Win32 API to explode as it did. Ironically, it was my role at that time to introduce COM to the developer community, which I did through two editions of Inside OLE (Microsoft Press) and seemingly endless travel to speak at conferences and visit partner companies. History, indeed, does tend to repeat itself, for here I am again!

In December 2010, I was part of small team who set out to write the very first WinRT apps using what parts of the new WinRT API had become available. Notepad was the text editor of choice, we built and ran apps on the command line by using abstruse Powershell scripts that required us to manually type out ungodly hash strings, we had no documentation other than functional specifications, and we basically had no debugger to speak of other than the tried and true document.writeln. Indeed, we generally worked out as much HTML, CSS, and JavaScript as we could inside a browser with F12 debugging tools, only adding WinRT-specific code at the end because browsers couldn't resolve those APIs. You can imagine how we celebrated when we got anything to work at all!

Fortunately, it wasn't long before tools like Visual Studio Express and Blend for Visual Studio became available. By the spring of 2011, when I was giving many training sessions to people inside Microsoft on building WinRT apps, the process was becoming far more enjoyable and far, far more productive. Indeed, while it took us some weeks in late 2010 to get even Hello World to show up on the screen, by the fall of 2011 we were working with partner companies who pulled together complete Store-ready apps in roughly the same amount of time.

As we've seen—thankfully fulfilling our expectations—it's possible to build a great WinRT app in a matter of weeks. I'm hoping that this present volume, along with the extensive resources on https://dev.windows.com, will help you to accomplish exactly that and to reimagine your own designs.

Who This Book Is For

This book is about writing WinRT apps using HTML5, CSS3, and JavaScript. Our primary focus will be on applying these web technologies within the Windows 8 platform, where there are unique considerations, and not on exploring the details of those web technologies themselves. For the most part, then, I'm assuming that you're already at least somewhat conversant with these standards. We will cover some of the more salient areas like the CSS grid, which is central to app layout, but otherwise I trust that you're capable of finding appropriate references for everything else.

I'm also assuming that your interest in Windows 8 has at least two basic motivations. One, you probably want to come up to speed as quickly as you can, perhaps to carve out a foothold in the Windows Store sooner rather than later. Toward that end, I've front-loaded the early chapters with the most important aspects of app development along with "Quickstart" sections to give you immediate experience with the tools, the API, and core platform features. On the other hand, you probably also want to make the best app you can, one that performs really well and that takes advantage of the full extent of the platform. Toward this end, I've also endeavored to make this book comprehensive, helping you at least be aware of what's possible and where optimizations can be made.

Many insights have come from working directly with real-world developers on their real-world apps. As part of the Windows Ecosystem team, myself and my teammates have been on the front lines bringing those first apps to the Windows Store. This has involved writing bits of code for those apps and investigating bugs, along with conducting design, code, and performance reviews with members of the core Windows engineering teams. As such, one of my goals with this book is to make that deep understanding available to many more developers, including you!

What You'll Need

To work through this book, you should download and install the latest developer build of Windows 8 along with the Windows SDK and tools. These, along with a number of other resources, are listed on https://msdn.microsoft.com/en-us/windows/apps/br229516. I also recommend you visit https://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-App-Samples and download the entire set of JavaScript samples; we'll be using many of them throughout this book.

A Formatting Note

Throughout this book, identifiers that appear in code, such as variable names, property names, and API functions and namespaces, are formatted with a color and a fixed-point font. Here’s an example: Windows.Storage.ApplicationData.current. At times these fully qualified names—those that that include the entire namespace—can become quite long, they are sometimes hyphenated across line breaks. Generally speaking, I’ve tried to hyphenate after a dot or between combined words but not within a word. In any case, these hyphens are never part of the identifier except when used in CSS where hyphens are allowed.

Acknowledgements

In many ways, this isn't my book—that is, it's not an account of my own experiences and opinions about WinRT apps on Windows 8. I'm serving more as a storyteller, where the story itself has been written by the thousands of people in the Windows team whose passion and dedication have been a constant source of inspiration. Writing a book like this wouldn't be possible without all the work that's gone into customer research, writing specs, implementing, testing, and documenting all the details, managing daily builds and public releases, and writing perhaps the best set of samples I've ever seen for a platform. We'll be drawing on many of those samples, in fact, and even the words in some sections come directly from conversations I've had with the people who designed and developed a particular feature. I'm grateful for their time, and I’m delighted to give them a voice through which they can share their passion for excellence with you.

A number of individuals deserve special mention for their long-standing support of this project. First to Chris Sells, with whom I co-authored the earliest versions of this book; to Mahesh Prakriya, Ian LeGrow, Anantha Kancherla, Keith Boyd and their respective teams, with whom I've worked closely; and to Keith Rowe, Dennis Flanagan, and Ulf Schoo, under whom I've had the pleasure of serving. Thanks also to Devon Musgrave at Microsoft Press, and to all those who have reviewed chapters and provided answers to my endless streams of questions: Chris Tavares, Jesse McGatha, Josh Williams, Feras Moussa, Jake Sabulsky, Henry Tappen, David Tepper, Mathias Jourdain, Ben Betz, Ben Srour, Adam Barrus, Ryan Demopoulos, Sam Spencer, Damian Kedzierski, Bill Ticehurst, Tarek Anya, Scott Graham, Scott Dickens, Jerome Holman, Kenichiro Tanaka, Sean Hume, Patrick Dengler, David Washington, Scott Hoogerwerf, Harry Pierson, Jason Olson, Justin Cooperman, Rohit Pagariya, Nathan Kuchta, Kevin Woley, Markus Mielke, Paul Gusmorino, Marc Wautier, Charing Wong, Chantal Leonard, Vincent Celie, Edgar Ruiz Silva, Mike Mastrangelo, Derek Gephard, Tyler Beam, Adam Stritzel, Rian Chung, Shijun Sun, Dale Rogerson, Megan Bates, Raymond Chen, Perumaal Shanmugam, Michael Crider, Axel Andrejs, Jake Sabulsky, as well as those I've forgotten and those still to come as the last set of chapters are added to the final edition. My direct teammates, Kyle Marsh, Todd Landstad, Shai Hinitz, Lora Heiny, and Joseph Ngari have also been invaluable in sharing what they've learned in working with real-world partners.

Finally, special hugs to my wife Kristi and our young son Liam, who have lovingly been there the whole time and who don't mind my traipsing through the house to my office either late at night or early in the morning.