2 ms·
I'm not so sure about converting if (customersFirstOrder) { // Apply free shipping orderCost = orderCost - shipping; } to if (cust
by thiht 6y ago
I'm not so sure about converting
if (customersFirstOrder) {
// Apply free shipping
orderCost = orderCost - shipping;
}
to
if (customersFirstOrder) {
ApplyFreeShipping();
}
Does `ApplyFreeShipping` work on global state? How do we test it? At the very least it should be something like:
orderCost = ApplyFreeShipping(orderCost, shipping);
which has advantages over the first version but is not necessarily better. The suggested version is just awful though.