So, I have a command line utility that collects and presents some time-series data.
What it is isn't important, but dates are involved.
You can specify start dates and/or end dates with options --after and --until. If you specify neither, you get everything.
This programming idea is not so interesting on its own, and I have multiple expressions that all work just fine. It's not a programming puzzle I am here to present.
Instead, I'm curious about which version speaks to you, which teaches you, which repulses you.
More than that, I'm interested in WHY.
Here is an if-the-else version:
Here is a similar version using a dictionary:
Some people will naturally prefer if/else for the simple reason of familiarity. They see a lot of if/then/else logic, and so there isn't much to learn or think about. They may call it "simpler' but it is not.
The dictionary version has more parts, but they're very simple parts, and all the actual work is done in the first and last sentence.
The structural matching is using newer syntax, and is both less verbose than the if/else and more verbose than the dictionary version.
Which strikes you as the most valuable expression of the idea?
Which would you rather write?
Which would you rather edit?
Which would you rather test?
What is your reasoning behind the appeal of your chosen method (pun intended).