fundamental design issues with trips and dives

Dirk Hohndel dirk at hohndel.org
Thu Nov 7 09:46:18 PST 2019


> On Nov 7, 2019, at 9:40 AM, Linus Torvalds <torvalds at linux-foundation.org> wrote:
> 
> On Thu, Nov 7, 2019 at 9:17 AM Dirk Hohndel <dirk at hohndel.org> wrote:
>> 
>> (4) ??? other ideas?
> 
> Stop thinking that dates have anything to do with dive trips.
> 
> A dive is in a trip. A trip is just a container. The date is
> completely and utterly irrelevant, and has nothing to do with what
> trip a dive is.
> 
> The *only* thing the date is used for trip-wise is the initial
> heuristic of which trip to put a dive in (or whether to create a new
> trip). Nothing else.
> 
> Anything that believes that trips are anything but collections of
> random dives is fundamentally broken.

I like the thinking here. Radically simple. It does, however, breaks a lot of assumptions in our code, but I'm willing to deal with that in favor of something that's logical and consistent.
Let me poke at this for a moment, though.
We keep the dive_table.dives[] array sorted by date. Is that a mistake?
Or is this the right thing to do and we just need to think of trips as the UI layer on top and have the UI code figure out how to get the trips and dives sorted, even if that doesn't match the order in the dive_table?
Or am I still missing the point?

/D




More information about the subsurface mailing list