I spend a lot of time focused on API design. A *lot* of time. One of the biggest areas of API design is naming (I'd argue it's actually *the* biggest area because everything starts with how things are named). One of the naming items that causes more thought than others is the word "username" (or is it "userName", or "Username", or "UserName"? - I'll get to that in a second).
As a society, we've gotten to the point where seeing username is routine. Everywhere that requires credentials via a login form displays it. Most ask for a username while others will ask for an email address, which is used as the person's username anyway. We've become quite adjusted to this and it's part of our daily routine for a whole host of activities.
But when used as a proper noun, what is the correct spelling and capitalization of the word? Is it Username or UserName? The answer also determines what the camel-cased version of the word will look like when used as a variable or parameter.
For awhile I had always went with UserName, which would lead to userName when used as a variable or parameter (assuming you're following solid API design guidelines). But it never felt right because userName just doesn't look or feel right, especially when compared to username. After looking around the web for awhile, I noticed that Username and username were most commonly used, but I couldn't find a definitive answer. I even went spelunking through some of the .NET code with Reflector and found a little bit of UserName and a little bit of Username, although it should be pointed out I never found userName, just username.
Out of curiosity, I opened Word and typed a sentence with UserName. It immediately underlined the word with the little red squiggly that means it's spelled wrong. Sure enough, when I right-clicked on the word to get suggestions for proper spelling, Username was at the top of the list.
I don't know about you, but that's a good enough definitive answer for me. From now on Username and username it is.
And you know, if you really break this post down, it's all about one letter - N - and whether or not it should be capitalized. I'm freakish, what can I say?
Print | posted on Sunday, December 09, 2007 11:11 PM