While digging into #24, it took me a long time to understand what was going on in the codebase, and then took me even longer to understand why.
After trying to grok the code for longer than I'd like to admit, I can see that...
This code:
return setThisDescription(concatThis(this, newWrappers), description);
is essentially a different way of doing this:
return new MochaWrapper({
wrappers: newWrappers,
description,
});
And that because of attempts to maintain privacy this...
return someChainableFunction(someOtherChainableFunction(myInstance));
was basically the same as this...
return this.someOtherChainableFunction().someChainableFunction();
My question is... would you be ok with:
- Changing the functional code to be more object oriented (we're passing instance a lot)
- Removing the attempts at maintaining privacy
^ I think that doing these would help to make the code much more approachable.
We could be explicit in that the internal functions/parameters are not part of the api, and will break without breaking changes.
While digging into #24, it took me a long time to understand what was going on in the codebase, and then took me even longer to understand why.
After trying to grok the code for longer than I'd like to admit, I can see that...
This code:
is essentially a different way of doing this:
And that because of attempts to maintain privacy this...
was basically the same as this...
My question is... would you be ok with:
^ I think that doing these would help to make the code much more approachable.
We could be explicit in that the internal functions/parameters are not part of the api, and will break without breaking changes.