1

Is there any convenience in name date-time related columns? created and delivered, … or createdTS, deliveredTS or createdAt, deliveredAt or…

0
1

Chose a name that is unambiguous. created could mean the following things:

  1. "was created yes/no" (a boolean value)
  2. the "object" that was created, maybe the name of it as a string
  3. the datetime when it was created

Probably more. deliveredAt has similar problems. It could be the location where a parcel was delivered at. I really hate these ambiguous naming schemes.

If you just name it createDateTime all ambiguity is gone. The point here is not to add the type to the name. The point is to not leave the name open to interpretation what it means.

5
  • created_on is nice and short. Plus a good tool shows you the name of the column and its datatype so there should be no need to encode the datatype in the name. – Colin 't Hart May 10 '14 at 11:56
  • @Colin'tHart This is not an issue of data types. Adding ...DateTime to the name is not to add the type but to disambiguate. created_on would be better than the other alternatives but it can still mean "created on filegroup", for example, in a table that tracks where indexes were created. createdDateTime does not leave this ambiguity. – usr May 10 '14 at 12:22
  • @Colin'tHart if you end the name with preposition you just have to construct a plausible sentence that can make use of that preposition. Because your name did not say on what. The name is incomplete by construction. – usr May 10 '14 at 12:30
  • 1
    I think this answer and your comments are fantastic. They get to the heart of the matter: 1) at/on suffixes are still ambiguous, and 2) it's not just about datatypes - it's about meaning. – MarredCheese Jul 3 '18 at 21:41
  • @MarredCheese thank you :) I actually love naming things correctly. – usr Jul 4 '18 at 12:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.