All of us at some point in our career study a pattern or two. However, reading about a pattern on Internet or in a book without applying it, cannot make this pattern stick in our heads. In the best case we remember the name of the pattern. Lately I see a lot of encouragements from the blogging community to study and use patterns & principles.
Rob Conery wrote a beautiful post: Patterns, Purists, and Sinkholes. He makes a nice analogy between Construction and Software industries.
Going back to my question: What’s the best way to learn patterns & principles? I wish that I could acquire knowledge about patterns just like Neo learned his skills? Unfortunately nobody is going to put patterns and principles in our heads; we need to make an effort to study, learn, and apply P&P.
My company, Ultimate Software, purchased Agile Principles, Patterns, and Practices in C# book for every developer. Unfortunately, by having a book on the shelf doesn’t mean that you know what’s inside that book.
Let me try to answer to my question:
- When you learn a pattern, try to apply it. Think what code can you refactor to use newly learned pattern.
- Also do code reviews. In code reviews you can either educate your peers about patterns or learn from them.
- Get involved with an open source project. Open source community is very good at applying patterns. When you work on code that implement a pattern, you forced to learn this pattern.
I’d love to hear from you to learn how you get familiar with new patterns or teach other.