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
Currently, a user can create an Area based on a shape by doing new Area(Shapes.GetCircle((1, 2), 3)). While this works, it isn't obvious that users would need to look in the Shapes class to create an area based on that shape, so some forwarding functions might be nice here.
One possible downside, though, is it might promote inefficient code. Consider if a user has a function which takes an IEnumerable<Point>, and does this: MyFunc(Area.FromCircle((1, 2), 3). This negates the benefits of the custom enumerator and lazy evaluation you get with Shapes.GetCircle() and causes quite a large amount of temporary allocation.
The text was updated successfully, but these errors were encountered:
Currently, a user can create an
Area
based on a shape by doingnew Area(Shapes.GetCircle((1, 2), 3))
. While this works, it isn't obvious that users would need to look in theShapes
class to create an area based on that shape, so some forwarding functions might be nice here.One possible downside, though, is it might promote inefficient code. Consider if a user has a function which takes an
IEnumerable<Point>
, and does this:MyFunc(Area.FromCircle((1, 2), 3)
. This negates the benefits of the custom enumerator and lazy evaluation you get withShapes.GetCircle()
and causes quite a large amount of temporary allocation.The text was updated successfully, but these errors were encountered: