Skip to content
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

Wondering about aligning some naming choices more towards std #56

Closed
ratmice opened this issue Apr 20, 2022 · 6 comments
Closed

Wondering about aligning some naming choices more towards std #56

ratmice opened this issue Apr 20, 2022 · 6 comments

Comments

@ratmice
Copy link
Contributor

ratmice commented Apr 20, 2022

This is just something I was wondering about, having used im on a number of projects,
Sometimes there is just minor differences of naming between im and the std::collections.

for instance in im difference in HashSet, and OrdSet is an alias for symmetric_difference, while in std
difference is equivalent to the im function relative_complement.

I'm not sure how I would go about aligning more closely in this case, probably deprecate, difference, remove it. then after a period of time introduce a feature to enable a difference alias for relative complement.

I figured it was at least worth considering, if only to gauge reaction, but definitely feel free to close if compat is considered more important.

@jneem
Copy link
Owner

jneem commented Apr 20, 2022

Thanks for bringing this up! I think the scariest thing is silently unexpected behavior, so I'm not thrilled about having our difference be different from std's. Deprecating difference sounds like a good first step (and if I'm not mistaken it doesn't even require a semver bump, right?)

I'm less convinced about re-enabling difference with the std meaning though. I mean, not having a difference function to match std is a bit of a wart, but requiring a feature in order to get the new name is also a bit of a wart, so is it worth it?

@ratmice
Copy link
Contributor Author

ratmice commented Apr 20, 2022

That is a good point and should be less worrysome than reintroducing it.

At the time I was writing that I was search/replacing types to test between std and imbl to get an idea of the performance profile of a particular usage of a data structure, so that why I was thinking it'd be nice to be able to reintroduce it.
as it would make switching between the implementations easier.

But I would be just as pleased with this search/replace not actually being a foot-gun, as if search/replace would just "work".

@ratmice
Copy link
Contributor Author

ratmice commented Apr 20, 2022

FWIW, I'll have a go at a PR for this and do some documentation reading to see if I notice anything else.
I'll post the patch, but think it'd be good to wait a bit before merging it for either feedback or perhaps others know of more overlap.

@jneem
Copy link
Owner

jneem commented Apr 21, 2022

At the time I was writing that I was search/replacing types to test between std and imbl to get an idea of the performance profile of a particular usage of a data structure, so that why I was thinking it'd be nice to be able to reintroduce it.
as it would make switching between the implementations easier.

Oh, that's definitely an interesting use-case that I hadn't considered. I guess macros are also a reason for having the same names.

@ratmice
Copy link
Contributor Author

ratmice commented Apr 21, 2022

FWIW, I did read through the documentation and nothing else really jumped out at me.

@ratmice
Copy link
Contributor Author

ratmice commented May 1, 2022

Think this can probably be closed now.

@ratmice ratmice closed this as completed May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants