Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


How should you handle compound words when programming?

Are there any good lists available online for developers of generally accepted technology-related compound words?

I can see how this is highly ambiguous, so should I just use common-sense?


I would be inclined to do this:

filename NOT FileName


login NOT LogIn

However, the microsoft documentation indicates that filename is not compound. So I wonder, is there a more definitive source? See also, this english.stackexchange discussion on filename.

Under the section "Capitalization Rules for Compound Words and Common Terms" located here: Microsoft .NET Capitalization Conventions only offers a limited introduction into the topic, and leaves it up to the developer to use their intuition with the rest.

share|improve this question

closed as not constructive by Caleb, Robert Harvey, Steve Evers, ChrisF Oct 9 '12 at 21:44

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Is there anything we can add here that wasn't already said in the English.SE discussion? – Robert Harvey Oct 9 '12 at 20:04
The outcome of the discussion depends on the context. In the case of programmers, and due to the ambiguity of the topic, a programmers' approach to handling compound words, and assigning special cases for our industry, might be different than the attitude and approach an English major might take. This is a discussion specific to our industry and its particular approach. – Ray Oct 9 '12 at 20:41
up vote 4 down vote accepted

In this case, it's more important to set your own standard and follow it consistently. A lot of this is debatable between developers, so you should pick a method and use if consistently for each word. A dictionary is a good place to check to see if something is a valid single word.

As an aside, login is a noun (the login page) and log in (or LogIn) is a verb (log in the user). Here the distinction can be made by writing logIn vs. login

share|improve this answer
"login is a noun (the login page)" Isn't it an adjective in that example? ;P – pdr Oct 9 '12 at 21:12

I search in an english dictionary and both filename and login are single word terms. So in programming they should be treated as a single word, not compound words.

I guess an english dictionary should be a good source of reference.

share|improve this answer
So just to be clear, and depending on the context, you would be more inclined to use FileName or LogIn? – Ray Oct 9 '12 at 20:04
Since the dictionary says they are single word terms. I'd preffer finename and login. – Tulains Córdova Oct 9 '12 at 20:10
That's a mighty fine name. – Robert Harvey Oct 9 '12 at 20:27

I'm highly annoyed by inconsistent naming. I suggest these actions:

  1. Create a project-wide dictionary for naming that resolves all the common cases, like "filename" and "login". If you are going to allow any abbreviations, they should be standardized too, and if used at all, I suggest using them all the time.

  2. Define a process to follow to resolve new questions about word breaks. For example, you could just defer to or another online dictionary.

  3. Have code reviews to catch naming errors.

  4. Publicly flog repeated scofflaws.

share|improve this answer

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