What’s in a name? Revision vs Timestamp [closed]

Apparently naming things is one of the hardest things in programming..!

I have a synchronisation implementation which uses timestamps (number of seconds since unix epoch) to sync.

Currently, the timestamps have simply replaced an older revision field. My question is, does it make sense to name it “Revision” or is “Timestamp” better?

Revision makes sense to me since that’s what’s used to version an entity – to know what’s created, updated, deleted. But if I needed to increase the granularity of the revision field in the future (ie. to become a decimal, to include fractions of a second), I wouldn’t be sure that a decimal revision would make sense. On the other hand, perhaps I want to move away from timestamps in the future (ie. to sequence numbers) in which case revision would make sense.

0

Just my opinion, but I would call it timestamp (or more precisely, modification timestamp), not revision.

  1. It is a timestamp, so when it’s named timestamp, someone seeing the field can infer when the file was last changed, whereas when it’s called revision, people might be confused to see a huge number, like 1395653358, when it’s just the first or second revision of the file.

  2. If you want to change the format of the field, e.g. towards using decimal time (fractions of seconds) or a revision count, I would suggest using a different field for that, anyway. Imagine the confusion when the value of the revision field is 1395653358, and then for the next revision it’s 3!

Having said that, the best option might be to create a dedicated class for this. This not only hides the internal representation (which can also be made up of several field, like date of creation and last change, revision count, comment, etc.), but can provide methods for comparing revisions or generating new revision numbers, whatever format is internally used.

1

If it’s simply a time stamp, and that is its only function, then call it a timestamp. If it has a larger purpose (i.e. Revision), then name it that.

Generally, it is better to name things by their function rather than their type. As you yourself pointed out, the type can change over time.

1

Revision implies that the field is updated when the object is changed. Revision does not necessarily imply that the field is a date/time, just that value is bumped each time the object is revised.

Timestamp implies that the field refers to the date/time that something happened. What? That’s not implicitly clear. Last change? Creation? Last time examined? The world can be used to refer to any of these conditions, so often another word is added to indicate what you’re tracking — “Creation Timestamp”, “Modification Timestamp”, etc.

2

Revision to me is a count of how many times the object has been edited, and possibly even with an audit history. A timestamp though is just that, a stamp of he last time changed, often used for concurrency checks. I’d obsolete the old property and create a new one for the timestamp.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật