The Daily WTF
As covered previously, game code generally doesn’t represent an interesting WTF. But bad e-commerce code certainly does. So today, Rhys sends us some JavaScript from a web-based fantasy-football (for non-USA values of football) site. Given that it handles microtransactions and in-game items passed between players, it’s definitely more on the e-commerce side of things than anything else.
And much like that previous article, this one does involve a very large switch, but before we get to the switch, we have to get to the state validator:
else if(propertyName == “initUser” || propertyName == “updateUser” || propertyName == “submitLogin” || propertyName == “initRequestPasswordForm” || propertyName == “submitPasswordRequest” || propertyName == “resetPassowrd” || propertyName == “submitGameLogin” || propertyName == “deleteAlertReturn” || propertyName == “submitRegistration” || propertyName == “submitGameRegistration” || propertyName == “acceptGiftReturn” || propertyName == “sellGiftReturn” || propertyName == “buildTicker” || propertyName == “submitAward” || propertyName == “submitGameAward” || propertyName ==
To read the full article click on the 'post' link at the top.