Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.

Sign Up

Articles related to "programmer"

Duplication is far cheaper than the wrong abstraction

  • Programmer A replaces the duplication with the new abstraction.
  • A new requirement appears for which the current abstraction is almost perfect.
  • Programmer B feels honor-bound to retain the existing abstraction, but since isn't exactly the same for every case, they alter the code to take a parameter, and then add logic to conditionally do the right thing based on the value of that parameter.
  • Another new requirement arrives.Programmer X.Another additional parameter.Another new conditional.Loop until code becomes incomprehensible.
  • When you appear in this story in step 8 above, this pressure may compel you to proceed forward, that is, to implement the new requirement by changing the existing code.
  • Once they inlined the code, the path forward became obvious, and adding new features become faster and easier.
  • If you find yourself passing parameters and adding conditional paths through shared code, the abstraction is incorrect.

save | comments | report | share on