Most websites require that the username be unique. I'm noticing that SO allows duplica开发者_开发问答te usernames, which could be good when you have a very large website like SO (which I'm guessing they do to avoid usernames like chris123, chris213, chris321 which start to look confusing themselves). But is allowing duplicate usernames generally a relatively poor implementation? It can be confusing to get 2 answers from 2 users that have the same username.
So what other alternatives are there for large sites that have a large number of users that need to interact with each other? I'm thinking something that's not even username-based, but not sure what.
While having distinct usernames (typically used for login) is a near absolute requirement, there is no reason that the display alias has any requirement to be unique so far as there are discernable methods to identify the actual user for other individuals using the system. This is a fairly common practice among discussion forums since really there are many "Jeff Smith"'s out there. SO for example, uses the reputation of a user and links back to their profile as mechanisms in differentiating the actual users involved. The logins themselves though, must have a form of uniqueness to them.
As an addenum to clarify my comment:
The sky (and your imagination) really are the limit on how to uniquely identify an alias. Outside of the standard profile link you could add on other unique characteristics (should you want the alias to be relatively unmistakable). As an example of some I havne't seen: use unique fonts or colors when renering the alias ... the blue sanscript Jeff Smith is different than the yellow arial Jeff Smith (just an example method)
I have come across this in the past with my own website, and I find the best way is to identify a user is by their email address.
This is a very simple method, because it allows multiple usernames (or names, just like Facebook), and you can always identify uniqueness by their User ID in the database, and to show that on the website, maybe even show their username, avatar and possibly their location.
example:
chris123 (AZ) - chris123@example.com
chris123 (WA) - chris123.west@example.com
chris321 (AZ) - chris321@example.com
I believe you have two distinct issues; authorisation and personalisation.
Most sites will stick with using emails for uniquely authorising someone as these are already guaranteed to be unique. SO uses open authentication which means I haven't specified a 'username' for authentication with them in a long time. My OpenID has my email and my password and handles the authorisation part for SO.
The other part is personalisation which should most certainly allow users to choose duplicate names if they so desire. This needs to be tied to the authenticating details and would normally be done using a separate unique number generated specifically by the site. This then links the username for authorisation and the username to display. I would guess that this also forms part of the primary key in whatever database structure users are stored in.
If you check the links for each profile name you will see a number in the url and this is what uniquely identifies you on the site and ties twitter
to your email/username for login by the number 629665
. Your user page link is https://stackoverflow.com/users/629665/twitter
Whilst I can clearly see your chosen display name and your unique id on the site I don't know your authorising identity which you get to keep private and helps to keep you secure.
--> Choosing username, isnt something great idea. --> may be u can go for email id and username.
--> best is to Generate a unique ID for every user bro.
Well, your question is quite ambiguous, I've edited the title to make it more clear.
There is no question how to identify a user. If you look at stackoverflow user linfo link, you'll notice old good autoincremented unique number. No problem with it.
Thus, I suppose your question is how one user can recognize another. I think it's not that big deal as collisions very rare and one can always tell by user reputation and that ID.
精彩评论