I'm making a new site, where there will be a lot of public comments hopefully, and this thought crossed my mind. Is it right to ban usernames with swears in them? Do people even create usernames like this? Trolls do presumably...
This is not as simple as it may seem, and although your instinct may be to ban someone, you should first consider the following:
This is not a simple or easy choice. You need to weigh up carefully the impact that this will have on your community and choose accordingly. However, you may find that the best option is simply to contact the person involved and ask them to change their username to something else.
As a side note here. You will never stop everyone from being offended, and I would argue that within reason you shouldn't have to try to prevent that.
I have a Mexican friend whose name is Jesus, and in Latin America that is perfectly normal. But many people in the USA for example would find someone calling themselves Jesus offensive.
Short answer: No
There are users who like obscenity and vulgarism, there are those who don't. Generally those kinds of people don't like to mix, and will always try to segregate into separate groups. If you ban offensive names (which is not that easy from technical standpoint), you remove one of the flags those people use to distinguish themselves. However you're not changing the people. You just artificially force them into the same group, which ultimately diminishes user experience for everybody.
For example, suppose you join a game server and see that the majority of users in the lobby have names like
If you are building a community of respectful people, your users will be such through self-selection. And they'll have normal, non-offensive names (except for an occasional dude with a name like user958624 :). Even if you do get occasional trolls, they can be weeded out manually, and there are much more effective ways to do that than banning / forcing to change one's name. Because you can't force them to change their nature...
It depends on the service and your expected user base. Deciding between blocking and allowing potentially offensive usernames is fairly easy. The more difficult decision is where exactly you draw the line.
You are making a tradeoff. You are disallowing some users from doing something they'd like to do (use a vulgar/offensive name) in order to create a more pleasant, less hostile/offensive environment for other users. Both of these groups obviously prefer one side of the decision over the other, so consider these two points:
Depending on your target audience, you may want to allow anything, and not worry about people getting offended. If you want a more general (and more polite) user community, you should disallow offensive names.
Two points in favor of blocking such names:
This leaves the issue of what exactly needs to be blocked. I suggest having a blacklist prepopulated with some known undesirable names (or regular expressions describing such names) that can be expanded as new trolls get creative with ways around it.
The best solution is for a site to have "safety" levels. By default, content created by users who are identified as offensive is completely hidden from view. You don't see their questions, answers, comments or accounts at all, unless you switch to unsafe mode.
When you switch to unsafe mode for the first time, you have to acknowledge a dialog that you're considered an adult wherever you live, and that you're about to see content that may be offensive.
If you simply block people, thereby denying them access to an audience, they will keep coming back under different names, and then you have to resort to IP level bans which have various downsides, like collateral damage.
Refinement: When a user is identified as offensive, they can silently be marked as such, and at the same time, their filter can be silently flipped to unsafe mode. (Posting that kind of stuff essentially constitutes consent to read it, and unsafe mode is necessary so that the users can see their own content and believe that everything is working fine, as before.)
The effect of this is that offensive users are not aware that they have been marked offensive. Not only do they continue to see their own content, but other people can see it and can respond. (But of course, all those other people are fellow offensives.)
Short answer: Yes, ban it.
Always a good idea to prevent the user from creating such names. There will be some who bypass this and use numbers for letters and stuff, but you should not make it easy for them use it blatantly.
Also, depending on the context, it is highly desirable, for example, here on stackexchanges, it shouldn't be that big a deal, but in games/public forums it becomes a big deal. The foul names create a hostile environment, say my username was "I F'd your relative", right off the bat, I create a negative impression for myself. And whatever I comment, will be influenced by that first negative impression.
Edit 1: With the interesting discussion on the multi cultural implications of certain words in the same language, I suggest that rather than banning "all" vulgar words, you just select a top % of the list and ban those. It should give you quite a good control over the issue and still leave the more ambiguous terms available.
Edit 2: For all those riding the 'It is against the Freedom of Speech' wave http://en.wikipedia.org/wiki/Freedom_of_speech
Now, there is a huge asterisk mark on this right.
Look at the limitation section for more information:
You CANNOT use your right to speech in a manner which is offensive, even though it is a minor crime (in most of the cases).
So yes, it is a good idea to ban generic offensive words. Example: if you have played any decent online game, you might have noticed that the character names are not vulgar for the most part (unless done so using 1337 5P34K or something), the reason is, the developers restrict the use of any such usernames and usually have a handy blacklist. Granted it is not a fool proof system, but it is a first step in the direction. http://www.wowhead.com/forums&topic=151067/banned-name here is an example scenario where it backfires.
Here is wikipedia's own list of rules for usernames http://en.wikipedia.org/wiki/Wikipedia_talk:Username_policy/Archive_12. If you scroll down to offensive, there is an argument that the "lesser" offensive words may be allowed but surely there is a need for the often offensive words to be banned.
Given that you stated that you're going to cater for mostly British folks, you should consider following their laws. I am not a lawyer, but reading Wikipedia's article on the topic you'll need to account for users who use hate speech in their nicknames.
This might be a hard requirement for you, something you don't really decide “if”, but “how”.