Archive for June, 2007

The road to hell is paved with loose typing

Wednesday, June 13th, 2007

I am now (I just took a break to type this note) assessing the quality of a Java codebase using many methods, including actually trying to understand how everything is tied together. Well, it would be an euphemism to say it is convoluted .

The developers chose to have most methods accept as parameters (or return) objects, arrays of objects, 2 dimensions arrays of objects or a whole range of unspecified collections (Hashmaps, Treemaps, ArrayLists and Vectors without any consideration about their actual intended use), and they definitely didn’t use Java 5 generics!

Moreover, they can return collections containing collections of 1 element, arrays of objects where only the value at a specific index is populated or used, arrays of objects containing very different kinds of types (a String at index 0, an Object[] at index 1, null at index 2 and a String or Integer at index 3, depending on the size of the array at index 1…).

Worst of all, the Javadoc associated with the methods is either non-existent, wrong (cut and pasted from an other method), useless (the description is just the name of the parameter split into words) or completely unintelligible.

It is impossible that this code has ever been reviewed by any competent Java developer. I think the assessment I am running is actually turning into a code review.

Now I must find a way to quickly improve code quality and communicate it efficiently to the new developers team… any idea?

Sphere: Related Content

Object Oriented old rope

Tuesday, June 5th, 2007

I found a very good refresher article on Object-Oriented Design at DDJ that I definitely would recommend reading: Software Complexity: Bringing Order to Chaos.

It explains how we need to divide a complex system into much smaller systems (divide and rule) in order to be able to cope with the complexity, and that it is much simpler to extend a system when you have confidence in its sub-components (automated testing anyone?).

Don’t miss the sidebar for a crash-course on different design methods (I suddenly realise why I studied SADT, Merise and OO)

Oh, and by the way, you might also learn that we all have short attention spans (limited to 7 subjects)… so no boasting allowed anymore! :)

Sphere: Related Content