In the Java property name, which name is more correct?

In the Java property name, which name is more correct?

  • createDate
  • Creationdate
  • createdDate
  • other

Please say the best expression, because I'm Japanese.

+7
source share
10 answers

Although English is also not my native language, I believe createDate is better because it means that this is the date that something was created.

createDate doesn't matter because it's a command: hey man, create a date! createdDate talks about the date itself, not the date the createdDate created.

Hope this helps.

+10
source

I would personally go for creationDate if that is a property name. If this is the method that creates the date, createDate will be more appropriate.

+2
source

just 'created', it sees that the date is of type

+2
source

it depends on the use. if he holds a certain date when something is created, then

creationDate will be good

+1
source

I would like to createDate (= 作成 日)

+1
source

This is how I will use all three names:

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

(Honestly: I would rather name the boolean variable hasCreatedDate , but it's pretty close)

+1
source

IMHO "creation" is more formal than "created". The first involves formal or planned creation, while it is created when it was active in the past.

createdDate is the past tense and implies that this is what happened. This is what I expected to see. for example, if you look at the properties of a file on Windows, it will give you a date / time for Created, Modified, and Available

creationDate implies a planned date, which may be in the future. for example factory.setCreationDate ("2012-01-01") It may also be a planned or official creation date, but is not the actual creation date (due to the same delay)

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

Alternatives may be

  • dateCreated ();
  • dateOfCreation ();
  • createdOn ();
+1
source

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

0
source

I'm also not native, but personally, I would prefer something like dateOfCreation so that everything is clear.

0
source

createDate - this reflects if we create a date or as already mentioned by someone, it looks more like a method name. Therefore it must be discarded.

creationDate - It seems to me suitable. This clearly reflects the date when a certain thing is created.

createdDate - this can also be used, but I would suggest using it in a different format, for example createdOn or createdBy

0
source

All Articles