It doesn't let me edit the title anymore, it should have said Reload this Page Is allowing spaces in usernames safe?
in my oppinion it's a safe thing..i can't see any problem in this.On my site i allow spaces in usernames. searchingcoder
There's nothing unsafe about it. The reasons why spaces aren't ordinarily allowed in usernames are mainly historical. The only problem is that sometimes it's harder for people to remember them correctly because most users are so well trained to believe that spaces are not allowed.
Having spaces in the username is OK. However, you might run into problems if you don't encode/decode the URL if it contains the username with the space. Peace,
Don't forget that "name" and "name[space]" will not be immediately distinguishable by the average visitor. It would be a shame for "name" to get banned for something "name[space]" did.
I always call trim() on absolutely everything that comes in from the user. Avoids all types of problems like that. In 16 years of web development I have never once encountered a situation where storing leading or trailing spaces in a value entered via an HTML form was desirable or useful.
Habit. For 99% of web sites that do not allow it, there is no other reason. Their developers don't allow it because they've seen other developers not allow it.
Lazyness is also a factor, I believe. Lots of webpages uses ready-made backbones, just slightly altered to fit the requirements for the webpage. As lots of these frameworks have "quirks" that for some reason makes them incompatible with different DOCTYPEs and such, there are also restrictions to mundane stuff like spaces in usernames and such. It's not really BAD coding, it's just somewhat deprecated coding, and lazyness on the developers using the offered solution without changing anything, but adapting to it instead.