Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Wednesday, 6 June 2007

Sobre la Revisión por Pares

Van algunos comentarios en torno al artículo que mi amigo Pedro escribió sobre "peer reviews".

[versión 0.1]

En el mundo del software una revisión por pares no es solo una oportunidad para mejorar la calidad del producto (el "código fuente") a través de la detección temprana de defectos, como errores de programación, o desviaciones de la especificación, de la arquitectura, o de las buenas prácticas.

Es también una importante oportunidad de aprendizaje para los participantes, y en ello una opotrunidad de mejorar el entorno.

Una revisión por pares enfocada solo en encontrar anomalías, o "el qué", pierde la valiosa oportunidad valiosa de analizar también el "cómo" y el "por qué":

  • Falta de conocimiento.
  • Herramientas inadecuadas.
  • Tareas repetitivas y proclives a equivocaciones.
  • ...
Y de aplicar mejoras con efectos permanentes como:
  • Entrenamiento.
  • Obtención o creación de mejores herramientas.
  • Automatización.
  • ...
Por ejemplo, la automatización de las revisiones particularment porque provee a tanto revisores como a autores de más tiempo para ocuparse de lo verdaderamente importante.

Al final importan el entendimiento de los conceptos y de las buenas prácticas, y el buen criterio. Frente a una desviación de las normas o la arquitectura el autor debería ser capaz de argumentar sbore por qué su decisión fue adecuada y no un capricho o un error. A veces ocurre que la arquitectura tiene defectos u omisiones, o que una norma no es aplicable en todas las situaciones.

Durante una revisión por pares buscamos que el código sea "bueno".

Un código que no es de calidad puede pasar una primera inspección ser todavía vulnerable a la ocurrencia de cientos de defectos en una siguiente iteración.

Mucho se ha discutido sobre la "estética" en software porque, en general, la informática se considera una cosa objetiva, mucho más cercana a las matemáticas que a la música (algo bien discutible).

La verdad es que la calidad estética del software puede determinarse con criterios bastante objetivos. Criterios que tienen que ver fundamentalmente con cuan entendible por otros mortales es una pieza de código. Lo subjetivo está en que quien adquiere experiencia en escribir buenos programas adquiere también un sentido intuitivo (o "estético") .
  • Modularidad
  • Separación de responsabilidades
  • Alta cohesión
  • Bajo acoplamiento
  • Minimalidad
  • Comprensibilidad
  • ...
Hay toda una tradición en libros por autores famosos sobre estos temas: Software Tools, Programming Pearls, Code Complete, Design Patterns, Pragmatic Programmer, y Refactoring, entre otros.

Por ser tan importantes el aprendizaje, el entendimiento, y el criterio, los acercamientos ágiles al desarrollo de software incorporan varias prácticas particularmente relevantes a este tema:
  • Programación en pares que cambian, con lo cual la práctica de revisión por pares se lleva a cabo constantemente.
  • El código es la documentación, con lo cual se afianza el concepto de "tener criterio" y se resuelven los conflictos con documentación de diseño obsoleta, incompleta, o errónea.
  • Automatización, no solo de las pruebas unitarias, sino de toda tarea que sea repetitiva y con ello proclive a errores.
Una revisión por pares no es solo una oportunidad para detectar y corregir los errores de hoy, sino para aprender, y así poder hacer del trabajo de manera más fácil y mejor en el futuro.

Tuesday, 15 May 2007

Why not Python

2010-03-12 Amendment: After doing the research right, my conclusion is that the tools are available for Python, that Python is an excellent software development platform, and one that allows more productivity than, say, Java.
This article is about programming languages in the context of professional software work. While considering several programming languages with very attractive features for my next project I had to take a pause and think about what the objective choice criteria should be. My conclusion, as argued below is that programming language choice should be dictated by programming pragmatics.
I've been programming for some thirty years now, twenty of them doing it for a living. In my work I've come well acquainted with several programming languages, including Fortran, Basic and Visual Basic, Pascal and Object Pascal, C, C++, Java, and C#. During my university training I had to deliver assignments in Concurrent C, Simula, LISP, and Prolog, among others. I specialized in Computer Languages (compilers) and became a professor of the subject later. I have studied the innards of programming language implementation and have implemented several programming languages from scratch. I've studied every promising programming language I have come upon, including AWK, Perl, Python, CAML, Haskell, Nemerle, Groovy, and Boo, among others.
My experience with compilers in particular has brought me some understanding into what some call "programming language beauty", but that subject is better dealt with elsewhere. Here I want to talk about what makes a programming language work.
By "makes it work" I mean which features of a programming language let you get the job done in an efficient way. By "in an efficient way" I mean in a way that lets you do better than just survive in the ever more competitive field of software development.
It turns out that what makes a programming language work has less to do with the idiosyncrasies of the language and much more to do with how the language allows and provides for a good software writing environment. The first breakthroughs in programming language, in Fortran, LISP, and Algol68, consisted in raising the level of abstraction so programs could be more about the solution space than the machine. But the first breakthrough I remember, at least in the context of programming languages that work, came with the Integrated Development Environment (IDE), the first comercialization of which was provided by Borland for its Turbo Pascal programming language.
Turbo Pascal came with an IDE that included an interactive, full-screen editor, an incredibly fast compiler, and a debugger. It was the first time that a generally-available tool reduced the edit-compile-run-debug cycle to a matter of seconds. Today, IDEs are common-place, and few professional programmers would think of doing any significant work without the aid of one.
But what do IDEs have to do with specific programming languages? Turbo Pascal was a simple, structured, and well defined language, and that allowed Borland to build a very fast compiler that fitted in the few kilobytes of RAM remaining in the machines of the time after having loaded an editor.
By the end of the 1980's Apple's MacIntosh had made the advantages of Graphical User Interfaces (GUIs) for users obvious, and GUIs became not just desireable but a necessity. The common language of choice at the time was C. Programmers spent hours dealing with single event-handling functions (like WindProc) and trying to manage modal contexts through innumerable heap structures and casts, while loading and exiting the GUI environment to run a command-line compiler. The next breakthrough came again in the IDE. GUI designers had been around for a while, but the linking between UI elements and event-handling code had to be handcrafted. In 1991 Microsoft launched Visual Basic. Visual Basic was built around an IDE that was itself graphical and that, besides edit-compile-run-debug allowed hooking UI elements and events to individual event handlers with a few clicks. Writing GUIs suddenly became easy. The language feature that allowed for it all was Visual Basic's component model, a form of object orientation.
As computers became more powerful, the size and complexity of the programs we attempted to write increased. Programmers spent an important part of their time studying and trying to memorize Application Programming Interfaces (APIs) and third party libraries. The next breakthrough came again in the IDE in the form of context-sensitive help, and later in coding assistance. Instead of having to browse over a huge API reference, the press of a key would make the IDE produce the exact piece of documentation pertinent to the context in the editor, or provide assistance in filling out a method call.
The language features that enabled the new IDE functionality were static-typing and object- orientation. They are the same features that today enable automated refactorings, a functionality that is indispensable while we try to tackle even more complex programs with iterative and agile methods.
So, Which are the features a working programmer should look for in a programming language? They are the ones that enable good tool support for the act of programming: static-typing, and object-orientation. But wait... Shouldn't the tools actually be available? Of course! This means that the primary criteria for choosing a programming language is the availability of the tools that make us efficient at writing the programs we have to write. The breakthroughs in programming of today are still happening in the tooling.
Fans of programming languages without those features or without the tools available say that their language of choice allows them to think better and write less code. That criteria is completely a non-issue for the simple reason that modern programming language are converging to include every characteristic that programming experience has identified as useful: first-order and anonymous functions, closures, list and map literals, partial classes and AOP features, type inference, and duck typing. You name it. None of then offset the pragmatic need for a complete development environment that makes us competitive at what we do.

Saturday, 23 September 2006

Chomsky es #1




Un don es una responsabilidad
Hace unos veinte años, cuando estudiaba ingeniería de la computación en la universidad, aprendí que Noam Chomsky fue uno de los precursores de los lenguajes de programación, y con ellos de la informática en general, a través de su formalización de las gramáticas de los lenguajes "naturales".
Chomsky hizo sus análisis y creó sus teorías en los '50 y '60, es decir en la época que en informática consideramos el nacimiento de la computación digital. En otras palabras, Chomsky fue un pionero.
Este año me reincorporé a la UCAB (Univarsidad Católica Andrés Bello) para volver a dictar el curso de Traductores e Intérpretes (T&I), cuyo contenido está basado en buen grado en la aplicación práctica de las teorías de Chomsky sobre los lenguajes.
Hoy se conoce más a Chomsky por su activismo social (o será político?). Dicta numerosas conferencias y escribe numerosos artículos todos los años. Es uno de los nacionales de EEUU más críticos de los gobiernos y la forma de hacer política de su propio país.
Rueda por la internet que el discurso de Hugo Chávez, presidente de Venezuela, ante la Asamblea General de la ONU disparó el más reciente libro de Chomsky al cuarto lugar de la lista de más leidos del New York Times (!?). El libro es hoy el número uno en ventas en Amazon.com :

Tuesday, 22 August 2006

Practical Software Project Management

I'm often asked by clients, partners, and friends about the basics of software development and software project management.

There's much to write about practical software project management. I have on archive a compilation of the very interesting discussions shared with respected colleagues about the subject, and I intend to compile that into a series of articles, or a book, soon.
For now, I'll just provide the shortest possible reading list about the economics and logistics of software development.
Of course, there is much more to read and much more to say about effective software project management. But if you think you like the time, start with those six hundred pages of easy to read and well illustrated text.