-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce the API's cognitive load #12
Comments
I can see this being improved in a mixture of two ways
|
@epage thanks for opening up all these great issues! There are really only two groups of types: Note: I am the author of Path TypesFirst of all, there is the stdlib After that there are the following:
There is serious overlap between File TypesThe following file types are exposed to the user:
Honestly file types are one of my big annoynances. The Possible Improvement path: file/dir modulesI think it is worth mentioning that the Path types have way too many methods IMO. I would like to maybe have a ConclusionPart of the reason there are "so many types" is because the operations you can do on the file system are so varied. When you The type system prevents programmer error when using methods and I think that is well worth the expanded API. |
So I mostly agree with your second point, which is to improve the docs to "tell the story better." This brings up another point: where do these docs live? I see the |
I think its reasonable for the crate-wide doc string to tell a brief story but I do agree that there will need to be docs outside of that. This again fits into my idea of there being an |
From your brief description, I can't really tell the difference in purpose
They all seem to fulfill the same purpose. What is your goal with having distinct Maybe its just me, but with
|
While this might be annoying from the implementation, but should this just be a different factory on the other How well can I pass |
All of the path types (except
The goal of
Agh, these are issues! I opened #14
I don't think so -- it has to have ownership to handle dropping correctly.
Well, |
Unlike |
An alternative to always-canonicalized is #10 |
Right now the API is meant to be both easy to use and (I assume) enforcing invariants in types (like ensuring a file is a file and not a dir before reading it). The challenge is that there are a lot of types for the user to deal with and its hard to see where one can get started.
The text was updated successfully, but these errors were encountered: