Freigeben über


Spell Checking your Source Code

I’m going to try something new today… a pseudo review/comparison of two similar add-ins that people recently mailed me. Please let me know if you are interested in this style more in the future or if it was even helpful. I’ll remind readers of this blog that these opinions are mine and do not form any sort of Microsoft view one way or another. In the case below both options are free and worth trying on your own. I have a feeling that people will either like one or the other based on personal preference rather than performance.

Thanks. Josh

I can’t spell. I’ve grew up in the age of spell checking computers. Recently, with the advent of auto-correction I think I’ve gotten worse. Now I don’t even get the “red ink squiggly” as long as I’m “close enough”. This is no huge problem when it comes to e-mail, documents, or slides, but I can’t tell you how many code reviews I’ve had that ended with “Well, it all looks good, but did you know ‘sourceDirrectory’ is spelled ‘sourceDirectory’?”

Over the last couple of days I’ve been trying out two different VS Add-Ins for this problem.

1. Spelly.NET from WndTabs.Com

This add-in supports VC6, VS.Net 2002 and VS.Net 2003. If you have VS.Net 2003 however, be prepared for some extra install steps that include two extra downloads and adding information to the registry. It also must be re-registered if you don’t like the default install directory.

Once you do get it running you’ll see two spell-check buttons on your toolbar. One button is for checking source code and comments and the other is simply for strings and comments. The interface doesn’t provide you with a lot of options, but having these two buttons separated out was nice. It’s simply a spell check with no frills that offers alternatives.

Spelly was also nicer to me when I had commented out code. The second option seems to only want normal words in commented out code where as Spelly follows the same spell checking rules in both situations. I suppose I should just remove commented out code, but I’d prefer to do that on my own and not worry about it when I’m spell checking.

 

Grab it here: https://www.wndtabs.com/downloads

2. Spell Checker for VS.Net 2003 from Dotnet2themax.com

The install here was painless and it just worked the first time I used it. It’s always refreshing when that happens. This spell checker goes way beyond the basics and provides a bevy of options.

For starters you can have it iterate through entire projects at a time rather than having to open each file as you do with Spelly.Net. While you are spell checking you can also have it skip an entire line or file. Other options include defining regular expressions that declare words as either always correct or always misspelled. While both offer support for the basic file extensions this one allows you to define custom extensions to be checked as well.

One glitch with this option, IMO, was that if you started a spell check, closed the dialog, then tried to start a new check on another file or piece of text, it would assume you wanted to finish the one you started before. You have to learn to press “stop” then “start” again. Spelly assumes that each time it is run you killed off the previous check.

 

Grab it here: https://www.dotnet2themax.com/ShowContent.aspx?ID=10d5b7f6-8ffc-4e4f-9b0f-133b5fa3d79c

In Closing

Both checkers also seemed to work fine through the VSCmdShell code that I tested them on catching a lot of mistakes similar to…

const int paggeStep = 10;

const int sourceDirrectory;

and correcting to “pageStep” and “sourceDirectory”.

Both options require some training for the first few uses. By default they don’t understand that keywords like “bool”, “int”, and “const” are acceptable for use in your code. Option 2 will let you tinker with the settings more if you don’t like the way it works when it is first installed, but there was also something to be said for the simplicity of Spelly.Net. I felt like I spent too much time babysitting and tinkering with the spell checker from Dotnet2themax after the install. In the end I’ll probably use Spelly.Net more often for spot checks of new code or comments, but leave both installed because I do like some of the options (like check whole project) provided by the Dotnet2themax solution. They both have their uses. Good Times!

Feel free to respond with your opinions if you have tried the two.

Comments

  • Anonymous
    September 29, 2004
    How about FxCop.
  • Anonymous
    October 01, 2004
    WOW! Thanks a lot for those add-in's !!!! I need them !!
  • Anonymous
    October 07, 2004
    CodeRush from DevExpress includes a plugin red underline squigglies and SpellChecking for string literals...