Learning WPF with BabySmash and Back to Basics - Making Assumptions and When to Turn to Books
NOTE: If you haven't read the first post in this series, I would encourage you do to that first, or check out the BabySmash category. Also check out http://windowsclient.net/ for more developer info on WPF.
BACKGROUND: This is one of a series of posts on learning WPF. I wrote an application for my 2 year old using WPF, but as I'm a Win32-minded programmer, my working app is full of Win32-isms. It's not a good example of a WPF application even though it uses the technology. I'm calling on community (that's you, Dear Reader) to blog about your solutions to different (horrible) selections of my code. You can get the code http://www.codeplex.com/babysmash. Post your solutions on your blog, in the comments, or in the Feedback and we'll all learn WPF together. Pick a single line, a section, or subsystem or the whole app!
I hung out with Chris Sells at the Mall Food Court today. He had trouble finding a parking spot and I felt bad. But I didn't REALLY start feeling bad until I started showing him the code for BabySmash.
He had a number of ideas for ways to make BabySmash better, but what was interesting was that he was using his own book as reference. He'd say, "oh, we did that in Chapter 4" and "ya, that does suck, check out this call out where I explain why." After this happened about four or five times he said (I think in jest, but you can never tell with famous dudes. ;) )
"Did you invite me here to read my book to you?"
After I picked my ego off the ground, unfolded it, dusted it off, and smoothed it out, I said, "I don't think so."
Chris had a really good point. It turned out that even though I have a three WPF books at my house, I haven't read them all deeply and thoughtfully. I hadn't even made it though the first few chapters. Mostly I skipped around, looking for answers to my specific questions.
Through my questioning, Chris noticed that I had some fundamental misunderstandings about some the basics of WPF. Things I thought worked one way, worked another or in reverse. Some concepts that were WPF 101 I had overlooked completely because I hadn't least made it through ~5 chapters and cemented the fundamentals.
I am not saying that we need to read every book all the way through, but I did learn a useful lesson. Don't assume you know how it works. Just a few hours of covering the fundamentals would have saved me a lot of time.
In the last post I said I was starting to grok WPF. Looks like less than I thought. I had left pretty significant gaps in my understanding by skipping around and assuming "oh, this works like that." Those gaps in my knowledge led to some interesting directions in BabySmash. I'll post about some of those things I learned from Chris soon, but suffice it to say, I completely misunderstood how events moved around a WPF application.
Thanks Chris for setting me straight! Sorry about the parking!
OK, page one, "Hello, WPF."