On Books (WPF and Otherwise)

Don Box's Spoutlet

Syndication

Someone pointed me to the coding horror comparison of Charles Petzold and Adam Nathan's books on WPF.

It’s painful on many levels to read both it and Petzold’s reactions to it and other criticisms.

With respect the books themselves, I’ll hide behind “professional courtesy” and not violate the “books authors don’t criticize other people’s books” commandment that I learned (painfully) from Bob Orfali.

With respect to the blog posts however, Charles does make two points that I feel compelled to react to.

On XAML

A lot of people comment on the paucity of screen shots/images in Petzold’s book. I think this one is cosmetic and Charles himself has admitted he wish he had more of his. This one is trivial to fix in a 2nd edition if Charles really wants to change it.

Where I think Charles and I disagree is on the use of XAML, which Charles manages to postpone using until page 457.  Here’s Charles’ explanation from his blog:

But I'd still structure the book the same way because I think my coverage of the C# API and the WPF intrastructure provide an excellent foundation for eventually incorporating XAML into your WPF applications.

The notion that looking at WPF through the lens of C# rather than XAML is somehow more “foundational” or “deep” is missing the point. 

Except for input/event handing, pretty much the whole WPF enchilada adheres to the “markup equals object model” mantra.

As a WPF user, I spend at least as much time reading and writing XAML as I do reading/writing C# code that does WPF-isms. I do spend a lot of time in C#, but little of it is WPF specific, which arguably is one of the strengths of WPF’s data/content facilities.

In my opinion, the sooner folks get thrown into the XAML pool the sooner they learn to swim.

On Books

The broader point Charles makes reads on the role of the technical book in circa-2007 programming, and on this one, I think Charles and I are again at odds.

Charles’ statement that “PowerPoint has won” is in my opinion the wrong conclusion to draw from the data at hand.

Unlike the book writing period of my life, my job now is focused on producing software that helps my employer make more money. 

I think that makes me the prototypical customer for books like Charles and Adam write.

Here’s what I can state about being on the “consumer” end of the book transaction:

If a given technology is tangential or a detail to my getting my job done, I won’t buy a book. Period. End of story. What I will do is spelunk the technology using Reflector, even if I have source access. I’ll also scan the web using my search engines of choice and then spend 30 minutes or so harvesting the results.  On this kind of task, I’m pulling together the narrative in my head as I go.

If a given technology is central to what I’m building, I’ll buy many books on the topic based on the principle that I will opportunistically glean value from them at some point.  

My general selection process is based on publisher. Addison Wesley and Morgan Kaufmann are tops for certain kinds of problem domains. O’Reilly and Pragmatic Press are tops for other domains. If it isn’t one of those four publishers, I probably won’t buy it.

So, given the stack of books I just picked up, which one do I read? That’s easy: I’ll read the shortest book on the topic.

Let me repeat that.

I’ll read the shortest book on the topic.

Here are my reasons.

1.      I have limited time and want to optimize my spend. This is simple time management, plus I’m impatient (ask anyone who has to converse with me).

2.      I find that most O(1000) page books are that long because the author didn’t do his/her job of eliding unnecessary detail and/or included a variety of topics that aren’t central to getting the gestalt – that is, topics that would fall into my “surf the web and spelunk in reflector” category of technologies.

3.      Often, a short book reflects the author having done more synthesis and distillation up front and will often yield a more “to the point” and insightful book.

This isn’t about me wanting PowerPoint.

This is about me wanting the most time-efficient way to deeply understand a technology so that I can do a better job producing software that helps my employer make more money.

Having to wade through thousands of lines of superficial/tangential C# code in a book rarely if ever satisfies my efficiency or depth requirements. Unlike some of Charles’ critics, I don’t need a lot of figures either, although UX technologies like WPF certainly requires more than say a book on LINQ or SQL Server would.

Where are we?

Charles states “I know what I'm doing. I've been writing books like this for 20 years.

The interesting question in my mind is how much or little today’s programming profession resembles the one that existed when Charles’ first book made such an amazing impact.

 

 


Posted Apr 29 2007, 11:23 AM by don-box

Comments

Steve Loughran wrote re: On Books (WPF and Otherwise)
on 04-29-2007 1:38 PM
I dont think you can be one of the "old school" windows programmers without having fond memories of Petzold. His "programming windows" book was all there was, in the days before MSDN CDs.

But the world has moved on, and you have to be ruthless and ask whether developers themselves need that much detail. Or more importantly -how much is it worth. A comnplete, academic quality book has a time-to-market hit compared to something smaller, more update costs (believe me), and can take a lot of effort. As the lifespan of a technology decreases, the value of a definitive bible decreases, even as the time to do it increases (on account of the increasing complexity)

Now that Amazon own a few HP indigo printers, amazon can actually do on-demand book printing. Perhaps the future will be small volume runs of timely content, rather than mass-market, 100K+ books.

-steve
Jon Skeet wrote re: On Books (WPF and Otherwise)
on 04-29-2007 2:09 PM
This is very interesting. I can't say I've read Charles' book, but the explanation of why he's written it "C# first" rings true for me - at least nearly. I wouldn't the first bit of XAML in the book to be that far in - I'd want it to be in a very early chapter which gave enough information to do random experimentation. After that, however, I'd love to read the details of what routed events really are, how attached properties work etc from a C# point of view - then see how they work in XAML.

My guess is that this is a matter of personal preference, and that actually we all find it quite hard to really know whether our preferences genuinely reflect the best way of learning *even for ourselves*. It would be phenomenally hard to put together a fair test which gave one style and then the other for comparable technologies, and tried to give them equivalent "usefulness" in daily life etc.

What will fascinate me is seeing what authors do about LINQ and C#3/VB9. The C# compiler is "just" converting the LINQ statements into a bunch of calls, usually to extension methods. The C# 3 spec even spells out those exact conversions. So how should an author write - LINQ-first (where you neither know the extension methods being called nor the C# compiler conversions until you've read the relevant section) or C#-first (to tackle just the extension methods first and then the compiler conversions separately).

I suspect that the LINQ-first version would get someone up and running quicker, but the C#-first version would make them more confident in their ability to understand what they've written.

Is it fair to presume that Don would prefer the LINQ-first approach, given this blog entry? It looks like it, but Don's one of those people I wouldn't like to try to second guess.

What does anyone else reckon? Enquiring minds want to know.

Jon

PS On the "shorter the better" front: absolutely. Very few of my favourite computing books are long.
Anthony Cowley wrote re: On Books (WPF and Otherwise)
on 04-29-2007 3:33 PM
I, too, find myself in simultaneous sympathy and disagreement with Charles on these issues. Ignoring what everyone seems to agree on (more pictures!), I'll say that I understand his desire to explain how the technology works, but I disagree with his organizational choice because it doesn't provide sufficient motivation. I would much rather be exposed to XAML piece by piece (with that experience as the primary thrust of the book), and have accompanying explanatory text and C# code to go with each piece.

Not only do I think this helps answer the question, "Why should I care?" that every reader asks every 2 or 3 pages, I think it helps at least somewhat alleviate the length problem. I still buy a fair number of programming books, but I find that I very often don't get all the way through them. I get the basics, hopefully with explanations about the history/plumbing, and then I explore advanced topics on my own. Sometimes I'll refer back to the later sections of a book I never finished long after first reading the earlier parts just to see what the author has to say about some more obscure or subtle aspect of the technology that I've run into in my own wanderings. This style of reading is a response to the facts that an author's focus may not be 100% appropriate for me, and that I can better appreciate the subtler points when I've come across them in my own work.

With this in mind, the mixing of XAML and C# in a WPF book makes the first half just as useful as the second half, so people who don't make it all the way through the book can still get some XAML know-how from the book they bought to learn XAML.
Egg Shen wrote re: On Books (WPF and Otherwise)
on 04-29-2007 4:01 PM
I don't think Petzold fully understood Atwood's points. The Powerpoint argument is a strawman that comes off like a defensive, sound-byte jab.

People do not have the time to muddle through paragraph after paragraph of dense material. We read technical books to learn. The quicker you can transfer the fullness of the subject, the better. Studies have shown that prose is only 1 way of doing this effectively. Also, it's 2007 and Petzold's book blog is read only. Not to sound too harsh, but come down and talk with us.
Dan McKinley wrote Is XAML an Elaborate Joke?
on 04-29-2007 10:24 PM
Don Box says:As a WPF user, I spend at least as much time reading and writing XAML as I do reading/writing...
Espen Harlinn wrote re: On Books (WPF and Otherwise)
on 04-30-2007 1:37 AM
Petzold tries to reach a wide audience with his books – that is his strength and his weakness. Wading trough a 1000+ page book can be quite daunting, especially when the project you are working on should be finished a couple of weeks before you even heard anything about it. I can’t say I really enjoyed reading his book, but I think I would have if I wasn’t that pressed for time. It didn’t solve any of my immediate problems at the time, but it did provide me with a thorough understanding of WPF and to some degree XAML.
I also think he did the right thing when he divided the book into two separate parts – the XAML part wouldn’t have made as much sense as it did if I hadn’t read the c# part first. XAML is by its nature quite wordy – and I think some of the finer points from the c# part would have been lost in the translation if he had introduced them along with XAML.
edddy wrote re: On Books (WPF and Otherwise)
on 04-30-2007 3:40 AM
+1 to Egg Shen
Adlai Maschiach wrote WPF Books
on 04-30-2007 8:43 AM
Just read the On Books (WPF and Otherwise) from don box . The point in the end was a quote from petzold:
Brad wrote re: On Books (WPF and Otherwise)
on 04-30-2007 10:40 AM
I've read a few chapters of A=C+M, and I think it is just brilliantly well-written, especially in terms of progression and logical flow between sentences and paragraphs. But it is a book to be *read*, and apparently that isn't what the bulk of the market wants anymore (which is part of a larger, scarier cultural trend towards Google-think). Too bad, because I agree with Mr. Petzold that the payoff would be worth it.
Sheaf wrote re: On Books (WPF and Otherwise)
on 04-30-2007 11:15 AM
It's funny, I bought both books a month or so ago and I started with the Nathan book but switched over to the Petzold book after the first two chapters. I felt much more comfortable reading Petzold than I did Nathan. I almost always buy more than one book on a technical subject because there is are always things in one book I find confusing and having another data point is often helpful. Looking on the web for info is fine but there is a lot to be said for getting away from the computer screen and reading a real book.
Keith Hill wrote re: On Books (WPF and Otherwise)
on 04-30-2007 3:55 PM
I had this conversation with the Wrox folks back at PDC 2003. My time is very limited and I'll almost always pick the book with fewer pages. I absolutely hate "Unleashed" style books. Who has time to read 1000 pages of mostly samples? I value those authors who take the time to condense the essence of why should I be interested in a technology, what problem does it solve that other approaches failed at. After I've been given some context then educate me (without superflous examples) on the technology. This is what I really valued about the Developmentor classes (they had this nailed) as well as the "Essential *" series from Addison Wesley.
Anthony Tarlano wrote re: On Books (WPF and Otherwise)
on 04-30-2007 6:44 PM
In my Amazon review I wrote that I believe that Petzold's book "allow(s) developers to gain the knowledge necessary to use tools effectively ... by allowing a developer to gain the knowledge necessary for understanding and reasoning over (WPF) software ... (thus) making the lives easier of those (developers) who understand the underlying API's and object model."

This book discussion as it relates only to Charles Petzolds book, not addressing Adam Nathan's book, boils down to whether Charles believes that developers *learn* more from taking a bottom-up vs. top-down approach to learning the WPF Framework.

I dare say that Dev. tool vendors today increasingly push a top-down approach to learning using IDEs (with features like code completion), small books, 5 minute web-based how-to's, and declarative markup language examples in order to target the widest developer audience possible and not necessarily because it is better for learning.

From the organization of Charles book, I think we can conclude that Charles believes that a bottom-up approach to learning WPF allows a structured way for a developer to gain insight and to reason over the framework, where they can use high-level IDEs and languages more effectively.

kariato wrote re: On Books (WPF and Otherwise)
on 05-01-2007 9:50 AM
I too have both books on my bedside table and even have a preorder in for the CP's 3D book. So I must have good view for CP's book. I agree in the difference in styles.

This can easily be viewed in two different books. Head First Design patterns vs the original head first design. I look at head first design as a great introduction book (read it twice) while I'm still fighting with the original design pattern book but that book has more depth.

But I think it is unfair, Unleashed is a XAML book first while A=C+M is a code book first. (He even put code before markup.) Without a good understanding of either AJAX+DOM the unleashed book could get you lost real fast.

If you are a programmer without good web experience get A=C+M. If you have a more rounded experience get WPF unleashed.
KNOCKS wrote re: On Books (WPF and Otherwise)
on 05-01-2007 3:16 PM
I would go with CP book anytime for the depth (or is it the width) of the topic.
You really cant do a copy-paste job with a technology your are picking up, can u?
Ramblings From The Social wrote Wow. Petzold really doesn't get it.
on 05-03-2007 4:47 AM
I have a tremendous amount of respect for Charles Petzold. When I originally was utterly confused with
Alex wrote re: On Books (WPF and Otherwise)
on 05-05-2007 6:54 PM
I like the Charles Petzold's book. It has much deeper coverage of WPF than Adam Nathan's book. I have started to learn WPF from Adam Nathan's book but switched to Petzold's book.
Wells wrote re: On Books (WPF and Otherwise)
on 05-08-2007 4:04 AM
Donbox has made a good point here:

If a given technology is tangential or a detail to my getting my job done, I won’t buy a book. Period. ... I’ll also scan the web using my search engines of choice and then spend 30 minutes or so harvesting the results.

In the company i work for, over 90% of the developers are doing this: goolging for any problem they encountered. Even the architect doesnt read any books, he's too busy reading posts on blog.msdn.com, forums.microsoft.com, codeproject.com, codeguru.com etc. etc.

So what did he miss? the big picture and the critical details. His head is completely muddled with bits of info here and there.

I don't think he has any chance of getting a job at another (better) company, because what can he put on his resume? I've been googling around to maintain a stupid, poorly designed and undocumented system for 10 years, using Visual Basic, C#, ASP.NET blah blah...

So what's your biggest strength? eh... googling for info.

Anyone thinks such a lame answer can cut the mustard during an interview?
Jonathan Parker wrote re: On Books (WPF and Otherwise)
on 05-17-2007 10:14 PM
I can't compare books but I can remind authors that most programmers have mild ADD these days!
You might even say that programmers are required to have mild ADD in order to learn everything they need to know. lol.
Javier Estrada wrote re: On Books (WPF and Otherwise)
on 05-30-2007 5:50 PM
Learning about a topic is different for everyone. Some of us learn visually, others learn by reading, others by experimenting or a combination of these and other techniques.

In addition, a book is an investment on time and depending on how much you have of it, you can invest in something that will give you "immediate gratification" or something that you'll treasure for years to come...until the next new thing comes out. Whatever floats your boat.

I read Charles' blog and his approach makes sense **to me**, although his will not be the first book on WPF I'll read for other reasons.

My decision was between Nathan's (per recommendation) and Chris Anderson's book (per conviction). I chose Chris' book because it fits more my style--I work as an architect, too.

After a three-day class on WPF from Microsoft, at the end of the class my interest is not so much in learning about XAML first. Rather, it is about the architecture and the rationale behind the architecture, the capabilities and constraints in integrating it with our existing UI components, the hardware requirements for our customers, in a nutshell, the justification for the technology. Certainly, Chris' book tackles XAML, but it is not as intense as what I've seen with Nathan's book.
dbox wrote 关于书籍(WPF及其它)
on 06-20-2007 8:56 AM
??????coding horror comparison,???????Charles Petzold?Adam Nathan???,???WPF??

Add a Comment

(required)  
(optional)
(required)  
Remember Me?