News for hackers. Stuff that matters.
Re:Cognitive Biases in Software Development by jariel on Tuesday March 31, 2020 @12:37AM (#22734969)
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.

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
Re:Cognitive Biases in Software Development by jariel on Tuesday March 31, 2020 @01:46PM (#22740214)
Yes, 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.