3 ms·
There's something deeply unnerving about ugly code, I don't think we can just say 'well it works'. I think we should maybe aspire to find a frame of reference
by jariel 7y ago
There's something deeply unnerving about ugly code, I don't think we can just say 'well it works'.
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.
- tartoran 7y agoRewriting 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
- jariel 7y agoYes, that's the thing. Exactly. APIs are by definition leaky. Look at Python v2 v3 debacle. So it has to be really well planned, even then possibly not worth it.