开发者

Should I name the username field in my user table "name" or "username"?

If I name it username then I would have to write user_username wh开发者_运维知识库en referring to my field when I can just write user_name if it's named "name". On the other hand, username sounds more appropriate than name.

Can someone help me make a decision?


You should call it username.

The field name (or user_name if you are prefixing all fields with the table name) is ambiguous because it might be their real name, which is usually different from their username.


username, it's more specific and won't get mixed up with proper human names.

Here's a tip: while you're there, it's a good idea to decide on the proper name columns early - first_name and last_name or surname and given_name or whatever. It doesn't really matter, but it's a right pain when tables are inconsistent.


But you can also try nickname.


Another possible option is login

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜