Monday, July 7, 2008

Design Patterns - what's the deal

As a tech lead in at Stefanini, one of my duties is to interview applicants and evaluate their technical knowledge. It's a very hard thing to do, once you realize that it's people’s lives, perspectives and needs that I'm dealing with when they come to us.

So after reading and testing skill after skill, applicant after applicant, here is one of the most common gaps: Design Patterns.

"If a colleague were to say to you, "Spouse of me this night today manufactures the unusual meal in a home. You will join?" three things would likely cross your mind: third, that you had been invited to dinner; second, that English was not your colleague's first language; and first, a good deal of puzzlement.

If you have ever studied a second language yourself and then tried to use it outside the classroom, you know that there are three things you must master: how the language is structured (grammar), how to name things you want to talk about (vocabulary), and the customary and effective ways to say everyday things (usage). Too often only the first two are covered in the classroom, and you find native speakers constantly suppressing their laughter as you try to make yourself understood.

It is much the same with a programming language. You need to understand the core language: is it algorithmic, functional, object-oriented? You need to know the vocabulary: what data structures, operations, and facilities are provided by the standard libraries? And you need to be familiar with the customary and effective ways to structure your code. Books about programming languages often cover only the first two, or discuss usage only spottily. Maybe that's because the first two are in some ways easier to write about. Grammar and vocabulary are properties of the language alone, but usage is characteristic of a community that uses it."

This extract from Effective Java's foreword, written by Guy Steele is the best way I've ever seen the need for programming patterns explained, so I decided to borough his words for this post. Surely you can express yourself and make the computer understand what you’re saying, but wouldn’t there be a better way to do so? Of course you can.

I decided to make a series of posts on the subject of design patterns. Since I don’t have any teaching training, I’ll be using one of the best books on this subject, the Design Pattern bible: Design Patterns, Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides.

The first subject will be one of the simplest design patterns: the abstract factory.



No comments: