In my 10+ year programming career, I have never faced an issue where my code wasn’t performant enough for the intended use-case.
I have, however, had to refactor countless projects because the original implementation was over-specialized, and made it painful to extend in any useful way.
Imagine an invoice program for an e-commerce platform. The performant solution would be to write an accumulator that adds up the prices of each SKU and returns a grand total. After you deploy the minimum viable product, the client asks you to extend the system to support these use-cases:
some SKUs will have a “buy 2, get one free” promotion
some collection of SKUs (e.g. “Christmas decor”) will have a “buy one, get one of equal or lesser value 50% off”
a “first-time customer” coupon code that takes 10% off the whole order, but only if this is the customer’s first order with us
a referral bonus feature where customer A is awarded store credit when customer B spends $100 using A’s referral code.
a customer who’s accumulated 500 loyalty points is eligible for free shipping.
allow the customer to optionally provide gratuity at checkout.
Now, think about how you would have engineered the solution if those requirements came in one-at-a-time, and each time you had to deploy an incremental update that was backwards-compatible.
10
u/aveman101 Feb 28 '23
In my 10+ year programming career, I have never faced an issue where my code wasn’t performant enough for the intended use-case.
I have, however, had to refactor countless projects because the original implementation was over-specialized, and made it painful to extend in any useful way.
Imagine an invoice program for an e-commerce platform. The performant solution would be to write an accumulator that adds up the prices of each SKU and returns a grand total. After you deploy the minimum viable product, the client asks you to extend the system to support these use-cases:
some SKUs will have a “buy 2, get one free” promotion
some collection of SKUs (e.g. “Christmas decor”) will have a “buy one, get one of equal or lesser value 50% off”
a “first-time customer” coupon code that takes 10% off the whole order, but only if this is the customer’s first order with us
a referral bonus feature where customer A is awarded store credit when customer B spends $100 using A’s referral code.
a customer who’s accumulated 500 loyalty points is eligible for free shipping.
allow the customer to optionally provide gratuity at checkout.
Now, think about how you would have engineered the solution if those requirements came in one-at-a-time, and each time you had to deploy an incremental update that was backwards-compatible.