For those who haven’t been paying attention, Windows Presentation Foundation (WPF) is the next generation platform for Windows Forms Application development. I recently decided to investigate. It was something of a whim as I’ve not been working on Rich Client applications in some time. Most of the work we do at CIBIS is focussed on web applications development but I figured that the skills would be transferrable to Silverlight. Given his reputation I decided to read Charles Petzold’s book “Applications = Code + Markup”.
It just so happened that before I started reading the book I was talking to a well regarded expert in the WPF field. I mentioned that I was about to start reading and was told that several other books would have been a better place to start. When pressed he said that this wasn’t Charles Petzold’s best book, not that it was a bad book, just that he expected better of someone so great. I was nonplussed to say the least.
I pressed on regardless and worked my way through the book. At around a thousand pages it’s fairly solid book with numerous examples and exercises. Now that I’ve read the book I can honestly say that I disagree with my friend’s assessment of the book.
A lot of technical manuals are written using very simple language and are deliberately written to make it easy for the reader to reference information in the book as and when they require it. This type of manual has always served a rather important purpose for programmers – as a vital information source on syntax and architecture when we’re actively engaged in the process of creating software. In recent years this type of book has been supplanted largely by blogs and technical references on the internet. The ability to access information on demand enables you to search and find the information faster than it would take you to walk to the bookshelf and open the book.
However, looking back to when I began programming there were a number of books that I would consider to have been instrumental in my development as a programmer. These manuals were well written and made the concepts they were explaining approachable, but were written specifically to be read through in order to initiate the reader into a broader understanding of the underlying concepts. These are the books we look back at years later and revere as inspirations that made us pursue one technology or another. Perhaps with the advent of blogs and new media I’m just showing my age. But for anyone who still sees value in the act of reading, “Applications = Code + Markup” is such a book.
As per the title, the book itself is broken up into two sections reflecting the two main aspects to WPF programming: “Code”, the instruction and control structures of the language and “Markup” the declarative and descriptive side of the language. Please note, this book is written for programmers, not designers. While the mark-up section could very easily have focused on how to use tools like Expression to create the required Markup, the book instead focuses on how to write Markup directly in the Visual Studio designer in the same way a web developer may write html code without accessing the design tools. Petzold is encouraging developers to gain a deeper understanding of how to build WPF applications without simply dragging and dropping objects onto a form.
The book begins simply, walking the user through the basics of WPF, but the explanations are quite erudite. Overall the level of knowledge included in this book is impressive. For someone like myself who has primarily worked on business applications, I’ve rarely had to delve into complex mathematics underlying Bezier curves to describe the path of animated objects. With the focus of WPF on the ability to present data in new and visually appealing ways understanding such concepts becomes imperative. There are extensive examples that demonstrate how to simply and easily build applications to do a wide range of tasks. The chapters on animation and graphics manipulation are particularly enjoyable.
Petzold not only explains the how of WPF but also the why. He gives insight into the reasons that the WPF team have constructed the language in the way that they have. His insight into the history of application development and the place of WPF in the technological landscape give this book a unique perspective. In short, I really enjoyed this book and would definitely recommend it to others who were interested in learning WPF.