在Java的属性名称中,哪个名称更正确?

发布于 2024-10-10 23:42:16 字数 147 浏览 4 评论 0原文

在Java的属性名称中,哪个名称更正确?

  1. createDatecreationDatecreatedDate
  2. 请告诉我一个更好的表达方式
  3. 其他

,因为,我是日本人

In Java's property name, which name is more correct ?

  1. createDate
  2. creationDate
  3. createdDate
  4. others

Please tell me a better expression, because, I'm Japanese.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

拥有 2024-10-17 23:42:16

虽然英语也不是我的母语,但我相信creationDate更好,因为它意味着这是创建某物的日期。

createDate 是无关紧要的,因为它是命令:嘿,伙计,创建日期!
createdDate 指的是日期本身,而不是创建其他内容的日期。

我希望它有帮助。

Although English is not my mother tongue too I believe that creationDate is better because it means that this is the date when something was created.

createDate is irrelevant because it is command: Hey, man, create date!
createdDate is speaking about the date itself and not about the date when something else was created.

I hope it helps.

飘逸的'云 2024-10-17 23:42:16

刚刚“创建”,从类型中可以看到它的日期

just 'created', it's visible it's date from the type

快乐很简单 2024-10-17 23:42:16

如果它是属性名称,我个人会选择creationDate。如果它是创建日期的方法,则 createDate 会更合适。

I would personally go for creationDate if it's a property name. If it's a method which creates a date, createDate would be more appropriate.

时光清浅 2024-10-17 23:42:16

我想要creationDate (= 作成日)

I would like creationDate (= 作成日)

时常饿 2024-10-17 23:42:16

这取决于用途。如果它在创建某些内容时保存了某个日期,那么

creationDate 会很好

it depends on the usage. if it is holding some date when something gets created then

creationDate would be good

一指流沙 2024-10-17 23:42:16

这就是我使用所有三个名称的方式:(

String creationDate = "2011-01-01";
boolean createdDate = createDate(creationDate);

老实说:我宁愿将布尔变量命名为 hasCreatedDate 但这非常接近)

This is how I would use all three names:

String creationDate = "2011-01-01";
boolean createdDate = createDate(creationDate);

(Honestly: I'd rather name the boolean variable hasCreatedDate but that's pretty close)

我的黑色迷你裙 2024-10-17 23:42:16

恕我直言,“创造”比“创造”更正式。第一个意味着官方或计划的创造,而创造是指过去实际发生的情况。

createdDate 是过去时态,暗示这是已经发生的事情。这是我所期望看到的。例如,如果您在 Windows 中查看文件的属性,它将为您提供“创建”、“修改”和“访问”的日期/时间

创建日期意味着可能是将来的计划日期。例如,factory.setCreationDate("2012-01-01") 它也可能是计划或正式的创建日期,但不是实际创建日期(由于相同的延迟)

createDate 是一个操作,意味着您想要创建一个新的日期对象。

替代方案可能是

  • dateCreated();
  • 创建日期();
  • 创建于();

IMHO "creation" is more formal than "created". The first implies an official or planned creation, whereas created is when it actaully happened in the past.

createdDate is past tense and implies this is something which has happened. This is what I would expect to see. e.g. if you look at the properties for a file in Windows, it will give you the date/time for "Created", "Modified" and "Accessed"

creationDate implies a planned date which could be in the future. e.g. factory.setCreationDate("2012-01-01") It could also be the planned or offical creation date but is not the actual date it was created (due to same delay)

createDate is an action which implies you want to create a new date object.

Alternatives might be

  • dateCreated();
  • dateOfCreation();
  • createdOn();
ゃ人海孤独症 2024-10-17 23:42:16

我自己会选择(并且已经选择了)“createDate”。

I would go for (and have gone for) "createDate" myself.

无名指的心愿 2024-10-17 23:42:16

createDate - 这反映了我们是否正在创建一个日期,或者正如某人已经提到的那样,它听起来更像是一个方法名称。所以这个应该被丢弃。

creationDate - 在我看来这是一个合适的日期。它清楚地反映了特定事物的创建日期。

createdDate - 也可以使用它,但我建议以不同的格式使用它,例如
创建于或创建者

createDate - This reflects if we are creating a Date or as already mentioned by someone it sounds more like a method name. So this should be discarded.

creationDate - This appears to me as an appropriate one. It is clearly reflecting the date on which a particular thing is created.

createdDate - This could also be used, but I would suggest use it in a different format like
createdOn or createdBy

撩人痒 2024-10-17 23:42:16

我也不是本地人,但我个人更喜欢像 dateOfCreation 这样的东西来让事情完全清楚。

I'm no native too, but personally I would prefer something like dateOfCreation to make things totally clear.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文