Skip to content

About Joiner and discussion about proposal of a new type, alternative to existing Joiner. #4

@esemplastic

Description

@esemplastic

@lanzafame I did create a new issue to discuss those things we were unsure from our previous conversation, inside the PR. All users can watch and participate to this discussion now, or later on.

Please, read the previous two comments on this subject, here, before continue.


It's good, I am not saying the opossite, you did a great choice, I'm unsure about the Joiner at general. I understand the point of yours now and how current Joiner works for you.

I will just add my thoughts when I did create that empty interface on the beginning: the Joiner is the Divider's opossite operation/reverser , that was the reason we had a Joiner interface at the first place, to be able to do reverse operators with the UNIS model too.
The example of a PathJoiner cannot be fully adressed by a Joiner, because Joiner takes only two string receivers, while a path can have many parts that you may want to join with a slash separator.

I think things like PathJoiner is a good example for a new need of type. A type of PathJoiner implementation would be better to accept an array of strings or a varadiac parts ...string rather than two strings part1 string, part2 string in order to add any number of values of parts there and return them as one (this is easy as you can imagine but it's not allign with the current Joiner /Divider reverser's outline).

To sum up,

  1. Do we keep the current Joiner as a reverser of Divider , and if yes what would be the best candicate name for a new type like Joiner but variadic string as receiver?
  2. If we refactor the current Joiner to accept variadic string should we do the same for the Divider? If yes then the output arguments of the Divider type should be []string instead of (string,string) to align the new Joiner

Let's start a good discussion about the cons and props of a new type or overriding the existing with some changes on Divider too (it's not late, it's a new project)!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions