Fog Creek Software
Discussion Board




Spelling and Coding

I'm curious: How do people feel about whether spelling variable and subroutine names properly is important? Programmers often aren't noted for their command of the finer points of the English (or whatever) language, and some would undoubtedly argue that one can be a great developer without worrying about such foolishness as the arbitrary "correct" spelling of a word. On the other hand, I've occasionally had to modify existing code that had rampant misspellings, and it frankly drives me nuts to see things with names like "Indentifier", "Defintion", "Catagory", and so on.

I could go on about why this annoys me personally and why I think it's intolerable coding practice in general, but at this point I'm mostly curious to hear what the group here thinks. Is arguing for correct spelling as futile as trying to get people to agree on tabs vs. spaces or vi vs. emacs, or is it reasonable to except a modicum of care here?

John C.
Sunday, April 11, 2004

http://mindprod.com/unmainnaming.html

#3 is there for a reason.

Philo

Philo
Sunday, April 11, 2004

Yes, I always except good spelling.    <g>

(Sorry to pick on you John... you raise a good point, but the irony was just too delicious.)

Robert Jacobson
Sunday, April 11, 2004

Drat, I should've known that drinking and posting don't mix! Guess I'll have to stop posting then. ;-)

John C.
Sunday, April 11, 2004

Mistakes are annoying in comments and such. Mistakes in function names and code can cause bugs very easily. Just spell well, it's not that hard.

Mike Swieton
Sunday, April 11, 2004


Developers should always spell variables correctly. I don't think anyone can reasonably argue against it.

Also, I hate abbreviations. Some coders like to use abbreviations, but since everyone abbreviates slightly differently I don't like it in my code.

I once worked on an application that dealt with email. The original authors were French. Most of the comments and variables were english, except "subject" which they spell "suject". I thought it was a typo and merrily started fixing all the typos. So now another thing I don't like is when people mix languages.

NathanJ
Sunday, April 11, 2004

Disclaimer:  I'm someone who has a spell-checker built into his brain.  That being said, I have yet to be disabused of the idea that anal-retentiveness, which can manifest itself as good spelling, is one of the essential qualities of a good programmer.

(Ugh.  Sorry for the inversion there; I've been reading Neal Stephenson.  Yes, spelling is important.  Paying attention to spelling gets you in the habit of paying attention generally.)

Okay, sure, the compiler (for languages that have them) will tell you when you spell the same token differently in the same scope, but in my own experience, the ability to spell things correctly the first time seems to have a correlation to the ability to spot other coding errors quickly.

Sam Livingston-Gray
Sunday, April 11, 2004

Careful attention to detail is only called anal-retentiveness by those who are unable to manage it themselves.  :)

Kyralessa
Sunday, April 11, 2004

You should always spell your code and comments correctly because Indian programmers are learn English by reading your code.

(Thats also why you need very long variables names, you cant learn english on abrv. )

H1B holder
Sunday, April 11, 2004

I asked a peer to correct a mispelled class name (and I explained that "diagnoses"is the plural not the singular): he agreed willingly, and ask me to tell him if I noticed any other mistakes.

Christopher Wells
Sunday, April 11, 2004

I once had to maintain VB code that was written by someone who's english wasn't quite mother tongue... I had to actually keep developing with the misspellings because it became pretty much impossible to track through out the code.

GD
Sunday, April 11, 2004

GD: who's -> whose


Sunday, April 11, 2004

Yeah, well i never said my mother language was english either... :)

GD
Sunday, April 11, 2004

Bad spelling gets baked into APIs.  Errors result since we don't often have good tools that make spelling irrelevant; plus it contributes to general feeling the code is creaky.

I like programming in a language that encourages encourages sensibly long names, and even works ok with spaces in variable names.

Tayssir John Gabbour
Sunday, April 11, 2004

Good naming is hard, but IMO worthwhile.

I hate abbreviations too, or more correctly, I hate bad and pointless abbreviations: Bad ones are hard to figure out, Pointless ones don't save enough letters to be worth the trouble (why "Passwd" instead of "password")?

I also hate long names: CustomerEmailPreferencesManager is clear, but IMO quite clunky, especially when it's in code like this:
  CustomerEmailPreferencesManager.getInstance().saveCustomerPreferences();

A good project for someone: write a short and sweet cookbook for good naming. Not just why bad naming sucks (we know that!), but how to improve naming on a project.

Portabella
Sunday, April 11, 2004


I find it annoying when programmers can't spell "cat" when you spot them two letters. Having to decipher their variable and function names is like learning a second language.

But hey...let's be honest...What do you expect from an industry that is largely populated by a bunch of un-educated hacks who were too lazy to get a formal education and jumped into the industry because it was the fastest way to make a buck?

Not Me
Sunday, April 11, 2004

If you all coded in MS Word (with 'smart quotes' turned on à la Kallal) then you wouldn't have any problem.

Stephen Jones
Sunday, April 11, 2004

I worked with a guy that couldn't spell if his life depended on it.  He wrote a number of useful utilities and classes for us, one of which was used so often, and was completely mispelled, that I painstakingly corrected the spelling and changed ALL occurrences of it!  Talk about a PITA!

BTW, try using Word to write a story who's lead character is names Teh.  It's impossible.

GML
Sunday, April 11, 2004

Can't you turn off "auto-correction" for "The" at least ? :-)

Dewd
Sunday, April 11, 2004

I think good communications and spelling should be a basic part of any professional job.

I would be happier if people without those basic competencies were excluded from programming, just as they are from other professional jobs. (In other jobs, this occurs because only well educated people get through the preparation systems, due to constraints on supply.)

.
Sunday, April 11, 2004

> Bad spelling gets baked into APIs.

Sometimes, into world-transforming APIs which can never be changed. 'Referrer' is misspelled 'Referer' in the HTTP spec.

VB
Monday, April 12, 2004

I don't see how well educated corresponds to being able to spell well.

You learn spelling in primary school, and I think just about everyone in the Western world with any kind of job has passed that.

This doesn't mean that they're all good spellers though.

Sum Dum Gai
Monday, April 12, 2004

>> I don't see how well educated corresponds to being able to spell well. <<

Here's why: because people who spell well do so because they tend to read a lot.  People who read a lot tend to be well-educated.  Q.E.D.

Grumpy Old-Timer
Monday, April 12, 2004

*  Recent Topics

*  Fog Creek Home