-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Logical helpers renaming #714
Comments
Personally, I am 👎 on changing either. It seems fine to have an optional lint rule to forbid |
@chancancode compose - increase template complexity, decrease readability and increase opcodes count. And since we already have this upcodes, I don't think we should offer composition, comparing to update naming |
It's also common to forbid unless altogether. :) Where I work forbids unless, and it is one of the most unanimous lint decisions we've had. Lol |
I confirm that I believe it would be reasonable to update the default linting config to forbid After all, it's a matter of habit. Developers who are in the habit of using it would vote against the proposal. Developers who are not — will vote in favor. Thus, we should ask ourselves the following question: which habit do we want to endorse? We should consider such aspects as size of the vocabulary, mental overhead, level of nesting, opcode complexity. |
However, both of these are fairly subjective. At least for the helper people can make their own, if they want. There is also linting to disable per project. This may be one of those things that are easier to handle at the project level, instead of framework level. |
Btw, we are implementing these as keywords baked into glimmer. In strict mode, these won't be helpers so figuring out our naming will be critical. I'm happy to submit an RFC to rename neq to not-eq. I'll bring this up in our next chat. glimmerjs/glimmer-vm#1277 |
Every time I read an Every time I read an |
I'm closing this due to inactivity. This doesn't mean that the idea presented here is invalid, but that, unfortunately, nobody has taken the effort to spearhead it and bring it to completion. Please feel free to advocate for it if you believe that this is still worth pursuing. Thanks! |
This is draft about renaming
unless
toif-not
and
neq
tonot-eq
Why
not
instead ofunless
?downsides:
{{#unless this.foo}} {{/unless}}
has to be replaced with{{#if (not this.foo) }} {{/if}}
,but, it's bring mutch clarity into logic (IMHO)
one more case - have
if-not
instead ofunless
(more clarity)point is -
unless
wery "rare" word and adding more mental overhead for non-native speakers, also, used 20 times less in the world, comparing toif not
Why
not-eq
instead ofneq
?not-eq
seems more readable for me, comparing toneq
it require less mental parsing, especially for non native speakers and new developers.
Preconditions:
glimmerjs/glimmer-vm#1240 (comment)
Refs:
#560 (comment)
#560 (comment)
cc @rwjblue @pzuraq
The text was updated successfully, but these errors were encountered: