If it quacks like a quack...
Spell checking code can lead to some really funny misspellings. In my previous post I had an interface named IDuckService which the spell checker suggested that I'd change to quackeries.
Naïve spell checking of code with Microsoft Words dictionary doesn't make much sense, but there are some alternatives that do. Microsoft's FxCop does a good job at tokenizing camel and pascal cased symbols to ensure that the are spelled correctly, the automation samples for Visual Studio 2005 contains a spell checking macro that allows you to use the Word dictionary from within the IDE and there are spell checking plugins available for both Eclipse and IntelliJ.
Because typos, strange names and similar are code smells, it is worthwhile spending time on naming types and methods within your domain model. The Java SDK has some embarrassing examples that reminds us of this. You have the famous misspelled interface and the JDK documentation says this about java.awt.image.renderable.RenderContext's concetenateTransform method:
"This method does the same thing as the preConcatenateTransform method. It is here for backward compatibility with previous releases which misspelled the method name."
If you make similar mistakes in a public API you might be stuck with them - just like Sun are stuck with their typos. Unless it is anything like the cloneable interface which does not even have a clone method, then you could probably just deprecate it...
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using