Article 6FSZZ CodeSOD: Cast a Different Spell

CodeSOD: Cast a Different Spell

by
Remy Porter
from The Daily WTF on (#6FSZZ)

The rule of spelling in programming is that it doesn't matter if you spell it correctly, only if you spell it consistently. Which is fine if you're working alone, but we rarely work alone. And unless you're entire team shares the same misspelling habits, you're in for trouble when one person insists on "calander" while everyone else uses "calender".

Fortunately, Jonathon's co-worker had a solution to this problem.

public function getCheckoutMehod(){ return $this->getCheckoutMethod();}

Instead of fixing typos, they just translated the typos to correct function calls, because who doesn't like polluting the namespace with all possible alternative spellings? It's not the best mehod, but it meant their code ran, and no one needed to learn to spell.

otter-icon.png [Advertisement] Otter - Provision your servers automatically without ever needing to log-in to a command prompt. Get started today!
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments