How to learn WPF (or anything else)

I’ve recently been learning WPF. This is a huge topic that is uncontainable by any single book, tutorial, or web-site. The complexity and breadth of this framework is nearly oppressive, but the results are incredible. Or rather, I should say, potentially incredible.

Like this? Please check out my latest book, Writing High-Performance .NET Code.

From everything I’ve read, people who have suffered through the WPF learning curve have this to say, more or less:

yeah, it was really tough going for a few months. But now I can create awesome apps in a fraction of the time it would take with older technologies.

So with that in mind, I really do want to learn WPF. I have a number of C# references, weighty tomes that bend my shelves, but the main book I use is Programming WPFby Chris Sells and Ian Griffiths. I really like this book—it goes in deep. However, I realized that reading through it cover to cover and doing all the sample apps wasn’t going to work—it gets boring, no matter how good the book is. So here is my recommendation on how to learn WPF (and it probably applies to any programming technology):

  1. Start reading the book, do the code, type stuff in, copy it, tweak it. Do this for as long as you can.
  2. Once step 1 becomes boring, STOP. It is not productive to force yourself through the whole thing like this.
  3. Find a sample project in your target technology. I used Family.Show. There are plenty out there.
  4. Think of a project YOU find interesting that would be good in [WPF|other]. Start doing this. Even if you don’t know where to start at all.
  5. While getting started, every step will be a challenge. Figure it out step-by-step, going back to the book and online resources.

You might be tempted to skip steps 1-2. I think this is a bad idea. You need at least some foundational understanding. Only when you can’t take it any more and you’re in danger of quitting, move on.

This has worked well for me in learning WPF. I decided to implement a game (if it ever gets into a polished state, I’ll share it).

Don’t underestimate the challenges in step 4, though. I had to think about how to even start, going back to the book numerous times, reading large sections. I looked up articles online about patterns and WPF, user controls, and more. Many seemingly-small steps in just displaying windows took hours to figure out. Figuring out data binding (really figuring it out in the context of my app) took hours. The point of doing your own project isn’t because it’s easier than following the book—it’s because it’s fun and you have more motivation to learn.

11 thoughts on “How to learn WPF (or anything else)

  1. Michael Gray

    This article makes a lot of sense to me. This is pretty much the route my studies have taken. The main point being… it’s great to here someone else say thats its ok to get bored with a book, however good it is.

    What slightly frustrated me was rereading things you already new about. Just to try to find that next step.

  2. Sumit

    Even i am in a phase o learn WPF. I am also thinking of approach to create a sample application that will cover most of the topics in WPF. Can you post some ideas about sample projects?

  3. jack

    So why made WPF such a freak to learning? It’s just a GUI design, one book cann’t cover that, it must be some thing wrong.

    Now days,most of books are just commercial book. They do not teach people understand the principal, insdead, they put lot of descriptions on it make the book thicker for higher price, it just waste time and energy to read them.

    back to delphi, it only took me 1 hour I can start to programing the GUI applications without any learning curve. So did the VB.

    It must be something wrong!

  4. Ben Post author

    Jack, I don’t even know where to begin a response to your comment. Your arguments basically boil down to:

    1) if something is difficult, it’s not worth learning.

    2) If something is not as easy as Delphi or VB, it must not be as good.

    Wow.

  5. Bhaskar

    Thanks for the good practical suggestion Ben. It really sounds practical and I’ll definitely try it out.
    And Jack don’t be such a SNOB !!

  6. Paul Shrimpton

    I`ve been working on fractal landscapes & planets in
    Dark Basic but have recently moved to c sharp 2008,
    I found an app online using WPF which does the same thing & I am dismembering it to study WPF.
    The book I bought uses banking as an example and it`s boring, your way is much better.

  7. suriya

    Hi Ben,
    Good practical approach of learning. It applies to any technology be it GUI or plain coding language. i am going through your book C#.40 How To. It has something different than regular books. Keep up the good work and nice site :).
    Suriya

  8. JJ

    Great Post. Thanks.
    I agree with your technique but would like to add one thing that works for me.
    When learning something new (like WPF) that I want to learn but doesn’t use at work, I also ask people who are currently using the technology to tell me about their current project. That will help me focus my learning on what is currently being valued by the marketplace so if I need to start using say WPF, I would have the required skills.

  9. Faruh

    Hello everyone!
    I’ve started learning C# language. In future I wanna to move to the WPF technology. Most of the books written in english but my english is bad. I have just found 2 books in russian but I think it’s not enough, so could somebody advice what to do.

Comments are closed.