curiousjude
V2EX  ›  问与答

[命名] 用复数还是用 list?

  •  
  •   curiousjude · Oct 26, 2014 · 8182 views
    This topic created in 4414 days ago, the information mentioned may be changed or developed.
    遇到获取类似列表的数据时,大家命名的时候使用复数形式多呢?还是用list的多呢?
    例如:getStudents 还是 getStudentList?
    7 replies  •  2014-10-26 16:39:09 +08:00
    incompatible
    incompatible
    Oct 26, 2014 via Android
    1
    array用复数 list用list (java
    bitwing
    bitwing
    Oct 26, 2014
    2
    第二个语义更明确吧,Google 搜一下有不少同名接口
    skydiver
    skydiver
    Oct 26, 2014
    3
    有的词复数不是直接加s,这种用List更好
    eriale
    eriale
    Oct 26, 2014
    4
    @skydiver 赞同。有的单词复数跟单数一样,用list可以统一代码。
    liluo
    liluo
    Oct 26, 2014
    5
    统一规范了就好,别两种混用。
    kmvan
    kmvan
    Oct 26, 2014
    6
    这个也是一个值得纠结的问题啊。。。
    例如这样 ul.item-lists > li.item-list
    蛋疼无比
    ffffwh
    ffffwh
    Oct 26, 2014
    7
    x:xs
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1453 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 16:47 · PVG 00:47 · LAX 08:47 · JFK 11:47
    ♥ Do have faith in what you're doing.