stampit-org / stamp-specification

The Stamp Specification: Composables
434 stars 16 forks source link

Proposal: rename or alias `compose()` to `blend()` #115

Closed koresar closed 7 years ago

koresar commented 7 years ago

Proposal: use more accurate and a less confusing word for the compose() function.

The core of this specification is the compose() function. However, it is

Almost every person out there confuses what that compose() function actually is. I have a dozen of examples. As well as many face to face discussions.

What the compose() function actually does is it merges the descriptors using the standardized algorithm. We could rename the function merge() instead. However... We can't use this word. In JavaScript it means object (deep/shallow) merging.

But the word BLEND is unique to software development.

Pros:

Cons:

danielkcz commented 7 years ago

Does it really need to be a breaking change? I mean you can add the alias now and keep good old compose there, maybe even with some deprecation warning if you like. I wouldn't certainly advice to just go over the hoop and change it.

Personally, I don't mind compose and I don't like much blend, but whatever :)

koresar commented 7 years ago

Yeah. Alias looks like a better idea.

ericelliott commented 7 years ago

I think this is a bad idea.

  1. compose() actually does do object composition to produce the descriptors
  2. compose() actually does set up function composition (which is exactly what happens when init functions are applied)
  3. NOBODY has ever expressed confusion about this to me the entire time we've been using compose().
  4. API changes should not be taken lightly -- especially when they're potentially breaking changes.
  5. Aliases suck because people are not sure which name is the "right" name to use. It adds a decision point that doesn't need to be there.

In short, if it ain't broke, don't fix it.

The entire point of stamps is stamp composition, which you're right to describe as distinct from both function and object composition, because it fuses the two -- but calling it something other than composition would be a colossal identity blunder, and would cause a lot more confusion.

See Composing Software: An Introduction.

koresar commented 7 years ago

All valid points. Closing.