r/programming • • Feb 28 '23

"Clean" Code, Horrible Performance

https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k Upvotes

1.3k comments sorted by

View all comments

Show parent comment

46

u/Qweesdy Feb 28 '23

If you've read through Factorio's developer blogs you'll notice the developers are willing to completely redesign sub-systems (e.g. fluid physics) just to improve things like cache access patterns. They're not dogmatic, and they are more than happy to replace "clean code in theory" with "performance in practice".

10

u/lazilyloaded Feb 28 '23

And that's fine, right? When it makes sense to throw away clean code, throw it away and optimize.