Can't `Instant` be named `Timestamp`? The former i...
# kotlinx-datetime
m
Can't
Instant
be named
Timestamp
? The former is so... scientific. Not easy to grasp, esp. for a general purpose programming language.
s
I personally think Instant is better. Timestamp, to me, specifically describes a string with time information. I'm curious what others think about this, though.
e
I debated calling an
Instant
a
Timestamp
in Island Time and using the name
Instant
for an interface that's also shared by
ZonedDateTime
and
OffsetDateTime
. In reality, all three classes describe an instant in time, but in different ways. The purpose of
Instant
is as a timestamp, so I think there's an argument for it. I left it as
Instant
largely because people are familiar with it in java.time.
s
Yeah, I think the fact that a timestamp describes an instant is a pretty good argument in favor of calling it Instant.
e
An instant is a concept and a timestamp is an implementation of that concept. But
Instant
is implemented as a timestamp relative to the Unix epoch, so I think you can definitely argue that just calling it a "timestamp" makes it more clear exactly what is -- if you ignore the precedent set by Joda, java.time, and all the derivative libraries out there anyway.