Wassup Jose Weblog nonsense at its best!

17Jun/081

Can I get an enumeration?

I am assisting an owner (i.e. buyer) of a popular PHP-based social networking platform with query optimization and noticed the following:


{
  $smarty->assign('header', $message[23]);
  $smarty->assign('message', $message[28]);
  $smarty->assign('footer', $message[29]);
}

The above is part of the internationalization support, but I find it odd that the developers did not use a common enumeration versus using magic numbers throughout the code. Let me see, what is the ordinal for that error message ... hmm.

Comments (1) Trackbacks (0)
  1. oh man, my current project is riff with this kind of shenanigans. I keep a notepad file on my desktop to keep track of the ones that I can’t easily refactor.


Leave a comment

(required)

 

No trackbacks yet.