-
Notifications
You must be signed in to change notification settings - Fork 20
Why the naming #103
Comments
|
Some of the reasons for choosing |
One other reason for retaining the If someone types |
Even with this, the choice of Consider: myArray.with(1, 2); as opposed to myDateTime.with({
minute: 1,
second: 20
}); The latter is more or less self documenting. The former, however, requires somewhat arcane knowledge since This could be fixed with a more expressive method name. Alternatively, more expressive parameters could be used: myArray.with({
index: 1,
value: 2,
}); |
The proposal is shipped in browsers and just achieved stage 4 today; I'm reasonably confident there won't be any changes here. |
I'm torn between"D'oh" and "woohoo"😅 |
This should have had more discussion IMO, so it's a bit disheartening to see that it's already shipping in browsers.
No arguments against TL;DR; I wish this proposal had been more conservative. |
To me, “with” absolutely and only connotes producing a thing that’s a combination of the inputs. A pizza is one thing, a pizza with pepperoni is a new thing produced by combining pizza and pepperoni. i totally agree splice sucks, but toSpliced is objectively less bad because it doesn’t mutate. |
Yep, this was considered a downside to this name. However the "dirty" FWIW, while this particular thread is short. We did spend over a year discussing the names of these methods and with all things considered I think we have ended up with good names. All names that were considered had at least one downside, there are no perfect names unfortunately. |
Could you provide a link to the the year of discussion you mentioned regarding the naming of this method? |
What is the reason by the name
toSpliced()
and not something likeremoveValues()
orreplaceValues()
?And why
with()
and not something likereplaceValue()
?The text was updated successfully, but these errors were encountered: