Architecture logicielle & Développement

Source code with character

Tags:

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.

Trackbacks

Aucun trackback.

Les trackbacks pour ce billet sont fermés.

Commentaires

Aucun commentaire pour le moment.

Ajouter un commentaire

Si votre navigateur est compatible, vous pouvez vous aider de la barre d'outils placée au-dessus de la zone de saisie pour enrichir vos commentaires.