You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am forking this issue out of #627 as the discussion on WindowLeftAndRight was diverging from the subject of #627. Below is the quoted discussion thus far.
I was looking for it to improve it ;)
I think a Window(int size, bool extendLeft = false, bool extendRight = false, bool extendBoth = false) overload is missing here.
My proposal is Window(size, extendLeft: true) as an alias for WindowLeft(size), same thing for right. + we have a free WindowLeftAndRight. And all of this can fit in a single implementation.
It facilitate the cases where the choice is made at runtime: Window(size, extendRight: isTailNeed)
We have to discuss the name of the optional extendLeft, extendRight, extendBoth parameters.
Boolean values hinder readability (which can be somewhat offset by naming arguments or, better yet, introducing an enum).
Why do you need three Boolean flags? Isn't extendBoth == extendLeft && extendRight?
WindowLeft, WindowRight and Window are statically searchable names and algorithms (think Find All References).
Dynamic behaviour is rarely needed.
I'm fine with introducing a private method to share the implementation among the three but I am not convinced that needs to be surfaced on the public API.
Activity
atifaziz commentedon Nov 1, 2019
Four things:
enum).extendBoth == extendLeft && extendRight?WindowLeft,WindowRightandWindoware statically searchable names and algorithms (think Find All References).I'm fine with introducing a private method to share the implementation among the three but I am not convinced that needs to be surfaced on the public API.
Orace commentedon Nov 1, 2019
WindowLeftandWindowRightstay the recommended choice for static cases.Window(int size)is preserved.We add possibility for dynamic choice. I do think that the best way to write it is the optional parameters. See :
VS
The
extendBothparameter is a shortcut forAnd is used like that:
atifaziz commentedon Nov 20, 2019
Why? Just for the sake of adding features and richness? Is there a compelling use case that can be demonstrated?
Keep in mind, this project's tagline reads:
Dynamic behaviour is not something that keeps to the spirit of LINQ.