Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
pechay
· 3y ago · 0 comments
I don't like the side effects of the second addToppings. I'd much prefer
pizza.Toppings = getToppings(kind string)
Comments
[–]
mrkeen
3y ago
> pizza.Toppings = getToppings(kind string)
That's a side effect.
[–]
pechay
OP
3y ago
pizza isn't, and can't be, opaquely modified by the topping adder this way.