Your skill will accomplishwhat the force of many cannot PerlMonks

### Re^3: DateTime::Span intersection inconsistencies

by jpl (Monk)
 on Jul 02, 2011 at 15:22 UTC ( #912469=note: print w/replies, xml ) Need Help??

The thirteenth hour of the day starts at 12:00 pm and lasts 60 minutes. Is 1:00 pm part of the thirteenth hour? No.

According to you, the module would answer "yes" if it was easier to do so. Ease has nothing to do it. It's simply behaving correctly.

I was addressing the OP's question about why it might make sense to default time intervals to half-open, rather than closed intervals. Your comment tells me that you define a day as a half-open interval, and you choose to make midnight part of the "following day", not part of the "previous day", a decision I would agree with. In my corner of the world, anyway, we wouldn't get universal agreement on that decision, a proof, I suppose, that if you leave a definition (or interface) ill-defined, confusion will ensue.

Where ease comes in is making an interface easy to use correctly, which can be tremendously difficult. From the discussion here, it is quite clear that the interface is not easy to reason about. That would not be fixed by making intervals default to being closed, nor would it be fixed (IMHO) by adding an option to paper over possible confusion by adding "fuzz".

• Comment on Re^3: DateTime::Span intersection inconsistencies

Replies are listed 'Best First'.
Re^4: DateTime::Span intersection inconsistencies
by ikegami (Pope) on Jul 02, 2011 at 17:11 UTC

Your comment tells me that you define a day as a half-open interval, and you choose to make midnight part of the "following day"

No, the parallel of what i said for days would be: if one defines a day to be 24 hours that starts at midnight, then midnight would be part of the following day.

The people to which you refer define "day" differently, a period of time that starts at midnight and ends at the next midnight.

I was addressing the OP's question

I know you were trying to answer why it's "open by default" as the OP claimed in his question. The problem is that your answer accepted the premise of a default when there isn't one.

I agree about you about the ease of defining span as [...), but it's not the reason for some non-existing default.

Create A New User
Node Status?
node history
Node Type: note [id://912469]
help
Chatterbox?
 [Corion]: Hi choroba! Yeah, I brought the rain with me from Hamburg [Corion]: marto: As am I ;) And we got two interested locations for next year, Munich and Cologne maybe, which is great as well. Not Berlin though ;) [marto]: damn [choroba]: Munich is kind of close from here [Corion]: marto: Maybe in three years it'll be Berlin again ;) [marto]: in 3 years I may be able to go :P [Corion]: choroba: Both teams will ponder on whether/where/how to organize things. The workshop will be mainly in German though [Corion]: marto: Hehe ;) [marto]: my out of working hours time is very scarce at the moment

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-06-29 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
How many monitors do you use while coding?

Results (655 votes). Check out past polls.