The Black Box of Or
by in CodeSOD on 2007-02-28Tony has a problem. He has been charged with turning a stack of Python code into nice, shiny PHP. Now, I'm not one to trust a language that makes such a big deal out of white-space but having a style imposed on developers does have it's benefits. For one, the code is supposed to be more easily groked precisely because the reader only has one style to parse.
Still, it's been no picnic for Tony.
I didn't write the original non-documented, barely-commented code. I don't even know who did, so I employ a strategy of examining this code as well as its input and output. Once that starts making sense, I write a PHP function that does at least that and sometimes more. I'd like to share one exciting bit of code I came across during this process.