Hacker News new | ask | show | jobs
by pechay 1001 days ago
I don't like the side effects of the second addToppings. I'd much prefer

pizza.Toppings = getToppings(kind string)

1 comments

> pizza.Toppings = getToppings(kind string)

That's a side effect.

pizza isn't, and can't be, opaquely modified by the topping adder this way.