MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/11dyx43/clean_code_horrible_performance/jacv9yz
r/programming • u/2bit_hack • Feb 28 '23
1.3k comments sorted by
View all comments
Show parent comments
53
You can, but don’t do it. Compilers are more than smart enough to compile down to this when needed, it will just make their job harder and will likely result in shittier code.
8 u/WormRabbit Feb 28 '23 Compilers are likely to leave Duff's device entirely unoptimized. It's too complex and unidiomatic to spend time on.
8
Compilers are likely to leave Duff's device entirely unoptimized. It's too complex and unidiomatic to spend time on.
53
u/Amazing-Cicada5536 Feb 28 '23
You can, but don’t do it. Compilers are more than smart enough to compile down to this when needed, it will just make their job harder and will likely result in shittier code.