views:

341

answers:

7

In past many years I have registered on various applications and platforms hosted online or offline.

Why white-spaces are not allowed in User Names as spaces are very natural to names and most of the computing systems can handle them efficiently.

(Many people can raise similar questions about other special characters which are illegal. But their case is far more understandable as they are not even natural to real world naming schemes. And surely!)

A: 

The only reason I know of that makes any sense is that if you're parsing tokens on whitespace, putting space in a user name will cause it to fail.

However, I do agree with you: in today's environment, there's probably not a lot of reason to continue doing it, except where legacy compatibility makes sense (*nix, etc).

warren
Spaces in user names work great in unix. I'm sure they'd screw up loads of people's scripts, possibly including some that come with the OS, but all the core stuff works just fine.
Mark Baker
+1  A: 

I imagine because some code somewhere is still processing the input as a set of space seperated parameters, much the way the Windows command prompt handles unquoted file names. For example if you were to pass the user name to an external executable process, written in C, where the user name was passed on the command line, it would arrive in the C application as two arguments.

While this mightn't happen much in practice any more, much the same as many special characters, I guess its the reason why its there.

Shane MacLaughlin
+1  A: 
Nrj
Trimming chops off spaces (and other illegal characters) from the beginning and end of data, not between valid characters.
VarunGupta
What if user enters the password as pwd<space>
Nrj
Though it wasn't specified exclusively but, ostensibly, this is not the case that we are discussing.
VarunGupta
If the password is hashed (as it should be), then that isn't an issue.
Macha
A: 

It prevents confusingly similar name combinations e.g. "John Smith" and "JohnSmith". It also makes it easier to automatically recognize names that appear within text.

jedediah
As compared to JohnSm1th, and J0hnSmith? I just don't see this as a reason, sorry.
Matthew Scharley
Regardless of how you see it, this is in fact one of the reasons it is done.
jedediah
A: 

It depends where they're going to be used. Not using spaces in unix user names makes sense for the same reason it makes sense not to use them in unix filenames - they're a pain to type at the command line. That said, unix does allow spaces in user names as well as in filenames.

I can see no reason for things like web apps not to allow spaces.

Actually the thing that annoys me most is web apps not allowing @ in user names. When it's something with millions of users the chances of a name I really want being available is small, so I like to use my email address which at least is guaranteed to be unique.

Mark Baker
+1  A: 

I think in reality this is probably one of those conventions that needs to be broken. Most systems now deal with a lot of sophisticated data and are used to correctly processing text which includes spaces. I was delighted to discover that fogbugz (another plug) will accept your email address, your username or your real name as you have entered it as your username when you log on.

This is simply a convention that is still around from the days of 8 letter file names and probably also 8 letter user names. I would suggest you allow it in your web app and let the world follow you. :)

Toby Allen
+1  A: 

One subtle problem related to spaces in user names is that the space character is "invisible" and two consecutive spaces may look very similar to a single space. Errors that arise from entering two instead of one space can be hard to spot and this is one reason to disallow spaces all together.

Some systems may disallow spaces but still allow a non-breaking space. A smart user can use this fact to include a space in his user name.

Martin Liversage
If you're worried about multiple spaces, I would argue that a much more usable solution is to collapse multiple spaces into one rather than disallow them altogether.
Bryan Oakley