Closed slodge closed 8 years ago
While I think this makes some sense from the perspective of internal code cleanup, I don't think it makes for a good external-facing API. To me, it doesn't make a whole lot of sense for a Plus
or Minus
method to be called unless you have a value to pass into it, so forcing that onto the caller makes more sense to me. Feel free to reopen if you disagree :smile:
Inspired by Softlion's latest pull - #16 - I've been thinking about optional parameters.
Part of me doesn't really like optional parameters as they don't feel very Fluent....
However, they do help reduce the code size down....
With this in mind, I'm wondering... should
Plus
andMinus
take optional parameters?If they did then we could have:
from https://github.com/slodge/Cirrious.FluentLayout/blob/7f2b8eeae730c5fff281c3bd6af943b8f4ed3734/Cirrious.FluentLayout/FluentLayout.cs#L56
and this would then mean that "advanced" methods could just pass optionals straight through - e.g.:
would become: