3 ms·
Fancy algorithms or one liners are not all that difficult to understand, because all the information is right there. It's when you're writing convoluted code in
by ehnto 7y ago
Fancy algorithms or one liners are not all that difficult to understand, because all the information is right there. It's when you're writing convoluted code inside a big system that issues of understanding begin to arise, because the incoming developer is unlikely to have all of the context that made the code make sense to the person who wrote it.
It's hard to write a concise example because it really takes a big application to make the point, but consider:
featureFlag(10, false);
processOrder();
What's flag 10? I have to go figure it out, wastes time, oh turns out it was to disable tax, why are we doing that? Okay in the function that called this one we checked if we were processing a subscription order.
versus
if(order->isSubscription)
processOrderWithoutTax()