All the Pieces
by in CodeSOD on 2013-03-25So much bad code arises from the fact that people don’t know that there’s a better way. If a developer doesn’t know about “split” and “join” functions, they might write a cumbersome for loop to manipulate a string. If they don’t know about regexes, they might really overcomplicate some string munging
. Or heck, maybe they don’t understand a for
loop, and use a while
instead.
Maurycy submits this PHP code. It’s hard to really understand how this particular version of the code came into being.