As a developer, you might think to yourself, "why would I need to use a spell checker? I'm writing code, not an essay." I believe that sentiment, while understandable, is incorrect. Here's why.
What Is It?
But first, in case you're wondering what a code spell checker is exactly, it's a spell checker that understands the way code is written. It understands cases (such as camelCase and snake_case) and will ignore keywords (such as const
).
For example, myvariable
will be flagged as misspelled, but myVariable
won't be.
A code spell checker will usually take the form of an IDE extension, and the one I use (for VS Code) is simply called Code Spell Checker (streetsidesoftware.code-spell-checker). It works well, and I really like that the blue squiggly lines it produces are noticeable but not annoying.
Now let's get into the "why".
Professionalism
If you're writing user-facing content, such as API documentation or rendered text, then the benefits of using a spell checker are obvious. You always want to give your users a good experience, avoid any confusion, and be presented as a professional and reliable source.
But even if you're just writing code, using a spell checker is still a great choice. The enhanced clarity and maintainability will be appreciated by anyone that works on the code in the future (including you).
Pull Requests
Even if you don't care about misspelled code, someone on your team (or anyone else reviewing your PRs) might. For that reason alone, I'd say a spell checker is worth it. No one wants to waste precious review cycles on something so trivial.
Errors
And most importantly, not using a spell checker can end up causing errors. I've seen it happen before, and I imagine I'll see it happen again.
How? When some code expects the correct spelling and other code expects the incorrect spelling. Types and linting can help with this, but they can't catch everything.
For example, you may have a NoSQL database or just some JSON that is intentionally flexible; you want the freedom to change the structure of the data as quickly as possible. But when you pluck that data out, it can be difficult to ensure all the fields match.
Of course, using a spell checker can't guarantee these errors won't happen, but it will reduce the likelihood. After all, there's only one correct way to spell a word, and an infinite number of ways to misspell it.
Conclusion
To summarize, using a code spell checker enhances professionalism (cleaner code and rendered content), speeds up PRs (fewer nitpicky corrections from reviewers), and prevents errors (catching typos that could cause bugs).
For these reasons, I'd highly recommend installing a code spell checker in your IDE. It's a small, unobtrusive change with real long-term benefits.
Do you agree or disagree? Feel free to let me know in the comments. Thanks for reading!
Top comments (0)