Re:Cognitive Biases in Software Development
by tartoran on Tuesday March 31, 2020 @02:19AM
(#22735310)
Rewriting an ugly API could be problematic if not rewritten while fresh. Once it starts being refed everywhere good luck.. I bet there are no test cases either and the task becomes daunting and expensive
I think we should maybe aspire to find a frame of reference for evaluating when to change and not.
During development, I find iteration can be useful, i.e. when you have code that's 'hot in your mind' and can be re-worked.
Another key that the article doesn't seem to reference is encapsulation. It's one of the most golden concerns in software.
If 'ugly' is confined to a single function and doesn't leak outside - then it's almost pointless to re-write it.
On the other end of the spectrum, if an API is 'ugly' it leaks all around the code inside and out. Re-write is more expensive, but could possibly be more worth it.