3 ms·
I'd even go so far as to say that "clean" code is a requirement for performance optimization. For a loose definition of clean. Code that is unreadable, tightly
by berkes 4y ago
I'd even go so far as to say that "clean" code is a requirement for performance optimization. For a loose definition of clean.
Code that is unreadable, tightly coupled, untestable or just messy is much, much harder to work in than code that is readable, loosely coupled, well-tested and clean. This has been proven often and is really a no-brainer. Performance-optimizing is finding the bottleneck, then rewriting that without changing the functional behaviour. For this you need resp. readability (to find bottlenecks you must be able to understand flow and code), ability to rewrite (tightly coupled code cannot be rewritten in isolation) and insurance the behaviour doesn't change (test coverage).
Ergo: a clean archictecture is a requirement to make code more performant in the first place. Even if that architecture is bad for performance in itself, it enables future improvements.
- whstl 4y agoI find it funny that people keep throwing non-caps "clean" code here in this post without knowing the context, you now have "clean architecture" too, and it made it more difficult to know what you're talking about. Clean Code is actually a book by Uncle Bob. And Clean Architecture is the name of another book by him. What Casey is criticizing isn't "good code". He's criticizing Uncle Bob's philosophy.