-
Notifications
You must be signed in to change notification settings - Fork 5
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
Concern with terms "select" and "reject" #6
Comments
I agree that Though "overloading" is inevitable in many cases (for example, MM mentioned |
My main point is that if a primary motivator of this proposal is to reduce developer confusion, then a requirement should be that whatever names are chosen do not introduce additional confusion. |
Do either of you have an objection to |
Too long. |
|
I think I'd also like |
Personally I feel
|
Just find Kotlin have |
The word Okay, if we do want to suggest better names, I'd vote for There is indeed no need to have an opposite method, people can negate values with the original one, cannot they? |
The committee has rejected adding an alias. We'll only get new functions, if anything.
I think the data shows people want to use an inverse. Additionally, this kind of reasoning would prevent us from getting basically any new APIs. Why have |
One concern I have is that "filter out" feels like an English-specific idiom that won't translate well into other languages.
|
Yes, I agree that's a concern. It'd probably be good to get input from a non-native English speaker.
I would really like to keep the My only issue with So I'd like to limit it to any "XYZ" that implies removal. |
Trying to find an opposed or inverse term for the verb 'to filter' feels like the wrong approach. This proposal seems to want a method that filters (verb), but with the negation or inverse of the specified filter (noun). This is confusing because the name A filter doesn't actively select, reject, keep, or discard items. A filter is more passive than those terms imply. When actively filtering (verb) one or more items, each item either passes through the filter (noun) or doesn't. The Perhaps what I've stated is obvious to everyone, or alternatively it may be debatable, and please accept my apologies if anyone finds it contentious. But I think it suggests lucid documentation, written for a general audience, with diagrams and perhaps animations — and in terms of It might be useful to have a method that evaluates to the negation of a boolean-valued function var odd = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].filter( Function.negation( n => n % 2 === 0 ) ); It occurs to me that The terms |
I'd like to suggest adding an alias for Array.filter called Array.keep. I agree with the problem of using "reject" to invert Array.filter. I want to suggest Array.remove. Since |
select
While there are some languages where term
select
is synonymous with ECMAScript'sfilter
(i.e. Ruby), there are other languages where the termselect
is synonymous with ECMAScript'smap
:select
clauseEnumerable.Select
Enumerable.SelectMany
SELECT
As a heavy user of both C# and T-SQL (a SQL-92 derivative), I would find the term confusing. In the languages above, as well as other languages such as XQuery, the term
where
is often synonymous with ECMAScript'sfilter
instead.reject
I find the use of
reject
here a possible source of confusion as the term is overloaded withPromise.reject
.While I don't necessary find the use case for an alias of
filter
compelling, if we did choose to add an alias then I might suggest some less ambiguous terms such aswhere
/whereNot
orwhere/exceptWhere
for these two member names.The text was updated successfully, but these errors were encountered: