quarta-feira, 11 de novembro de 2009

Guidelines!?!

This month at the working place we could manage to promote some Design Pattern training. The really basic about the patterns, a quick and dirty overview of Gof's patterns.
I am not here to discuss the importance of the training, how basic it could be, if people should go to learn it by them self or whatever. I am here to discuss the results of the training.

We have managed to make 2 days in 2 followed weeks, and with 2 different groups. Most of the people thought that it was interesting and valid, and at the end of the sessions we come up with the discussion if we should continue with that or not, and of course what could be the next steps. A reasonable amount of ideas come up from, nice ones, other I think not that nice, but still ideas for next steps.

During the last session one of your colleagues talked with the Big Boss, about the ideas, with the purpose to give a feedback and collect the sponsoring need for the next sessions; but guesses what: an answer more less like this – "I believe that we can come up with some guidelines, publish it on the wiki page and people go there read and learn". Simple as that, why have we never thought about that? Unbelievable how stupid we are!

Or may be not? I fact I believe that not! Guidelines as the name (which in English is straightforward) are for guiding, are not for learning, usually in a guideline you have small sentences that gives hints for the people. Let's take an example: imagine a guideline like this "Prefer Abstract Factories over the Factory method and make them always return interfaces", what could happens if the reader does not know what is a Abstract Factory of a Factory Method or even an interface? From two one: or he will ignore it completely or it will take this guide line as a God message and follow is an immutable rule, something that if not done will make him end up in Hell!

None of these situations are beneficial; by far they are really bad. Guidelines are guidelines, rules are rules and knowledge is knowledge, both should exist but one cannot be exchanged by the other. Another point about guidelines, I don't believe in guidelines coming from a group of people (which in most of the places are a split department creating them as God writing the 10 Commandments) and releasing it. It should come from a common sense, and I am not only talking about programming, here you can include, analysis, requirements and so on.

I have already worked and participated of a projected that we have created immutable guidelines (or rules if you prefer a proper name) and it end up with a complex unnecessary structure – believe me a waste of time creating Action->that calls->Façade->that call->Business Objects->that calls->Dao->that converts to->VHO->is stored in the database, most of the time to be used for a internal web application that could have being solved with some Action->Dao thing.

So Guidelines are useless? Sure not, they are really useful for someone that can interpret them; otherwise people will lost faith on the guidelines and in the process and they will start to believe that it is a bunch of stupid rules for nothing. And at the end you will end up with zumbi-developers and a bizarre-code.