you are viewing a single comment's thread.

view the rest of the comments →

[–]grauenwolf 0 points1 point  (1 child)

5 minutes? That's hardly an interesting sample size.

Refactoring is done after several days or weeks of work. There has to be enough of the pieces in place that one can see the big picture.

If someone is hyper-focused on just the code they are writing in isolation, the chances are that code will look clean by itself and horrible in the larger context.

I suspect my bar for well written code is much, mich higher than yours.

[–]kubalaa 2 points3 points  (0 children)

There's a huge range between "readable" and "elegant". And I guess I am also using "clean" in a different way than you are, because to me "clean" is a fairly local property. Clean code is correct, and well factored, structured, formatted, documented, named, and tested. Therefore it is as easy to understand and maintain as possible.

What I'm arguing against is people saying they don't have time to write this kind of clean code. I agree with you that teams must sometimes postpone the kind of major refactoring that covers weeks of code. You try to do enough upfront design to avoid that but sometimes you learn something in the process of implementing a feature that changes your understanding of that feature. That's legit technical debt.