Thursday, March 19, 2009

Elevator Bug


This is a common scene in the Condominio São Luiz elevators: every now and then appears a blue screen, or a Windows message telling people in the elevator to contact Microsoft. This morning it happened again. There was some kind of trouble with Adobe Flash Player plugin. "Inform this problem to Microsoft"

2 weeks ago I met another message box in the elevator. "The system has been recovered from a serious error". If the system had a seriour error and has been recovered, why this message? What if the elevator stops between floor 9 and 10 and you get a message box: "Your elevator is in serious problem, please contact Microsoft for recovery". I'm terrified. Does anybody has Bill Gates phone number, please?
Would a elevator running Linux or Mac fail the same way? Maybe yes, maybe not. But please, don't ask me to call Microsoft! I'm stuck in the elevator! Call the fireman!!!

Wednesday, March 11, 2009

Refactoring Paintings

Refactoring is a well known technique in software development. In short terms, refactoring is to execute a sequence of small well defined steps with the intention to let your code base more clear, more beautiful, more elegant. The result of a continuous refactoring practice is a simpler and easier to maintain software project. There many times also when refactoring takes the programmer to create new abstractions and code generalizations.

Let's go to a simple example: suppose we are programming a Person entity class. This class contains attributes like name, weight, age, gender, spoken language. After some time, I find out that I need to insert cats in my system for some reason. Then, I create the Cat class with its attributes name, weight, gender and hair color. After that understand I've created an ambiguity. Both and Cat and Person classes have some attributes in common. By doing a refactoring, I can then create the Animal class, with the common attributes (name, weight, gender) and make the Cat and Person classes "inherit" the animal properties.

The idea of extracting abstractions is to identify the essence of a system and describe its most deeply characteristics with simple elements. To achieve this essence you need a lot of experience and sweat. You need mastery you programming skills and use the tools and programming languages in the most proper way. It is an Art.

Play the video bellow to see how refactoring was made by Pablo Picasso in his paintings:



First, the painter draw a ordinary bull, which can be recognized by a 5 year old child. Irrelevants parts are being remove at each new stage of the draw (there are 11 pictures), besides the main idea of the bull remains. The whole genious desconstruction proccess takes six weeks. Even with few drawn lines, the last painting can still clearly represent the bull. They are the animal's essence.

Every capable programmer, software creator, needs to know how to recognize essential aspects of the domain he is programming for. The technic helps to execute it, but geniality is rooted in intuitive thinking and the artistic capacity of identifying and extracting the essence.

(Portuguese version)

Tuesday, March 10, 2009

Fearless

Turn resistance to the new idea to your advantage. Every innovation, in true, breaks something. So, every resistance is welcome. We need the resistance to test our new ideas and convictions. Skeptics are a gift! They give us information about our progress and teach us how we can adapt our approach.

Maybe, the most important point in changing is how we deal with fear. Every change process implies in fear on both sides: those who are being changed want to avoid the pain of (maybe) loose something; those who are promoting change have the fear that their idea are wrong or won't be accepted. When both these sides get in contact surges an impasse. Resistance is not the main force that takes a change to failure. Reaction to resistance is the problem.

You will hardly get 100% approval of a new idea. This is welcome. Every law that doesn't let opened the possibility of its execution, precisely because of its disobedience, is an arbitrary law. Second the Sanhedrin Treaty, is case of judgment of capital punishment - when it was necessary 23 judges -, if there was an unanimity in the sentence to the defendant, the judgment was disqualified and the defendant liberated. The sense of this kind of law is the distrust that a process can be conducted so well, that there is no doubt about it and can't exist any different interpretation about this situation. (Nilton Bonder - The Immoral Soul)

It is difficult to listen to people when we don't agree with some point of view. We usually get fixed on our point of view. Another approach would be encourage the other to talk more about his point. Just listening to him could help you both to understand each other.

Ask for the help of the resistants. Make sure they know you are listening to them. Truly listen and try to learn with them. Try to make them undestand that accepting the new idea does not mean throw away their own ideas. Don't assume that a skeptic posture lasts forever. Someone who initialy seems against can turn into your favor.

This pattern allows you to use the resistance to your own benefit, instead of using it against you. People who watch you dealing well with skeptics will respect and admire you for this.

(English translation of this post)