Are patterns meta-algorithms?
I quit programming as a hobby in about 1996. That was when finally I noticed repetitions in my programming work — situations you ran into before, but for sure not ever since you learned this particular language. Today, you most likely would call them patterns. Patterns are quite popular today, but those days I was not aware of neither the term nor the science behind. It just got me frustrated.
However, I just reordered the categories of my blog and noticed the long list of sub-categories to “core social framework functionality”: buddy/contact list, contact list management, social graph, user management, user account management, emergency login, lost-password recovery, user profile, basic user model, handle for a user, e-mail address, username. By looking at that list, Jonathan Weiss’ presentation on patterns in Rails came back to my memory.
Yesterday, I had another look into my Java patterns book. The O’Reilly people here put emphasis on the task to memorize the different patterns. That’s a bit in contradiction to developing algorithms. (Anyway, I wondered what might be the difference between a pattern and a simple algorithm.) When you develop an algorithm you look at the problem, then determine which steps to take, how to granularize the task — until you get to the point that you can express your demands immediately by the commands a programming language provides you with.
If you need to sort things and your language does not provide you with a sort routine you usually are aware that there are several alternatives you could apply — quick sort, bubble sort, or others. Is that a pattern yet? That you are aware of alternatives and the chance to select one. — At least, similarly to knowing about alternative algorithms to apply, in you might need to be aware of available patterns and select the one best suited for the case.
Patterns apparently get developed once and from that onwardly nothing but propagated/memorized. The task for the developer reduces to recognize whether or not the situation demands applying a pattern. Because of that background, I wonder whether it’d be correct to say patterns were meta-algorithms?