Charles Petzold has been writing about Windows programming for 25 years. A “Windows
Pioneer Award” winner, Petzold is author of the widely acclaimed Code: The Hidden Language of Computer
Hardware and Software, Programming
Windows Phone 7, and more than a dozen other books. His classic Programming
edition of which is currently in progress, is lauded as one of the
best-known and widely used programming books of all time.
had an opportunity to connect with him and learn what he’s learned while
writing Programming Windows, 6th Edition, about the books he reads,
and his desire for a gamelan ensemble or Vannevar Bush's Differential Analyzer in
SF: As the author of the new book, Programming Windows, 6th Edition, you probably
have more insight into Windows 8 and WinRT than
anyone out there. What has surprised you, disturbed you, and pleased you the
most about Windows 8 in general and WinRT specifically?
CP: I like the
mix of continuity and innovation. For programmers who have worked with C# and
in particular I've been impressed by two aspects of WinRT: The first is
that touch, mouse, and pen input have been consolidated into a uniform
collection of events, so it's no longer necessary to add touch to an
existing mouse application, or add mouse support to a program optimized for
touch. You're working with all three forms of input at the same time, but you
can also distinguish between them if you need to.
I've also been impressed by the extent to which asynchronous processing is
an integral part of WinRT, and the ease with which we can do asynchronous
processing in C#. In C++, it's not so easy, but then few things are
easier in C++.
Most disturbing, I guess, is that WinRT is much more like
Silverlight than WPF. We veterans miss several powerful features of WPF
that simply never made it into Silverlight or WinRT, and perhaps never
will. For WPF developers, this comes under the category of accepting the
things we cannot change.
Most surprising is the extent to which C++ and native code
seem to be an increasingly important part of the new landscape of
application development. In particular, DirectX is a
vital part of Windows 8 as well as Windows Phone 8. The debate
between developer productivity with managed code vs. program efficiency with
native code has been renewed, and I think that's a good thing. No one language
or programming environment is the solution to every problem.
SF: That is
great insight, Charles. So for all of
the developers out there who are chomping at the bit to start writing
Metro-style apps, what advice do you have for them?
CP: Start now.
Download the Windows 8 Release
Preview, install the development tools, and find a good book to
guide you through. Get your fingers on the screen, and explore the motion
and orientation sensors. Those are the frontiers.
SF: That’s really
solid advice. You have been writing
about Windows (among other things) for more than 25 years. What have you
enjoyed writing about the most?
always a challenge to immerse oneself in a new programming environment and
struggle to learn in sufficient depth to be able to write a book. A lot of
anguish and swearing goes on, but I enjoy the experience. Yet, I must confess
that my greatest overall writing pleasure has involved two books that are
rather different from the programming tutorials. These two books are --
pardon the extensive subtitles -- "Code: The Hidden Language of Computer
Hardware and Software" and "The Annotated Turing: A Guided Tour
through Alan Turing's Historic Paper on Computability and the Turing
Machine." I have a few more ideas for books of this sort, and one of my
goals over the next decade is to bring at least two of them into reality.
SF: That’s very
cool. I’ll definitely watch your blog for those titles.
In your software books, you
include a lot of sample apps
and tutorials. Which did you enjoy writing the most?
years ago I took a two-day course on programming for Microsoft Surface --
the coffee-table-style computers now rebranded as PixelSense --
and on the second morning I wrote a program that conceptually features a
spinning disk, and when you touch it and move your fingers around, you paint
colors on the disk, but what you paint is also reflected in the four quadrants
of the disk so it becomes an interesting design. It turns out that the touch
processing and graphics are complex enough to pose a challenge for whatever
platform I bring this to. The Windows Phone 7 version is in the marketplace
under the name SpinPaint,
but it's an XNA program rather than Silverlight, and the Windows 8 version
makes use of DirectX.
SF: From books you
write to books you read. What books are
on your bookshelf (or on your eReader)?
CP: Writing a book is so consuming that I'm not
getting an opportunity to read as much as I like. But I recently finished
Kate Summerscale's "Mrs. Robinson's Disgrace," a fascinating
dissection of mid-Victorian culture in the context of one of the first
scandalous divorces to take place under England's Divorce Act of 1857. I'm
making my way through Hilary Mantel's novel "Bring up the Bodies,"
the second in her trilogy about Henry VIII seen through the eyes of Thomas
Cromwell. Hoping for my return back to the world of the reading are
Stephen Carter's alternative history "The Impeachment of Abraham
Lincoln" and Rebecca Stott's "Darwin's Ghosts," which traces
evolutionary concepts back to Aristotle.
SF: Wow. All of those sound very interesting. What else might people not know about you?
CP: If I had the space for it, I would buy a loom and
learn how to weave, and if I had even more space I would build a replica of
Vannevar Bush's Differential Analyzer, and if I had even more space I would put
together a gamelan ensemble, so maybe it's best that I'm confined to very
small living quarters.
SF: LOL. It may be best, but I would love to see (and
hear) all of those! One last question and then I’ll let you go. What is your favorite word?
CP: Eclectic. It's similar to electric but much more versatile.
SF: Love it! Always a
pleasure Charles. Thank you!