3 ms·
Yes and no. You need the right balance and the ability to make the right choices. As in for everything. If you are implementing something trivial, duplication
by jokethrowaway 3y ago
Yes and no. You need the right balance and the ability to make the right choices. As in for everything.
If you are implementing something trivial, duplication is often the right choice.
I've worked on complex frontend applications (including graphic editors, social networks) and never got to a point where duplication hindered my understanding of the codebase.
The problem I've seen (compounded by React zealots, incidentally!) is abstraction bloat. Think flux and redux - and boy, that complicates the codebase massively.
Once we started using React + Redux, our time to production dropped massively, but we blamed it on the new tech and we were "cargo culting" hard. This has improved nowadays as we don't use Redux anymore but we're still producing very large and complex application for the set of features we have.
On the other side, I worked on complex backend business logic where people didn't even know what clean code is (think massive payment system) and it was a complete nightmare to try to understand what was going on. When everything you read is incredibly detailed, you can't keep everything in your head, you need to group it conceptually. You can do it in code, or in your head.
It's the same reason Go was criticised for not having Generics: without abstraction you'll turn a 100 lines app into 500, making it way harder to follow and fit into your memory (and I'm not talking about RAM).
The other issue in the clean code debate is that what's understandable changes from person to person, depending on coding and reasoning capability.