Thursday, March 09, 2006

About the supposed quality of proprietary software

Recently a client running a big and expensive ERP system (released by big ERP vendor) asked me some help to fix a buggy procedure. So I had a chance to dig into the source code - a Java class - and see from the inside how things have been implemented.

Here is a significant code snippet, but all the proprietary code in that file - a rather big class containing more than 1000 lines of code - was implemented according to the same style:

// I have changed all the names of the variables and methods
// to avoid copyright issues; however the names of the variables
// and methods reflect the original names i.e. they are totally meaningless.
// VAR45 and VAR62 are two boolean variables
do
{
// the following method returns a boolean value and,
// if an error occurs, it sets the VAR45 to true
VAR62 = !BOGUSMETHOD
();
}
while
(!( ! VAR45 ));

if( ! VAR62 ){
// Do something here...
} else {
// Do something here...
}

Just in a few lines the (salaried) developers succeeded in a very difficult task: they have violated mostly all of the Java coding conventions (variable and method names, indentation, the total lack of comments etc...) .
But most of all it's amazing to see how exception handling is managed (maybe try/catch clauses were not good enough for them) and how the (poor) boolean values are treated: my favourite expression is (!( ! VAR45 )).

As a committer of an open source project - OFBiz - I often review patches submitted by other developers: it's true, sometimes the code freely contributed contains some issues... but I've never seen something like this, really.

2 comments:

Yoav said...

Ouch, that's terrible ;(

Antonio Gallardo said...

Could be this auto-generated code? It's hard to believe a human wrote such code.