Re:Prefer duplication over the wrong abstraction
by heheehehwiii on Saturday July 09, 2016 @01:42PM
(#12062432)
These types of situations are very common in "view" and "view controller" classes.
Someone tries to DRY a complex view that handles takes in many options and parameters to address several use cases.
A redesign or requirements change happens and now you have an over complicated view class that needs to get deconstructed. Or you can try and build on top of /subclass/extend an over complicated thing. Neither is ideal.
Reading and understanding code is A LOT harder and time consuming than writing new code. So in reality, this view would just get rewritten (duplicated) anyway.
Someone tries to DRY a complex view that handles takes in many options and parameters to address several use cases.
A redesign or requirements change happens and now you have an over complicated view class that needs to get deconstructed. Or you can try and build on top of /subclass/extend an over complicated thing. Neither is ideal.
Reading and understanding code is A LOT harder and time consuming than writing new code. So in reality, this view would just get rewritten (duplicated) anyway.