views:

176

answers:

4

In all my web-projects I've made 1 unique nickname for 1 user (i.e. in DB table User has primary key ID and unique varchar 'nickname' or 'login' or whatever else).

At Stackoverflow we can see just the opposite solution and many users have the same nickname.

Futhermore, user can change his nickname here whenever he wants.

I wonder what are the pros and cons of this approach?

Actually I see some negative moments and only 1 positive.

Pros:

  1. During registration user shouln't 'bruteforce' login field to find available nickname (and it can greatly simplify registration process).. but that's all

Cons:

  1. you can't be absolutely sure who is the author of the question, answer or comment
  2. somebody can set all his info (including avatar) just the same as another user did and tell something like from that user's name
  3. it's a source of potential bugs because when I change my nickname what should be happend with all my previous publications?

What can you add? What 'side effects' can we see here? Maybe, lots of users use their real names for registration (but it also often happens at other resources)?

Maybe this 'strategy' is preferable for projects with only audience over millions? What kind of projects should use this approach? Blogs? Projects like YouTube? Social networks? Educational resources?

All your considerations are welcome.

A: 

If each user has both, a unique (generated) nickname and an enterable nickname, you get both uniqueness and usability. I believe this is what StackOveflow does.

The idea goes something like this: let the user come up with their own login credentials (or, in the case of StackOveflow, force them to use OpenID), but assign them a unique identifier anyway. That way, when a post is created, the post is assigned to the unique ID, not the login credentials, and therefore we never need to worry about who posted what because each user has a unique ID.

Identity on the internet is fleeting, so letting users have some control over who they are greatly improves user experience.

Matthew Jones
but as I understand 'unique (generated) nickname' is simple sequence of digits (i.e. usual ID), or I don't know something? :)
Roman
That's correct. The idea is that the generated ID is never seen, but since it is unique, the users can give themselves any nickname without fear of it being the same as someone else.
Matthew Jones
@Roman, that's correct.
JoshJordan
A: 

Especially on a community site, there is more to a user than his profile fields. Here on Stackoverflow and its sister/brother sites it's reputation and I guess a user with the same username and profile as mine will have a different reputation.

If he participates in the community, everything is fine, and who cares how he is called. If he will be deleted due to abusive language, it also doesn't bother me.

So I don't see a reason to uniquefy usernames.

StampedeXV
@JoshJordan sorry, but I really meant profile, as Roman writes about setting all info in the profile to the same as another person/account.
StampedeXV
+1  A: 

You missed one of the major pros: usability!

People like to have control over their accounts, and the freedom to change its properties (perhaps especially the nickname) whenever they want. If your database schema has tied your hands and made you unable to provide them that functionality, you've lost usability points.

I think that your cons list is largely moot since users can view eachother's profiles, and because you'd never use a non-constant value as a foreign key. Thus, old posts will always reflect the current username, and link to the correct profile, which is indeed unique.

JoshJordan
A: 
  1. you can't be absolutely sure who is the author of the question, answer or comment 1a. You can by the id however it is more akward.

  2. somebody can set all his info (including avatar) just the same as another user did and tell something like from that user's name

2a. I agree, if you allow this then you can pretend to be other users easier

  1. it's a source of potential bugs because when I change my nickname what should be happend with all my previous publications?

3a. No it isn't, you should only ever recover from the DB using the ID and not their username. Hence this isn't a problem. This post will be stored with a field "user_id" with no mention of my Display name for example.


As for the positives?

Well it's all for the user baby! And that is what matters most. If there was a problem with people pretending to be other people then it would be changed i'm sure. Keeping login details and display names different is a common way to make this method secure too.

Also on this site everyone has their own badges and experiance so it is unlikly two will have similar on all these features.

Dorjan