-
Notifications
You must be signed in to change notification settings - Fork 4
Description
@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,
- Do we keep the current
Joineras a reverser ofDivider, and if yes what would be the best candicate name for a new type like Joiner but variadic string as receiver? - If we refactor the current
Joinerto accept variadic string should we do the same for theDivider? If yes then the output arguments of theDividertype should be[]stringinstead of(string,string)to align the newJoiner
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)!