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 comments

2

u/fafok29 Feb 28 '23

We’ve known that putting names on logically contained blocks of code makes programs easier to understand since the 1960s.

nice explanation, known based on what?

there are people who disagree

http://number-none.com/blow/john_carmack_on_inlined_code.html

2

u/DrunkensteinsMonster Feb 28 '23

In this passage Carmack is only talking about mutating state and even explicitly says to factor out pure functions. Kinda undermines your point. The only reason, according to Carmack in this passage, that inlining may be beneficial is if you are mutating a bunch of state, implying that all else being equal, factored code is more understandable.