domingo, 19 de junho de 2011

Dr. Strangesoftware

Stanley Kubrick, no filme Dr. Strangelove, constrói uma situação em que os homens ingloriamente lutam contra os procedimentos que criaram. Estes procedimentos, uma vez activados, iniciam uma processo que se revela impossível de parar, levando à destruição da vida no planeta terra. Esta história, é uma versão soft do tema que foi recorrente na ficção científica sobre a tentativa da máquina controlar o seu criador, o homem. Nestas histórias ilustra-se a luta entre a lógica e o humano.

Numa história real, Barbara Tuchman descreve num livro sobre o primeiro mês da Grande Guerra, The Guns of August, como o Kaiser, poucas horas depois de ter ordenado o início das operações contra a França, resolve, após receber um telegrama do seu embaixador em Londres, alterar a sua decisão e invadir a Rússia. A invasão da França tinha sido logicamente preparada para ocorrer em 6 semanas, o que implicava um minucioso plano de deslocação de cerca de 1.000.000 de homens, usando os caminhos de ferro. Quando o Kaiser comunica a sua decisão ao seu chefe do estado maior, a resposta que recebe foi, escreve Tuchman: 

"Your Majesty, it cannot be done. The deployment of millions cannot be improvised. If Your Majesty insists on leading the whole army to the East it will not be an army ready for battle but a disorganized mob...". 

O Kaiser não teve poder para parar a máquina que tinha colocado em marcha.

Também no software há este paradoxo entre a coisa criada e o criador, entre a lógica e o humano.

Num artigo recente na ACM Software Engineering Notes, Robert Schaefer descreve magistralmente este paradoxo:

"I’ve also been thinking a lot lately about the kinship that software developers and managers have in regards to the parable of the blind men and the elephant. Software, as an object stripped away from culture, can be reduced to mathematics, a culturally valueless set of rules of manipulation of symbols. Software also is the formalization of ideas into logic. Coding is nothing more than thinking clearly and logically in the process of symbol manipulation. If so, then what is the big deal? Why can’t just anyone write programs and logic be damned? Logic has one set of rules and culture another. Logic must, but cannot be, separated from cultural values (another paradox). The attempt to map cultural values onto logic, while denying that we are doing it as we do it, is where trouble begins. Now the blind men weren’t able to see the elephant all at once, they could only guess at parts through touch, and emphasize the attributes, assume the whole of a part. We though, as designers and programmers can see the whole elephant, but are not much better off. Which more or less ruins the elephant analogy. Unless the elephant we see is not the elephant that is. Then the elephant analogy works again. We model the elephant in our minds, but the elephant that is, is something different. It looks like an elephant, but behaves like something else. In this instance, it looks like logic but behaves like culture."

Há, no entanto, uma diferença fundamental relativamente às máquinas e procedimentos que têm por base uma visão científica enraizada em princípios desenvolvidos ainda no século XIX: no software a coisa criada não é externa ao criador, não existe para além dele.

Dessa propriedade do objecto de software, que é a sua apropriação pelas pessoas, para além da lógica, falo em alguns dos posts. Por exemplo Da desordem à ordem natural das coisas é sobre a necessidade de tornar a codificação da cultura mais integrada com a codificação da lógica.

Sem comentários: