Hacker News new | ask | show | jobs
by tlonny 651 days ago
Re: the shopping cart example

> This approach is good for now. But, it will limit you later. Your code will quickly get out of control.

Will it? If we need to be able to “delete via X”, it sure feels more maintainable to have this feature supported via an explicit, named method vs. inlining it as an anonymous closure (as recommended by the “balanced” solution).

1 comments

You can add deleteViaX later if you need it in the future. Usually YAGNI though.