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

Rename double_check to both #38

Open
indo-dev-0 opened this issue Dec 18, 2020 · 5 comments
Open

Rename double_check to both #38

indo-dev-0 opened this issue Dec 18, 2020 · 5 comments

Comments

@indo-dev-0
Copy link

invariant is misleading, but double_check is too verbose. After some thought, I think pre/post/both is cleaner and semantically honest.

@ErichDonGubler
Copy link
Owner

I'm open to being persuaded that this change might be worth it, but at this point, I don't see the value of switching to something shorter or "cleaner" justifying a breaking change here. I actually think that double_check does a good job of pointing people's mental models to the purpose of a double_check block -- meanwhile, both seems overall less clear to me.

I'll leave this ticket open for a while to hear a counterargument. However, be warned that I might be a tough person to sell this particular suggestion to -- this feels like bikeshedding to me, and I'd just as soon not spend my spare time doing that.

@indolering
Copy link

I agree that this is bikeshedding, but looks are important if we want to sell this particular bikeshed to Rust core and external projects. I can't justify dropping support for double_check, at least not anytime soon.

Having a shorter keyword for invariant becomes more important when you throw in modifiers to support conditionals (like debug) or distinguishing between runtime and compile time assertions. Consider this match-like syntax:

debug|release assert|expect pre|post|both (y) {
    y - 1 == x => "error message";
}

At that point, one might as well make release, expect, and both defaults that are never used directly. Then "both" would simply serve as a pedagogical tool.

Do you idle on IRC or Matrix? I have some other design ideas I think are worth chatting about : )

@ErichDonGubler
Copy link
Owner

ErichDonGubler commented Mar 25, 2021

@indolering: More than happy to chat on Matrix; my handle is @ErichDonGubler:matrix.org.

Do you happen to be the same user as the one behind the PR OP, incidentally?

@indolering
Copy link

Yup, one is my dev machine and the other is my personal account.

@indolering
Copy link

indolering commented Mar 26, 2021

Matrix (or the UI at least) appears to be case-sensitive, ErichDonGubler:matrix.org wasn't found but erichdongubler:matrix.org exists but is non-responsive. I'm indolering:matrix.org....

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

3 participants