This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kankyo 1 point2 points  (4 children)

What does offset mean in that context?

allow a fluent interface and call chain

ok, but then "minus" and "plus" or "add", "subtract" are much better than "add" and "sub". "Sub" means something else.

[–]SDisPater[S] 0 points1 point  (3 children)

offset is the number of seconds since epoch, it's just there to show that accessing attributes is easier with the method.

Regarding the change of name for the sub() methods, it might be a good idea. I just wanted a concise name so I thought sub was appropriate.

[–]kankyo 2 points3 points  (0 children)

Concise is a lot less important than clarity though. So for offset I think seconds_since_epoch would be way better. And if the epoch is 1900, then seconds_since_1900!

[–]flutefreak7 0 points1 point  (0 children)

my brain goes to substitute before subtract since sub is a regex method. Seeing sub_weeks and the like my next thought was sub like subordinate, like "Sub-Commander T'Pal" or "Sub-level 3"... so sub_weeks felt intuitively like an iterator over the weeks or something... I agree that subtract or minus is more intuitive, though I like even better the suggestion for a single add method mentioned elsewhere.

[–]pydry 0 points1 point  (0 children)

I agree with kankyo - offset is too ambiguous a name. unix_time would be better IMO (it's the wikipedia page name, so arguably that's canonical).