CARVIEW |
April 24, 2007
How Not To Write a Technical Book
If I told you to choose between two technical books, one by renowned Windows author Charles Petzold, and another by some guy you've probably never heard of, which one would you pick?
That's what I thought too. Until I sat down to read both of them. Take a look for yourself:
Charles Petzold's Applications = Code + Markup:
Adam Nathan's Windows Presentation Foundation Unleashed:
Beyond the obvious benefit of full color printing, which adds another dimension to any text, it's not even close. The Nathan book is the clear winner:
- It's full of diagrams, screenshots, and illustrations showing the meaning of the code.
- The text is frequently broken up by helpful color-coded sidebars such as "digging deeper", "FAQ", and "warning".
- The code/markup snippets are smaller and easier to digest; they don't dominate page upon page of the text.
- Liberal use of bullets, tables, subheadings, and other textual elements provides excellent scannability.
- The book has a sense of humor without being obnoxious or cloying.
- Did I mention it's in color?
The Nathan book is brilliant. It reads like a blog and competes toe-to-toe with anything you'd find on the web. Petzold's book, in contrast, is a greyscale sea of endless text and interminable code. There are so few diagrams in the book that you get a little thrill every time you encounter one. It also artificially segregates code and markup: the first half is all C# code; it's not until the second half that you see any XAML markup whatsoever, even though XAML is one of the most important new features of WPF, and the one developers will be least familiar with.
I suppose this sort of old-school treatment is typical Petzold. What do you expect from a guy who thinks Visual Studio rots the minds of software developers? The difference in approach is immediately obvious to anyone who opens both books. One looks compelling, fun, and inviting; the other looks like a painful, textbook slog that's the equivalent of writing code in Notepad. Petzold's an excellent writer, but writing alone can't make up for the massive layout deficiencies of his book.
It's too bad, because I loved Petzold's earlier book Code, which was a love letter to the personal computer filled with wonderful illustrations. As much as I respect Petzold, you should avoid his WPF book. Get the Nathan book instead-- you'll love it. Publishers, take note: I'd sure be buying a heck of a lot more technical books if more of them were like this one.
Which book would I pick?
If the publisher was O'Reilly then would probably go with the O'Reilly book. Even though the book author and coverag of the topic may be bad the editing by O'reilly really bumps it up a bunch of notches.
Other the side I would advoid any of the Unleashed or anything from Sams publishing. It use to be that Sams was the tech book company, really dating myself here, but a good decade ago they became trash. Poor writing,editing and layout not to mention to many times bitten by following code in thier books and finding it was filled with problems and bad practices.
If Sams has decided to turn itself around I may have to take a look at them; or is this book just an exception?
I understand Jeff's enthusiasm for Nathan's book, but to be frank, I think both layouts have their problems. My first impression when seeing Nathan's excerpts was confusion from all the colors, different fonts, etc. The text seems to dance in front of my eyes, which is not what I expect from it.
I would say that a moderate use of black-and-white syntax highlighting and a slightly slower dynamic of the text would be a better solution. Somewhere in between.
Cheers,
Carl
Carl Seleborg on April 25, 2007 02:48 AMI read the excerpt from Charles' book and I'm disappointed.
For example, he goes through explaining basic concepts such as the Application and Form object, and talks about the Run() function, but doesn't illustrate it properly for the reader. His explanations are confusing, oddly-worded, and can be considered downright wrong unless you actually know what he's talking about.
If this book is for intermediate or advanced developers, why is he explaining basics such as "static" or "Application.Run()"? And if this book is for beginners, why does he not delve into greater detail about these things if he's mentioning them at all?
Continuing on the example of Application.Run(), his explanation makes it sound almost as if it did nothing but call the Show() function of the form, but we all know it does way more than that. It starts the message pump, spawns and executes the the UI thread, creates the application domain, etc (and not necessarily in that order).
Anyway, I think one of the reviews of the book on the Amazon.com site is pretty accurate. It's like a wall of text with no organization and confusing methodology. Like, who binds events in the Main() function of a program?
I'm not sure someone of Petzold's disposition (of disliking IDEs and mixing in layout code with the actual program) should be writing books on UI design and proper coding practices. Advocates of "pixel tweaking" -- ie, tweaking the "new Point(34,50)" for button positions in manually generated layout code -- should not be writing books on UI design either.
Just my two cents anyway.
Take care,
Sam
Take a look at the "Head First" series of books. I recently read the excellent "Head First Design Patterns" and I can honestly say it was one of the few technical books I have enjoyed reading.
They use a variety of techniques, including bold layouts, pictures, cartoons and conversational-style writing. It all seems a little silly at first, but once you start reading you realise how much easier it is to take in when compared to a dense, serious block of text.
But it's not a "For Dummies" approach: despite the "fun" style they do cover the topic to a good technical depth.
Graham Stewart on April 25, 2007 03:18 AMThe passage from Petzold lacks focus and organization. He seems to jump from one topic to another willy-nilly. It makes it very hard to extract actual useful information.
A. Lloyd Flanagan on April 25, 2007 04:08 AMI agree that Petzold's book is a difficult and challenging read, but having pushed myself about 1/3 into it, and I will soon be revising that read to experiment with the samples, I must say it has provided a very good insight into WPF for an advanced developer.
I think his 'beginner' treatment of Application.Run etc. is for advanced programmers but Windows beginners.
Brady Kelly on April 25, 2007 04:16 AMI bought Nathan's book a few weeks back, the use of colour to more clearly define the content was the first that I noticed.
I hope that more technical books follow this route as it I find it much easier to pick through and read.
Peter Bridger on April 25, 2007 04:35 AMAdam Nathan's earlier book .NET and COM, was by far the most reliable book on the subject. I am not suprised that his WPF book is excellent as well.
Joe on April 25, 2007 04:44 AMI'd agree. If a book didn't compel me to look deeper, I'd get bored halfway through.
One of the biggest gripes I've held for a book almost soured me to it immediately: a very, very bad index. This I would rate well above almost any other requirement for reference (or indeed "beginners") books.
Brandon on April 25, 2007 04:56 AMWithout questioning Mr. Petzold's reputation or expertise, I'll have to say I was very disappointed with his books in the past (I have not read Code though.) The previous "Programming Windows with C#" seemed to me like a boring alternation between almost useless raw GDI+ tricks and trivial coverage of the toolbox controls.
As Graham mentioned above, the Head First series brings a lot of fresh air into this space, as do the titles from the Pragmatic Bookshelf (no matter how uncool the word 'pragmatic' sounds.) It's a pity that both series don't have more .Net coverage.
"that's the equivalent of writing code in Notepad."
While it may be painful, I find it necessary sometimes to use the most basic editor. Although if I can I use Notepad 2 to make things a bit easier on myself.
oftencloudy on April 25, 2007 05:42 AMAmazing!
I have both of these books and came to the exact same conclusion. Petzold's book was a real dud. I had a heck of a time getting through it. It was dry and boring with no clear delineators between topics. He would roll from one topic into a completely unrelated topic with little more than a blank line separating them. It makes going back and finding a specific piece of information virtually impossible.
Nathan's book is much easier to read and is full of great information. I've actually read it twice!
When it came out, the Petzold fan club gave it good reviews because... he's Petzold. But frankly I have never been so disappointed in a book before. I waited months for that book. But when it came it took months to get through. Absolutely terrible. Sorry Charles.
Matt on April 25, 2007 05:56 AMA word about color (in general... the above example isn't too bad).
Maybe I'm old school, but the color highlights of code always seemed a bit amature-ish. Neat idea, but so often poorly done. Maybe if they didn't strive to use so many colors, or maybe if they varied the brightness a bit (they always seem too bright).
However, I have to say I love bullets and sidebars (so long as the sidebar doesn't make me span several pages).
I don't really understand why anyone would even want to buy a programming book. No way to run the example code (without finding it online or on some attached CD/DVD), no way to copy and paste, no way to click a link to a different topic, the trusty web browser with Google bookmarked to look up terms or expressions you don't know is far away. It's like living in the dark ages again.
[twisti] on April 25, 2007 06:07 AMI'm not familiar with either author, but the first image immediately reminds me of a textbook. the code breaks between pages, it's slow to read and BORING!
The second image includes syntax highlighting - perhaps a programmer's best friend. The comparison reminds me of the difference between vi and vim.
David H. on April 25, 2007 06:11 AMYou can't satisfy everyone. Below, I've included a quote from a review I wrote of "C++ How to Program" (4th Edition) by Harvey M. Deitel, Paul J. Deitel (you can look it up on Amazon if you want). The point of it is that a good chunk of the other reviewers hated the use of color in the book. Yet, the color helped with readability and understandability. It seems to be a personal choice:
"...the use of color in this book seems to be a recurring motif in the reviews here. I was very pleased with the book's use of color. As fully explained in the preface, all that color conveys information to the reader: it's not there for decoration. First, the code examples (and there are a lot of them) all have a light yellow background, so they are automatically offset from the rest of the text. Then, the type within the coding segments uses other colors to mean certain things: comments are in green, keywords are in dark blue, errors are in red, constants and literal values are in light blue, and all other code is in black. Newly introduced code is also highlighted for emphasis. This is very much in keeping with what various IDEs do to make code more readable (see any of Microsoft's Visual xxx products, the Eclipse Project Universal Tool Platform (specifically, the C/C++ Development Tools), and the Bloodshed Dev-C++ IDE). Beyond that, the book also uses colors to emphasize the titles of the programming tips in the text (i.e., Good Programming Practices, Common Programming Errors, Performance Tips, Portability Tips, Software Engineering Observations, and Testing and Debugging Tips). Again, all of this is an excellent way to convey more information to the reader and is not "distracting" in any way."
David A. Lessnau on April 25, 2007 06:17 AM"Continuing on the example of Application.Run(), his explanation makes it sound almost as if it did nothing but call the Show() function of the form, but we all know it does way more than that. It starts the message pump, spawns and executes the the UI thread, creates the application domain, etc (and not necessarily in that order)."
No, it doesn't. The UI thread is the thread Application.Run() is called on and the appdomain has to be created well before that. It is, however, a message pump.
Wyatt on April 25, 2007 06:25 AM[twisti]: There are two primary reasons to get coding books:
1) The auth is presumably an expert in the field and as such will have better advice. If the advice is bad this can typically be discovered through reading reviews. On the web you only come across code snippets that can be written by anyone. It's much harder to determine if their proposed solution is good or not.
2) This is related to number one in that the author is an expert on the field (presumably). They tend to have a better idea of the order the material should be presented in. If you're going to teach yourself something like GUI programming solely from the web you are bound to make many common mistakes that could have been avoided with a good book that approached the subject appropriately.
Matthew P on April 25, 2007 06:29 AMJeff,
I think it was not a good idea to include your Amazon ID on the link to Nathan's book.
I am sure that's not the point of the article, but it may attract some atention.
I'll also say that unless you've actually read the Petzold book you can't really get a feel for how bad it is just from this blog posting. It rambles on and on explaining each intricate detail of every example. The book is basically a bunch of useless examples with a line by line description of what it's doing. Since he uses the same examples over and over again by building on them throughout the book, you end up reading the exact same descriptions over and over again.
Don't get me wrong. There are some really good little gems/nuggets in Petzolds book. But you are often likely to miss them because you are skipping large blocks of repetitive prose just hoping to get through the book. And even if you did stumble across one, good luck finding it again when you really need it.
So it doesn't really have anything to do with color. It's more about creating subchapters and organizing a book so that it is readable. And the content needs to be useful and to the point. Not repetitive and useless.
Matt on April 25, 2007 06:37 AMOne thing I hate about Petzold's (and most other authors) code samples is that you will almost never find them commented the way that "real" developers comment their code. Commenting is not functional block headers describing the name of the function and who wrote it. It is a brief description of inputs and outputs, plus some in-line comments describing WHY something is being done. If more authors commented their example code it might add a few lines to the listing, but it would be invaluable in both helping people disect it and instructing other programmers in proper commenting technique.
Chubber on April 25, 2007 06:48 AMI've been waiting for someone to say that the emperor has no clothes.
As others have pointed out, it's not just the color and layout that make Nathan's book great -- although they contribute. It's the content. In fact, I was more skeptical of the book originally because of the color but there is no denying that it was done mostly right. Nathan's book is the epitome of what a good technical book should be.
The approach to WPF is best represented from the XAML perspective with code to supplement/complement the markup. The code in the Petzold book is not typical of code that anyone would write for WPF. But does it help understand the innards of WPF? I'm not convinced that it does and I'm someone who wants to know how things work. I think Petzold's approach obscures more than it makes things clear. Getting to XAML half way through the Petzold book was, I think, a mistake.
Perhaps was Jeff was pointing out is that look and feel of these two books precisely conveys the quality of their substance.
Similiar Obvservation on April 25, 2007 06:53 AMI actually have made the same decision... choosing from several books related to WPF, Nathan's book is clearly a great choice.
fabiopedrosa on April 25, 2007 07:05 AMTo [twist]: you're really dating yourself, if you think it's like living in the dark ages *again*!
Daniel Dang Griffith on April 25, 2007 07:24 AMI'm going to beat a nearly-dead horse (I don't think it's fully beaten yet), but using the color samples and the like to describe Nathan's book isn't doing his book justice. The amount of insight he gives on so much of WPF is amazing; I've partially read his .NET and COM book and while the feel of the two books was different, they both provide one important goal: educate the heck out of the reader with information you won't get without a lot of experience.
The color samples are nice, the way he puts tips and sidebars is nice, but it's his content that is the shining star. Every other resource I've read on WPF doesn't cut it on the detail of the whys and the hows. Most other books spend too much time giving the "if you write code 'x' then 'y' will happen" and not enough "this is why 'x' causes 'y' to happen."
Adam on April 25, 2007 07:42 AMI think the head first books take a lot of space for motivating and building pictures that more inclined people form in their head themselves. Depending on the target audience this is good or bad, it loses space for 'actual' content. Although I like the author's blog I couldn't get myself to buy one of the books -- the topics aren't mine, and the german translation (necessarily) comes closer to the silly border.
My only 'for dummies' book was 'Shakespeare...', btw.
Andreas Krey on April 25, 2007 07:58 AMSam wrote:
If this book is for intermediate or advanced developers, why is he explaining basics such as "static" or "Application.Run()"? And if this book is for beginners, why does he not delve into greater detail about these things if he's mentioning them at all?
This has been my problem with every Petzold book i've ever read, going back to a book on the OS/2 PM API. I'm always left with the same impression i get reading an MSDN API reference - a basic idea of how an API should be used, but little understanding of why, or what pitfalls might arise. He has a knack for imparting just enough information to get you past the easy pitfalls, but falls short of giving you anything approaching a solid understanding of the system itself, the design goals that contributed to it, or the potential problems with using an API in ways that its designers might not have envisioned.
Learning an API by reading Petzold books is like learning to drive by reading a DMV's drivers manual. You'll know enough to get by, but you'll never be more than just barely competent.
Shog9 on April 25, 2007 08:25 AM"It reads like a blog and competes toe-to-toe with anything you'd find on the web."
You say that... as if it was a GOOD thing!?
*head explodes*
Can't say anything on Petzold's new book yet as I'm not diving into XAML for a while. His WinForms books were pretty good but you need both of them, and Petzold certainly doesn't care for people who use the Visual Studio designers or toolboxes. You need other books for that.
I do agree that it's strange and annoying how every single of his .NET books has these "absolute beginner" explanations of the basics of .NET and C#, as if he tried hard to pad his page count.
Chris Nahr on April 25, 2007 08:32 AMI normally name "Programming Perl" when I need a good example of a really good technical book. It does a lot of things right.
The level is absolutely correct. It doesn't, like many others, assume you know nothing about programming. I don't want a book with a hundred pages telling me all about "if" statements.
The structure is good -- very few forward references -- which makes it a good introduction and a reference.
Finally it's very well written. Why are most technical books so dry and boring? I like a little humour to lighten these dense programming tombs.
Coloured listing and screen-shots can enhance already well structured, well written text but they can't save an otherwise poor book.
Stephen on April 25, 2007 08:44 AMI would also suggest avoiding any book from Jesse Liberty; O'Reilly or not.
His code rarely works, he doesn't follow standard coding conventions (puts variable declarations at the END of the class and doesn't use any indicator that the variable is a class level variable), and he can't seem to convey his thoughts very well. I'm not sure why anyone would pay the guy to write a book.
Kai Tain on April 25, 2007 08:46 AMI agree with "Programming Perl". Well written, and describing the context of the language's features (including sometimes relevant portions of Larry's background in linguistics) in a manner that really helped them to sink in.
I'll also mention Donald Knuth's book on TeX. Reading it was a revelation to me in the possibilities for technical writing.
I guess I'll also mention the old DEC documentation. Today's online "help" -- gimme a break.
@Shog9:
"I'm always left with the same impression i get reading an MSDN API reference - a basic idea of how an API should be used, but little understanding of why, or what pitfalls might arise."
That's exactly what I tried to say but you said it so much better in fewer words.
The 5th rule...
Great coding ability doth not make great authoring ability...
rabid wolverine on April 25, 2007 09:30 AMCertainly writing is first and foremost, but layout actually has more than just aesthetic value.
Read the intro to any of the Head First books and you'll learn that they're layouts are not just inspired by whimsy, but by research into how people absorb information.
With long unbroken blocks of text, readers only remember the first and last sections. By breaking it up into bites, and with little sidebars etc... that reinforce the main content, readers retain more information.
Haacked on April 25, 2007 09:39 AMI agree that Nathan's book looks better in this context, but this is a snippet, so it might not be a completely fair comparison for the works on a whole.
With that said, I would get Nathan's book anyway. He did a terrific job on his COM and .NET Interoperability book. I am sorta surprised you did not recognize him.
Ryan on April 25, 2007 10:11 AMI wholehearted agree with Jeff about these two books. Adam Nathan's book was a joy to read and a valuable resource to get up to speed and understand WPF. I read it twice now and still go back to it for the "digging deeper" sections and to drill into details on specific topics.
I read the first 3 chapters of Petzold's book, chapter 19, and a few other chapters where the XAML part starts. The reading was tedious and the knowledge was not immediately usable. I didn't know what to expect with the code samples as there were barely any screenshots to illustrate the code. The part I also didn't like sometimes it's hard to just use the index and look up something and understand it as the chapters refer back to other previous chapters.
After working with WPF for awhile now, Petzold's book is way more clear. I still refer to it occasionally when I run into a problem programmatically doing something in WPF. Most of the time I stick with working declaratively in XAML. For a beginner I would definately recommend Nathan's book over Petzold's.
Apparently there?s sanity in the madness. Petzold blogged a lengthy post about why he structured the book the way he did https://www.charlespetzold.com/blog/2007/03/050139.html . The last 3 paragraphs are the most relevant to this topic. My emphasis added:
?If I had to write the book all over again, I'd do a few things differently: I'd definitely put a bunch of screen shots in the book. NOT DOING SCREEN SHOTS WAS A MISTAKE. ...
Reading a thousand-page book all the way through requires a big commitment and a lot of trust in the author. "If I devote the time, will the author deliver the goods?" My book was not written for reference or for skipping around. IT IS A COMPLETE TUTORIAL INTENDED TO BE READ FROM BEGINNING TO END, and if my decisions seem perverse ("Chapter 2 covers brushes????"), rest assured that my choices were not arbitrary, but instead the result of dedicated thought and consideration. I know what I'm doing. I've been writing books like this for 20 years.
Applications = Code + Markup is hardcore: It's for programmers who seriously want to learn the intrastructure and application of WPF ? both in code and XAML. ?
> I don't really understand why anyone would even want to buy a programming book. No way to run the example code (without finding it online or on some attached CD/DVD), no way to copy and paste, no way to click a link to a different topic, the trusty web browser with Google bookmarked to look up terms or expressions you don't know is far away. It's like living in the dark ages again.
Twisti, I totally agree-- the idea that books are competing with other books is an illusion. Books are competing with the web. And the Adam Nathan book does a surprisingly good job of it.
Jeff Atwood on April 25, 2007 11:16 AMTo anybody complaining about the color....don't you have color syntax highlighting in Studio?
Dennis on April 25, 2007 11:19 AMIt's funny, I'm having the exact same issue right now with a textbook on programming languages:
https://www.amazon.com/Concepts-Programming-Languages-Robert-Sebesta/dp/0321193628
...the author's idea of visually delimiting code snippets is....uhhh....oh wait. He doesn't. The only visual cue he gives readers is indenting and whitespace, and maybe more frequent italics/bolds. Other than that, he doesn't even have the decency to change fonts or not be a cheap ass and go for color. The entire book is like staring at a newspaper for three and a half months, except with no Sunday comics.
I also can't stand the the separation of subjects within chapters; the headers aren't distinguishing enough to let you know you're changing subjects, or still talking about the same subject. The difference between header sizes doesn't give the reader appropriate visual cue to let them know that we're moving on to a new subject.
Don't even get me started on the lack of meaningful diagrams/illustrations. All in all, it's very useful, intelligent material that has been conveyed in the crudest possible way. I'm glad I purchased the 6th edition for $13 instead of the 7th edition (which is almost identical) for $106.
Jeremy Noring on April 25, 2007 11:20 AMI haven't read either book but in general 'technical' books are usually not very much fun to read. Pictures and colors, try a comic book. I still have my fluid mechanics book from college and lets just say it will not win any book awards for its style and layout.
From reading about Mr. Petzold from some of his past work, it sounds like his style of book suits him perfectly. I think he still enjoys programming and notepad so obviously his book is not going to have a lot of pizazz. Maybe he should get a different editor to help him layout his book better.
I always have thought that tehcnical books should be written by non technical people with the content provided by the technical contributors, they would be able to get the points across in a clear fashion.
Jon Raynor on April 25, 2007 12:23 PMI read this blog and immediately went out and bought the book you recommended. "WPF unleashed" and I love it thus far. I didn't realize color code in a book was that much more interesting to read. Thanx for the heads up!
Steven Rogers on April 25, 2007 01:25 PMTry reading the Expression Blend documentation. That's what I did after slogging half-way through the Petzold book, playing with the samples along the way. Petzold was an informative but tedious experience. The Blend documentation is a surprisingly well-written intro to WPF concepts with the instant gratification of playing with them in Blend without having to write code. Petzold builds character, Blend builds cool apps, fast. :)
Oran on April 25, 2007 02:38 PMI have recently been reading this charming little book, Concurrent Systems, An Integrated Approach to Operating Systems, Distributed Systems and Databases. See - https://www.amazon.com/Concurrent-Systems-Integrated-Operating-Distributed/dp/0201177676
The presentation of a book is key to unlocking the information inside, this book is the proof for me. Jean Bacon knows her onions and the book is full of excellent information but it's taken me quiet a while to get to it through the tangents, wild cross referencing to bits further on, wildly abstract diagrams and the 'why use one word when 178 will do the trick' approach. Already a fairly dry subject this book adds silica gel...
Thanks for the excellent blog.
Mike Blamires on April 25, 2007 03:40 PMProfessional technical writers use a combination of active-voice writing and visual layout to facilitate the efficient identification and transfer of information. That is to say that a consistent set of visual cues enable a reader to more readily identify a particular type of information.
These cues are sometimes referred to as the CRAP rule: Contrast, Repetition, Alignment, Position. (This particular mnemonic shortcut was popularized by Robing Williams' "The Non-Designers Design Book").
Having said that, I'd probably indent the body content a bit, leaving the headings to protrude a bit to the left. This would provide an even easier set of visual "ladders" for a reader searching for a particular piece of information.
Finally, a sound document design strategy is too seldom embraced by the online world. There seems to be some unwritten rule that an easily apprehendable visual layout makes a Web page boring...
Riley on April 25, 2007 03:56 PMI'm not trolling, but to me Petzolds book seems to be laid in the exact same way as Code Complete by Steve Connell.
Would you have the same problem with CC2e Jeff?
Des Traynor on April 25, 2007 04:06 PMUh Sams is not trash, check out Stephen Prata's C++ Primer 5th ed, very well written, great examples, the best C++ book I've found yet.
And I totally disagree with anyone that says programming books are not good. Having to type the code out yourself (over copying and pasting from the net), puts it into your head much quicker.
asdasdasd on April 25, 2007 05:09 PMI just purchased Nathan's book tonight and so far I'm very pleased. Excellent writer. Very clear with an economy of prose. Reminds me of Sells.
I purchased Petzold's last C# book. In sits in some dark corner of my office.
Rich W on April 25, 2007 07:36 PM> Petzolds book seems to be laid in the exact same way as Code Complete by Steve Connell.
Visit a bookstore and open the books side by side. They're nothing alike. The only thing they have in common is that neither one is in color.
As I've mentioned before, color is undoubtedly a nice perk, but there are dozens of other reasons to pick the Nathan book, too.
Jeff Atwood on April 25, 2007 08:28 PMI've bought and read every book on WPF that has been published. The book by Adam Nathan is my favourite. The sells/griffiths book from O'Reilly is #2. Charles Petzold is clearly a smart guy and his book has some good material in it, but really misses the mark. I think not including screen shots in the book (which was a conscious decision he made) was a huge mistake. There are whole paragraphs of text describing what you will see from a particular piece of code - why not just SHOW the result? I also think the approach he took devoting the first half of the book to "WPF in C#" also hurts the readability of the book. The Adam Nathan/Daniel Lehenbauer book is unfairly good - it took me at least 12 months writing WPF code to figure out most of what is in here, which others can catch up on from a single reading. I eagerly await the follow-up to the Sells/Griffiths book (due out soon) and Chris Anderson's new WPF book.
Joseph Cooney on April 25, 2007 08:41 PMInteresting that someone cited the Amazon comments on C++ How to Program. I wrote a review there, and I *hated* the color in that book. Not because it was in color, but because the little tips, warnings, hints, etc. broke up the text to the point it wasn't readable.
On the other hand, I have a copy of WPF Unleashed and I think it's a fantastic book. Lots of clear examples, and an arrangement that, for the most part, makes it easy to skip around and read the parts you want to focus on.
Is anyone else disturbed, though, by the fact that a full-color book sells for the same price as a typical black-and-white computer book? I knew these computer books were surely way overpriced, but now we have clear confirmation. Anybody happen to know just how much color printing adds to the cost of a book?
Kyralessa on April 25, 2007 09:37 PMIt's funny that you only link to Petzold's wikipedia page because Nathan ("some guy you've probably never heard of") is on wikipedia too! Although not as well known as Petzold, we already knew him from his .NET and COM book and the pinvoke.net website. I agree with you 1000% on the WPF books. I wasn't surprised though. To the commenter Will: I think it's weird to make generalizations about books based on the publisher (like Sams). I think 90% of a book's worth comes down to the author.
Bob on April 25, 2007 11:03 PMHow about Wrox? I have the impression that Wrox isn't so bad. Have learned with some of their books and there are plenty of diagrams (but no color)
Spiff on April 26, 2007 04:17 AMMaybe all us blog readers and writers just have short attention spans and have forgotten how to read a real book.
Reed on April 26, 2007 05:34 AM"I think 90% of a book's worth comes down to the author."
I would agree. However publishers make huge difference you can see that by grabbing books from the same author but different publishers. Look at most of the comments here on the Petzold book, almost all say that the information is excelling but the layout and presentation needs work. So in a choice between two books, that I have no reviews on, I am going to grab the publisher that has a good history of producing excellent books, because even if that author is poor the editor is going to increase whatever value I will get from the book.
I have both books and Petzold's book actually made me loose interest in WPF. It's just depressing to read that thing. Nathan's book is great.
indeed356 on April 27, 2007 06:25 AMTook me a few days to get back to this, but I wanted to share this link from A List Apart, on the topic of contrast, which seems to be right on the spot with the examples Jeff brings up here.
https://alistapart.com/articles/contrastandmeaning
/cheer,
F.O.R.
Since this blog doesn't allow html in comments, I will point you to https://radar.oreilly.com/archives/2007/04/books_like_blog.html, Nat Torkington's reflections on this blog post.
I also thought I'd post in the comments on that post the sales graphs from bookscan, showing how the Nathan book is pulling away from Petzold in sales to boot.
Tim O'Reilly on April 27, 2007 02:36 PMJeff, I'd happily provide you a pre-release soft copy of our 2ed WPF book if you'd like to add it to your list of comparisons. Just drop me a line and I'll send it to you: csells@sellsbrothers.com.
Chris Sells on April 27, 2007 03:37 PM"I also thought I'd post in the comments on that post the sales graphs from bookscan, showing how the Nathan book is pulling away from Petzold in sales to boot."
Tim, please do.
Michael R. Bernstein on April 27, 2007 03:48 PMInterestingly enough, Petzold responds on his blog: https://www.charlespetzold.com/blog/2007/04/270433.html
I think he's a bit off base with his response:
https://haacked.com/archive/2007/04/27/prose-is-dead.-long-live-prose.aspx
Petzold criticizes your review of Nathan's book here:
https://www.charlespetzold.com/blog/2007/04/270433.html
I have read both books and Nathan's is in another league both on presentation AND content. Even if he had it all in black and white, Nathan's book is far superior to Petzold's in every way. I would put this comment on Petzold's blog but he doesn't allow comments (very weak Charles).
Mike on April 27, 2007 07:29 PMWow. I recently bought the Petzold book and after the first few chapters decided that it was one of the best technical books that I have read in years. So many books read like a catalog of features with a few hints and tips thrown in to add value. I think so many authors add the sidebars, faqs, warnings, etc because they do not have the literary ability to integrate the information into the main text of the book.
Petzold's book reads like a story, it starts with the basics, but in no way treats the reader like an idiot, and it builds on the story with a gradual accumulation of knowledge.
I admit that reading the book takes a commitment and a level of trust in the author as it is long and obviously not every topic is of interest to every person. However, this is the first book I have read in a long time that I want to continue reading because it is enjoyable. So many books I force my way through the pages because I am trying to understand the topic.
I am glad that there are no pictures included because it has encouraged me to actually type in some of the programs to see the results for myself. It is amazing the increased understanding you can get from just typing in the code, over scanning the code mentally. I always find there are bits that I missed.
I think the depth of understanding that this book is able to convey to its reader is far beyond that of your average technical book. Scanning the book just really does not do the text justice. Seeing two pages of text on padding, margins and alignment of buttons, on the surface is not very sexy, but when you have spent hours in winforms trying to get controls to layout precisely, a clear and precise description of the WPF behaviour is a godsend.
So many books today are written by technology specialists who become technical writers. My opinion is that Petzold is an author who understands the technology. For me that distinction is important.
Personally I think the book is an excellent resource, but you have to make an effort to get the reward from it. This is not a teach yourself WPF in 24 hours type of book.
Darrel Miller on April 27, 2007 08:08 PMI am currently reading through Petzold's book; reading means going through it page by page, typing many of the examples or at least experiment with the downloaded ones, and make summaries and annotate paragraphs. It does take work.
I am sure I would be able to get going and make a nice UI quicker with a Powerpoint style book, and perhaps for a technology that's only one of many new complex ones that are going to be around for only a couple of years before they are replaced by newer versions, get going quickly may be the smartest thing to do.
I do a lot of maintenance work where I don't have time to understand the whole context, but need to fix something quick. That's sometimes fun to do (if it works and the fix didn't break anything else) but at other times it is nice to really master something. That's when you know something because it logically follows from facts you have learned and not just because you know where to find it in Intellisense/MSDN/CodeProject. Learning the facts (such as class names and attributes) and, more importantly, the logic behind a framework (class hierarchies, patterns, and concepts like databinding) takes time and I firmly believe I will learn that through Petzold's book, and I don't think a fancier presentation will help anything - although not having a class hierarchy in the cover is a missed opportunity in Applications=Code+Markup.
BTW: I have my doubts about screenshots, why do you need them? You have examples that show the behaviour and you can change parameters, try that with a picture on a page.
I don't have an immediate need in my work to use WPF but when I do, I suspect I will buy another book for quick reference, because of the 'scannability'. Your review points out an excellent candidate in Adam Nathan's book, and it would be nice if you could take a look at Chris Sells' book too. I liked his Windows Forms book.
So in short, I think it is a personal choice which book to read and that it will come down to personal learning style, why you want to learn the technology, and how much time and effort you can afford. Petzold did not write a bad text because it takes work to get through.
One more point on scannability. Did you notice the link refers to Web Pages ? Some of it may apply to certain kinds of books, but I highly doubt a more scannable presentation of Hamlet would increase my understanding of Shakespeare. That is an extreme example, but imagine CompSci or Engineering students going through nothing but pre-digested texts to pass exams. I'd hate to work with the Software Engineer who is not able to go through a book like Petzold's.
Erik on April 28, 2007 12:22 PM> I don't really understand why anyone would even want to buy a programming book. No way to run the example code (without finding it online or on some attached CD/DVD), no way to copy and paste, no way to click a link to a different topic, the trusty web browser with Google bookmarked to look up terms or expressions you don't know is far away. It's like living in the dark ages again.
You ADD might be acting up, bra!
Eh, point me at a treatise of WPF anywhere on the Web that does justice to the topic like any book and I'm sold...
Good luck.
The Web is awesome for finding information you might need WHILE your working on something. But it's usually horrible if you need to find out about and understand a technology. There's lots of snippet content and even if all the information you can find in an average book is published on the Web SOMEWHERE you'd have a hell of a time piecing it all together.
For heads down learning, short of an interactive course or a video walk through, I don't think nothing beats a book!
Thanks for that comparison. It saved me the cost of Petzold (WPF).
Ron on April 28, 2007 03:03 PMThe main insight for me that has come out of this discussion is that Petzold really has great content and works very hard at the writing BUT he seems to have such difficulty working with other people.
He is great at solo content and has probably scared away or refused to work with the book designers people and graphics layout folk.
To be balanced here his blog is very good and he keeps it up-to-date.
I've read both books cover to cover and without a doubt prefer and keep Adam's to hand. It's uncharacteristically belittling of Charles to refer to Adam's writing style as "PowerPoint writing". My personal taking on this is that Adam's book makes better matches the medium through its use of colour, and more importantly is a better suited to the environment that developers are writing code in these days. Not everyone has the time to read Charles book - and even if they did that time might be better spent with a book like Adam's and actually writing little bits of sample code to try things out in-anger. Charles's book is a good book to have to hand - but I'd rank it 3rd after Adam's and Sell's book.
Tom Kirby-Green on April 28, 2007 10:03 PMJeff,
Very interesting post.
I weighed in from a different angle over here: https://pluralsight.com/blogs/dbox/archive/2007/04/29/47087.aspx
You should pick up the Chris Anderson and the Sells/Griffiths books - I'd be curious how you rank the four of them.
DB
Tom, I agree. I thought Scott had a good post as well, along those same lines:
Jeff Atwood on April 29, 2007 08:44 PMHeh. The last paragraph in Scott's post reads:
"If the visual aspect of communication wasn?t all that important Mr. Petzold, why didn?t you write a ?building applications for the windows command line? book? ;)"
Incidentally, I'm reading just such a book ("Programming Windows PowerShell" by Bruce Payette, an excellent book btw) and its layout resembles Nathan's book far more than Petzold's...
The man himself has written another blog post about this subject:
https://www.charlespetzold.com/blog/2007/04/290143.html
Unfortunately it appears he still just doesn't get the fundamental point that his books have terrible editing and layout. The exact same Petzold content packaged with some visual structure would make for a much better book.
Chris Nahr on April 30, 2007 12:15 AMI received both during a WPF Bootcamp up at the campus and I'm about 3/4 through the Code portion. I really do appreciate the breakdown and early abundance of code as I think you miss the root connection when working purely in XAML early in your introduction to WPF. I have not yet made it to Adam's book and I'm sure I'll love it, but I agree with Charles in that it is very easy to get lost in the sea of XAML if you don't have a strong foundation in the WPF class library.
Ryan Cromwell on April 30, 2007 04:34 AMDoh, I got my Petzold and Payette titles mixed up. The actual title of Payette's book is "Windows PowerShell in Action", not "Programming Windows PowerShell". Sorry, Bruce!
Chris Nahr on April 30, 2007 05:18 AMAlso Petzold posted another response.
https://charlespetzold.com/blog/2007/04/290143.html
Read Nathan's response to that response here. It's pretty funny.
https://blogs.msdn.com/adam_nathan/archive/2007/04/30/petzold-vs-nathan.aspx
Jeff Atwood on April 30, 2007 09:52 AMAfter reading both excerpts, I think I would buy Charles' book. I have only been programming for about 5 years and I like books that explain underlying concepts as well as the new syntax and features. I feel that too often programers these days find themselves knowing lot of languages and not any concepts behind them. The in depth explanation of the application object by Charles is exacting what I like to see. Giving me code that I can get running easily won't give me a deep understanding of these things. I think some people who have been in the field for awhile forget that there are a lot of us out there trying to work backwards from all of the abstrations that Microsoft provides for us. It's easier for someone with more experience because they've already seen how this stuff was done before the built in abstraction.
Mark Fruhling on April 30, 2007 10:36 AMSo now Nathan has decided that Jeff's point was to... "not judge a book by its cover!" WTF?
With Eric Sink weighing in as well, and with another unrelated tangent, it's becoming pretty clear that absolutely _nobody_ wants to talk about Jeff's real point... which was layout. Oh well.
Chris Nahr on May 1, 2007 12:12 AMBoth books are great reads!
PS: dont you think the layout for Nathan's book was toooo colorful? flashy? isnt content the king?
That's as good question. I haven't read that book but the excerpt does seem to have a lot of visual "noise". The syntax coloring may be a bit excessive.
Speaking of which, Petzold announces that his new book will have pictures but still no color, and asks to wait until it's published before we rip it to shreds:
https://www.charlespetzold.com/blog/2007/05/021206.html
I've got Charles Petzold's book and don't see what all the fuss is about. I'm sure both books convey a lot of information. Charles's book seems to be complete, you probably wouldn't need to run out and buy another book to successfully use WPF.
There is lots of information, examples with explanations. Filling the book with pictures would probably double it's thickness (and it's thick already! 1001 pages!)
I like it.
After readng this post I'm going to run out & buy Petzold's book. I appreciate an author who puts an emphasis on content rather than format. If I want full color ADD treatment I'll surf the web.
William on May 9, 2007 03:28 PMCharles Petzold's book may lack a little color and design - but he's a skilled software developer and a very thoughtful author. Every code example comes with a matching source and .sln file (there are over 150 short and helpful code projects). Charles also thought carefully about the division of the book into two halves - code and then markup - and I find it helps enormously to focus on code first - which in turn gave me a deeper understanding of what was going on in the XAML markup that followed. On Charles' own site he says openly that he wishes the design had included more screen shots - but his book is already a 976 page tour de force and frankly I'm glad it was kept as lean and clean as it is. That said when ever I've really wanted to get a solid understanding of any topic I've usually read more than just one book - and so seeing two great books out there in two different styles can only be a good thing.
Anthony Bouch on May 9, 2007 05:29 PMIt has been years since I bought a programming book. Way back in the day I bought a number of books which was big waste of money since I found just about everything I needed on the Internet. The Internet is the best source for programming information, and it is extremely easy to locate examples and solutions to the common bug, control, ect.
Why drop around $50 for a book when you can just type your keywords in google and ask technical questions on blogs, forums, ect?
Tim Erwin on May 14, 2007 12:02 PMWow-- you state the Nathan book is brilliant because "It reads like a blog and competes toe-to-toe with anything you'd find on the web." Are you serious?
If you crave disjointed journal entries and episodic ?posts? with no linear structure, why would you pick up a book in the first place?
Wait, did you pick up a book? You seem to have copied and pasted content from both books into your post. You were reading these through some online service like safari Books, weren?t you?
If you were to attend a (non-presidential) debate, would you leave if there were no Ted Koppel-esque commentator there to tell you what to make of it?
Personally, if someone said to me "Dude, thanks for writing such a brilliant book -- it reads like a blog", I would consider such a comment an insult.
Books are the medium where exposition and substance are most appropriate form of rhetoric. Bullets, color, diagrams and other fancy-pants eye candy elements are the stuff that pamphlets, propaganda and power-point presentations are made of.
The Petzold book privileges style over substance, because -- well it is a book.
Please, give me well thought out sentences and narrative structure over bullets and fanciful graphics any day. Up with vegetables, down with pabulum; up with novels/literature down with comic books; up with erotica down with porn; up with the New York Times, down with USA Today; up with literacy down with aliteracy.
Christ Duhan on May 15, 2007 02:59 PMI just started a contract where i need to learn some WPF, i went out and bought the Petzold book. 2 of the guys that I work with told me that they both bought the book, both of them returned it. I think I have the copy.
Guess what, I'm going to return it too.
jack on May 30, 2007 04:56 AMA fillion dillion years ago a friend and I decided to build our own computer using those new-fangled 16-bit processors, so we contacted Intel, Zilog, Motorola, and AMD for information on their CPUs. We received boxes of books gratis, all design books that detailed pin configuration, voltages, tolerances, etc. I tended to skim them paying close attention to the diagrams, while my friend read them cover-to-cover repeatedly. He frequently teased me about need pictures and someone to explain them.
As the years went by, I became a pilot and he specialized in software development. My friend became known for being able to see a disassembly--without symbols--and know which library routine was giving problems, because he had read the disassembly so many times previously that he just remembered it.
Perhaps this explains the underlying issue between the Nathan and Petzold books: different people see things and explore things in different ways. Some prefer an overview from 35,000 feet while others need to dig deeply into the details. An interesting question is whether this reflects a new way of gathering information (web/net/2.0/this generation/darn kids these days/etc) or simply that different people have always learned differently, but that modern technology allows for more variety in media.
Jay on June 6, 2007 09:40 AMTalking about Petzold ignoring graphics and layout professionals is highly ironic given the combination of strong blue and red in Nathan's coloured code.
I am a tactile and visual person in that order, usually explaining things with scribbles and a major fan of colour to enhance code readability. However, if the samples above are an accurate indication of the book's code I am very disappointed. How did something with such glaring and painful colour contrast get through the editing cycle?
Andy Dent on June 27, 2007 12:48 AMI think the content is the key point.
Josen on June 29, 2007 12:56 AMAll these are misunderstandings, i think,
Although Nathan's book is pleasing to the eye petzold's book is the real winner in the long run. His aprroach of C# code first and then the XAML was a disappointment to me at first, however, being an initiative from the most reputed author of all time i decided to follow Petzold's approach by reading line by line from his book and after the c# part it was amazingly a simple journey to cover the XAML part. I could not have reached so far if i decided to learn the XAML first. The second criticism about his book is "no screenshots" but his samples are very easy to picturize in memory and it prompts me to verify the mental image by actually coding it in the computer. Usually if i saw picture in the book i will get too lazy to try the code on computer and i really prefer codes without screenshots after reading this book.
In short Nathan's book is like a Brochure from the church and Petzold's the Bible. I need that bible everytime in my hand.
Suhair Hassan E on July 9, 2007 12:21 PMI really like the flow of Chris Sell's book on WPF. He does a phenomenal job in ordering the various concepts. You very rearly have to flip back and forth. . No weird details just for the sake of the detail. He explaines concepts. A great book.
Chris on July 12, 2007 10:19 AMI usually agree with you, but not so today. That awfully coloured book is an immediate turn-off. I hate bullet points and little sidebars and also aggressively dislike XML. What's more, I completely agree with the opinion that Visual Studio _does_ rot the brains of programmers. Maybe this blog isn't so hot after all?
Joao on August 24, 2007 12:58 AMUnfortunately, people are missing the bigger picture. These books are marketed toward different groups of people ? some of it intentional by the publisher and some of it due to the authors natural style.
This is why you get very different viewpoints on this subject. In fact, both books are relevant to the core audience they market toward. I have trained a number of people in WPF, and Adam?s book is best for Graphic Designers, Technical Designers, Visual Developers, Web Developer, and ?New Age? hard core developers.
Petzold?s book is for hard ?Old Age? hard core developers and ?New Age? hard core developers. Where, ?New Age? folks should read Adam first, and ?Old Age? folks should read Petzold first.
I will add that ?New Age? does not mean younger in years lived, but in the acceptance of new acceptance of new technology. For example, ?Old Age? folks don?t like XML very much, and they don?t like XAML very much. They want control and knowledge of every bit.
Jeff?s point is taken from a ?New Age? perspective. There is no need for any argument as to which book is better or worse because each has a style relevant to it?s reader base.
As the technical editor of WPF Unleashed, I am biased toward that book, but in my training of others in WPF, Petzold's book becomes a requirement for certain types of individuals.
TheRHogue
TheRHogue on September 30, 2007 11:27 AMhi
I'm alen and i'm studding IT,recently i have taken a project base on the WPf and i need someone who can tell me how i can do this project .
i need only someone to tell me what should i do and what languages should i use through this project . here is the project about :
The Windows Presentation Foundation (WPF) is a subset of the .Net Framework 3.0. Students are expected to create a Xmal Browser Application (XBap) Digital Media Library which can store and search for digital media , organise and playback digital media (graphics, audio, video, and 3D objects). Students are expected to make full use of the WPF to create an application which demonstrates a richer user experience as compared to current Internet based applications.
anyone can help me plz send me email at
alireza456@yahoo.com or alen_n2000@yahoo.com
i'll appreciate those who can help me
regards
alen on November 15, 2007 06:32 AMI'd have to agree with the comments about Petzold's books. My general opinion of his books is that they explain trivial concepts with great detail, but don't present concepts in a general enough manner to be applicable to most problems. It's as if they are a 'handbook' of different solutions, not a book for learning how to solve problems yourself.
In particular, I bought the WPF book for several reasons - it was one of the first on shelves, it was Petzold!, it was MS press (which I'm often happy with - though Addison Wesley is my favorite tech publisher), etc. Unfortunately, it didn't even live up to my expectations based on the other Petzold books I own.
I also own the WPF books from Sells/Griffiths (O'Reilly) and MacDonald (Apress). My favorite of the three is by far the MacDonald book, but the Sells book is also excellent. I'm not even sure where the Petzold book is right now, probably laying on my floor somewhere :). It's worth more than that, but only slightly.
Kelly Leahy on February 12, 2008 09:55 PMPetzold is a true horror. His early books on windows programming wrecked a generation of programmers. Avoid him and his filthy coding style at all costs.
David on February 24, 2008 09:40 AMGood article and blog. Thank you and good luck:)
Larry on May 7, 2008 04:52 PMI started learning WPF with Petzold's book, but I left it right away for the exact same reasons Jeff mentioned.
After about a month a friend recommended Nathan's book, and it blew my mind.
Nathan's book held my hand and walked with me step-by-step from learning basic concepts through more advanced topics.
In 99% of the times I had questions or asked myself stuff like "but what if", I found answers in Nathan's tips, warnings or "digging dipper" portions of his books.
I extremely recommend WPF Unleashed!
I learned ajax by reading Head Rush Ajax, which has almost no text, just lots of pictures with funny captions. Think pop-up video in book form.
I paid $50, and it took me an hour to read, and in the end I knew Ajax. It was candy for the brain.
In contrast, I bought the highly recommended Pragmatic Guide to Ruby for about the same price. It's twice the size and densely filled with text. Over the past year I keep sitting down to read it and then getting bored after 10 minutes. I've never got past the first three chapters.
Steve Hanov on March 20, 2009 10:15 AMHi guys. Liberals are very broadminded: they are always willing to give careful consideration to both sides of the same side.
I am from Namibia and learning to speak English, please tell me right I wrote the following sentence: "Com has cheap domestic and international airfare including hotels."
Thanks :-(. Ivo.
Ivo on March 21, 2009 07:44 AMGood Day. You must not think me necessarily foolish because I am facetious, nor will I consider you necessarily wise because you are grave.
I am from East and now study English, give true I wrote the following sentence: "Compare travel sites save search made simple."
Thank you very much 8-). Harith.
Harith on March 21, 2009 10:47 AMSorry. It's all right to have butterflies in your stomach. Just get them to fly in formation. Help me! Looking for sites on: For the cheapest air travel, check our website.. I found only this - [url="https://cheapest-tickets.us/";]Airline Tickets[/url]. Find last minute cheap fare, airline ticket and discount flight ticket for major cities of. Transportation - airline ticket domestic. Thanks :eek:. Madeline from Laos.
Madeline on March 22, 2009 09:05 AMMadeleine: how insightful
Sean on March 22, 2009 10:01 AMContent (c) 2009 Jeff Atwood. Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved. |