0

getUserId 还是 getUserID?

 1 year ago
source link: https://www.v2ex.com/t/910246
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  问与答

getUserId 还是 getUserID?

  lowsell · 54 分钟前 · 399 次点击
类似的 getXxxURL 还是 getXxxUrl不确定应该用哪种,大家呢
8 条回复    2023-01-22 13:49:49 +08:00
nexo

nexo      52 分钟前 via Android

ID URL
pdog18

pdog18      50 分钟前

似乎 ID 是合理的
iseki

iseki      48 分钟前 via Android   ❤️ 1

少于三个字母我选 ID ,三个字母开始我宁可 Url
SuperMild

SuperMild      46 分钟前   ❤️ 1

最标准的是 Id ,URL ,但实际操作没必要太计较。
pupboss

pupboss      42 分钟前

Id 是一个单词 identity 的缩写,url 是 uniform resource locator 缩写,4 楼说的就是标准答案了
hahadaxigua834

hahadaxigua834      37 分钟前

Words in names that are initialisms or acronyms (e.g., URL and NATO) should have the same case. URL should appear as URL or url (as in urlPony, or URLPony), never as Url. This also applies to ID when it is short for “identifier”; write appID instead of appId.

https://google.github.io/styleguide/go/decisions#variable-names
hst001

hst001      27 分钟前

ID 和 URL 都是缩写,通常情况下要么全大写要么全小写
gowl

gowl      15 分钟前

按微软的命名规则的话是 ID 和 Url 。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK