Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I understand that this may be primarily opinion based, but I also think it is an interesting question and would like to hear others' viewpoints on the subject.

I recently became the senior developer for a large company, and inherited what I can only describe as a less-than-adequate code-base. Whilst I won't go in to detail as to why most of it was terrible, something that did stand out, was the huge amount of spelling errors. One of the more notable ones, was "Actual" spelled "Acutal". This was pervasive in functions, classes, stored procedure names, and column names.

To me, this is a clear indication of lack of care and due diligence with respect to ones' work. I believe that if code is littered with these kind of things, the programmer in question is not paying attention. I understand there is a caveat if the programmer in question is perhaps not a native-English speaker (in this case, they were) - but simple code reviews should pick these things up.

As developers, we spend a lot of time making sure that our work is functionally correct, optimal without over-optimising, and finally - easy for another person to pick up and work with. Code that is littered with spelling errors is a sign (given the caveat mentioned above), that the programmer is not paying attention and that those errors might also indicate a lack of understanding of the problem being solved. Much the same way that any spelling errors on a CV is an instant red-flag situation.

What do you guys think of this? Should we be bothered about English grammar within the code-base? Does it matter? Is it indicative of the attention-span of the developer, or is there no correlation that could be reliably drawn?

(Note: I understand people do program in other countries, and I have used English as an example here. I also respectfully understand that someone whose first language was not English may find it difficult. This question is aimed at those who should know better)

share|improve this question
    
Spelling is not grammar but I agree with you. My spelling in general is pretty bad but programmers need to be careful in their code and there isn't much excuse. –  Keith Loughnane May 1 at 15:04
1  
I think a general rule of thumb should be: If you're writing the code, you should know what you're writing. This includes things like correct spelling, understanding of the meaning of each word, and understanding of the code itself. I'm not saying every programmer should grab their nearest dictionary and start memorizing spellings, I'm just saying that when you code, you should only stick to words that you are 100 percent sure you know the meaning of, and furthermore assure yourself that you know the definition of every word. This applies for both code and comments. –  Shashank Gupta Aug 25 at 16:11

7 Answers 7

up vote 6 down vote accepted

Programmers must do more than just write code; they must also have good communication skills.

A "typical" job description, from Monster.com:

Programmer Job Duties:

  • Confirms project requirements by reviewing program objective, input data, and output requirements with analyst, supervisor, and client.
  • Arranges project requirements in programming sequence by analyzing requirements; preparing a work flow chart and diagram using knowledge of computer capabilities, subject matter, programming language, and logic.
  • Encodes project requirements by converting work flow information into computer language. Programs the computer by entering coded information.
  • Confirms program operation by conducting tests; modifying program sequence and/or codes.
  • Prepares reference for users by writing operating instructions.
  • Maintains historical records by documenting program development and revisions.
  • Ensures operation of equipment by following manufacturer's instructions; troubleshooting malfunctions; calling for repairs; evaluating new equipment and techniques.
  • Maintains professional and technical knowledge by attending educational workshops; reviewing professional publications; establishing personal networks; participating in professional societies. Contributes to team effort by accomplishing related results as needed.

Note that only two of the bullets involve coding only; the rest have to do with using the English language and verbal/written communication skills in an effective way.

I am wondering, though, what happened to Find and Replace. Did it suddenly stop working at your organization? Modern IDE's do this well enough nowadays that a spelling error takes 10 seconds to fix. And yes, it does need to be fixed.

In any case, how is a programmer expected to deal with the pedantic nature of a computer (a device that is brutally unforgiving with respect to syntax), when they don't even have a working grasp of the English language?

share|improve this answer
    
Luckily, said developer is long gone (hence my inheritance). Whilst you are absolutely correct, one must assume that it never occurred to the developer that there was a spelling error in the first place. This sort of leaves me feeling rather cold and clammy. Perhaps I should have a lie down. –  Moo-Juice Jan 16 at 22:52
    
I'm going to disagree with you here. Yes communication skills are key in doing this job, but I have run across a fair number of slightly to highly dyslexic programmers who were still perfectly competent in all their communication skills. They would spell things VERY creatively and VERY wrong sometimes, but rarely did this get in the way of their communication skills. Now if the writing lacked punctuation and had downright incorrect grammatical structures like using plurals and singulars interchangably, these might fail the communication sniff test, but spelling is less important IME. –  Jimmy Hoffa Jan 16 at 23:28
1  
@JimmyHoffa In the absence of notable disabilities, my observations are still valid. They're actually valid even in the presence of disabilities, but our society has come to have compassion for those individuals, and compensate for their deficiencies. The same cannot be said of perfectly able-bodied, able-minded individuals. To put it another way, dyslexia is no excuse for those who do not have it. –  Robert Harvey Jan 16 at 23:30
    
@Moo-Juice I wouldn't relate a spelling error to one's coding ability, the guy could have been highly dyslexic but perfectly competent with systems design and logical structure. Alternatively he may have been one bad hair day away from a boating accident, I don't claim to know, just that one's spelling ability is orthogonal to their development ability. Now grammar is a different story, general punctuation and sentence structure is usually well understood by folks who spend their mental capacity systematizing things to begin with. –  Jimmy Hoffa Jan 16 at 23:46
    
@JimmyHoffa (aren't you supposed to be dead? ;))... I would always take on board the dyslexic argument, that's fair enough. In this case, however, the design was just as much a mess as the spelling, hence my post was an attempt to see if there was a correlation between the lack of thought in design and the lack of effort in the spelling. –  Moo-Juice Jan 17 at 8:21

Those familiar with the wonderful essay "How to write unmaintainable code" will remember:

If you must use descriptive variable and function names, misspell them. By misspelling in some function and variable names, and spelling it correctly in others (such as SetPintleOpening SetPintalClosing) we effectively negate the use of grep or IDE search techniques. It works amazingly well.

And you can get worse when you get spelling variations within a method:

var actualValue = 0
...
(snip)
 ...
var acutalValue = GetActualValue();
if (actualValue == 0)
{
...
}

The compiler won't complain. Most programmers will read this and subconsciously correct the misspelling in their mind. They won't immediately spot the code does the wrong thing. Or does it? In a more complex example, could you tell? With poor spelling you can completely lose the intent of the code.

Not wishing to be down on people who have genuine difficulty such as dyslexia - if you know it's a problem, then get your boss to pay for tools that can indicate mistakes. It's worth the investment.

share|improve this answer

No, though I'd see this as an indicator of pride in their work with may be lacking.

What do you guys think of this?

I'd wonder if the person was rushed in producing this code or if there is some reason for not having the pride to make sure things are spelled correctly. Part of the big challenge in English is that some words can be really close in spelling yet give different meanings without bringing in homonyms and other challenges.

Should we be bothered about English grammar within the code-base?

You point out spelling mistakes, not grammatical errors so it may be worth editing the post if your issue is more on the spelling side of things. Punctuation does have its place as the Eats, Shoots & Leaves joke points. Do you see this or not?

Does it matter?

Yes, communication can be quite important as well as the question of pride to ensure quality work is done.

Is it indicative of the attention-span of the developer, or is there no correlation that could be reliably drawn?

Attention span isn't where I'd focus. I'd be more tempted to consider the pride factor. Some people will put in the time to make sure things are done right and corrections made while others may leave things as a mess.

share|improve this answer

This is an industry where the output is based on the understanding and communication of ideas and feedback. While your example does not really seem like much of an issue, poor communication can have significant impact on code quality and schedules.

My experience has been that poor communication of requirements and defects has a greater impact. You may find that an inability to convey ideas well, may also indicate an inability to properly interpret well communicated ideas.

As an aside, how many others were worried about mistakes in their responses? ;)

share|improve this answer
1  
Not as much as I was about mistakes in my post :) –  Moo-Juice Jan 17 at 8:18

Poor grammar could be an indicator of poor workmanship and code hygiene, and is a hint that bugs may be present in the code as well. Grammar problems would be likely in user-visible strings and log messages as well, which would reflect poorly on the product.

However, poor spelling is even worse, even if it's just a misspelling in the comments. A misspelled word could make it harder for another team member to grep for something.

We work in a field where a slip-up in a tiny detail in the code such as incorrect punctuation or whitespace could have significant effects. It is reasonable to push for zero defects, even in "innocuous" aspects of the code, like proper grammar in comments.

share|improve this answer

Yes.

Code does two things:

  1. Tell the computer what to do

  2. Tell other developers what the computer is doing

Can't really do the latter if you can't even write a good sentence.

share|improve this answer

Yes and no.

Yes good grammar is important because the most difficult task for any development team is to write code that other people (including themselves) will be able to maintain in the future. Good spelling assists readability and is therefore also important.

No good grammer is not important because our primary task is to write and modify code. If I sspell something incerrectly occasionally and it doesn't hurt readability too much then it doesn't really matter. Sometimes English is a second or therd language for developers and differences between their primary language and English are difficult for them to overcome. So long as the code is well structured and you can "kind-of-sort-of" get the ideas that the other developer was trying to convey you'll be okk.

The most important thing to remember is that there is bad code everywhere. I'd much rather the badness of the code to be due to someone's poor spelling than due to their inability to write well structured code.

share|improve this answer
    
The irony is killing me. –  cHao Jan 17 at 2:42
1  
I should clarify that all of the misspellings in the second paragraph are intentional and intended as humor –  Stephen Jan 17 at 3:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.