在Java的属性名称中,哪个名称更正确?
在Java的属性名称中,哪个名称更正确?
- createDatecreationDatecreatedDate
- 请告诉我一个更好的表达方式
- 。
- 其他
,因为,我是日本人
In Java's property name, which name is more correct ?
- createDate
- creationDate
- createdDate
- others
Please tell me a better expression, because, I'm Japanese.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
虽然英语也不是我的母语,但我相信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.
刚刚“创建”,从类型中可以看到它的日期
just 'created', it's visible it's date from the type
如果它是属性名称,我个人会选择
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.我想要creationDate (= 作成日)
I would like creationDate (= 作成日)
这取决于用途。如果它在创建某些内容时保存了某个日期,那么
creationDate
会很好it depends on the usage. if it is holding some date when something gets created then
creationDate
would be good这就是我使用所有三个名称的方式:(
老实说:我宁愿将布尔变量命名为
hasCreatedDate
但这非常接近)This is how I would use all three names:
(Honestly: I'd rather name the boolean variable
hasCreatedDate
but that's pretty close)恕我直言,“创造”比“创造”更正式。第一个意味着官方或计划的创造,而创造是指过去实际发生的情况。
createdDate 是过去时态,暗示这是已经发生的事情。这是我所期望看到的。例如,如果您在 Windows 中查看文件的属性,它将为您提供“创建”、“修改”和“访问”的日期/时间
创建日期意味着可能是将来的计划日期。例如,factory.setCreationDate("2012-01-01") 它也可能是计划或正式的创建日期,但不是实际创建日期(由于相同的延迟)
createDate 是一个操作,意味着您想要创建一个新的日期对象。
替代方案可能是
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
我自己会选择(并且已经选择了)“createDate”。
I would go for (and have gone for) "createDate" myself.
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
我也不是本地人,但我个人更喜欢像
dateOfCreation
这样的东西来让事情完全清楚。I'm no native too, but personally I would prefer something like
dateOfCreation
to make things totally clear.