Comments (16)
I still have mixed feelings about having persistent IDs. I see one disadvantage (that in my case most IDs are guaranteed to have more than one digit), but no advantages.
from todoman.
Advantages are that concurrent operations won't change the IDs, which, IMHO, adds a bit of safety:
- In terminal A run
todo
, walk away. - Open terminal B, run
todo
, close it. - Some time later, notice terminal A still there, and do something like
todo done 3
based on what you see on-screen.
It might be a bit uncommon, but I kinda like the determinism this adds.
from todoman.
That is fair enough.
from todoman.
I'm still willing to discuss it, but I honestly, I generally favour determinism.
from todoman.
An easy fix that wouldn't change the nice cache validation flow we have (first expire, then reinsert) would be to directly derive the ID from the UID.
from todoman.
I don't think we can derive collision-resistant IDs from UIs due to the amount of digits. Consider that we'd need a two/three digit output for every UID that does not collide (think of it as a hash function).
from todoman.
We could throw in lowercase letters into the mix since those are easy to type as well.
Other options would require updating the cache in-place during validation which is somewhat complicated.
from todoman.
With letters + numbers (35 symbols), and 80 todos in the db, we'd have a 92% change of collision with two digits, and 7% with three digits. With both lowercase and uppercase letters, this goes down to 1% and 0.5% respectively.
These number are a bit high, because a single collision would make todo
fail.
I'm also not convinced that the case-insensitivity of the ids will be obvious.
To get a better understaning though, what causes the dislike for persistent ids? Maybe there's an alternate solution to it it.
from todoman.
I dislike persistent IDs precisely because they fill up the space of possible IDs so much. I usually have a few open tasks where most tasks usually have a single-digit ID. With the new behavior, the tasks that I don't care about (done tasks) and will never address by ID again are assigned a low-digit ID.
from todoman.
Ah, I understand, that's really a really valid concern. Let me think if there's another solution. I take it that todo flush
is not something you're fond of.
from todoman.
I consider todo flush
to be a performance workaround but it works.
from todoman.
How would you feel about an autoflush
setting to auto-delete done
tasks? Or do you prefer to keep them around?
from todoman.
I personally have no use for them after I'm done, but we shouldn't assume that the avg user feels about that the same way.
from todoman.
Right, I meant, autoflush
with default=False
.
If this sounds okay to you, I'll prepare a PR, but if you actually want to keep them around, we can go back to brainstorming.
from todoman.
Since flush also wipes the cache I imagine that this slows down everything a lot.
from todoman.
It does. π
Back to the drawing board it is!
from todoman.
Related Issues (20)
- Docs are filing to build on readthedocs HOT 1
- Docs are filing to build on readthedocs HOT 1
- Navigating tasks with vim keys HOT 6
- todoman 4.3.0 not on pypi HOT 4
- 4.3.0: test_ctrl_c_clears fails HOT 3
- Click repl doesn't show up HOT 2
- categories with diacritics not handled well HOT 5
- Subcommand to get current configuration parameters HOT 1
- Can't run v4.3.2 on Slackware64-15.0 HOT 2
- Please release 4.4.0 at PyPi HOT 2
- Tasks template && time tracking HOT 1
- Flags in config file donβt apply to default commands HOT 1
- crash when creating new todo and reading description from stdin HOT 2
- Show one-line summaries when deleting multiple items
- Remember latest creation
- `todo categories` should show all categories
- Rethink flushing
- Exclude fields in list command HOT 1
- Feature request: Any plans on adding recurring tasks? HOT 2
- Allow specifying default sort method in config file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from todoman.