28 fév. 2007

Source code with character

La version Française de ce billet est ici.

While waiting tomorrow's ticket about the Liskov Substitution Principle, I make this wonderfull piece of code I recently found on the system I work on available to you. And I'm pretty sure that, like me, you'll have hard time to find any kind of justification for this.

if (i == 0)
   element->address[0] = '1';
else if (i == 1)
   element->address[0] = '2';
else if (i == 2)
   element->address[0] = '3';
else if (i == 3)
   element->address[0] = '4';
else if (i == 4)
   element->address[0] = '5';
else if (i == 5)
   element->address[0] = '6';
else if (i == 6)
   element->address[0] = '7';
else if (i == 7)
   element->address[0] = '8';
else if (i == 8)
   element->address[0] = '9';
else if (i == 9)
   element->address[0] = '10';

I suppose we can agree that the author was a bit tired...[1].

Notes

[1] no, it's NOT me.

Ajouter un commentaire

Les commentaires peuvent être formatés en utilisant une syntaxe wiki simplifiée.

Fil des commentaires de ce billet