3 ms·
They all probably read Clean Code, the discussion on functions in that book may be the most harmful/costly to programming in the last 20 years.
by methodsignature 6y ago
They all probably read Clean Code, the discussion on functions in that book may be the most harmful/costly to programming in the last 20 years.
- IggleSniggle 6y agoClean Code is still a great read in 2020, but I think you’re right about some of the specific advice about functions.
- abledon 6y agoIs there a good blogpost/writeup on this idea? I've seen it mentioned before in other threads.... And i agree 100%
- tekdude 6y agoFrom John Carmack: http://number-none.com/blow/blog/programming/2014/09/26/carmack-on-inlined-code.html http://number-none.com/blow/blog/programming/2014/09/26/carm...
- UK-Al05 6y agoThat's a for a specific case of high performance code and removing duplicated work. Referencing carmwack always has to be in the context of high performance code. Even carmack himself has started like functional code. Which normally leads you down small pure functions.
- smaddox 6y agoNo, that is not for a specific case of high performance... It's for the non-specific case of keeping the code clear, understandable, and bug-free. The style was chosen for these reasons, not because it is more performant. It just happens to also be more performant than the layers of indirection that also harm understandability. For a procedural code base, avoid subprocedures that are only called once. For a pure functional codebase, e.g. Haskell, locally-scoped single-use functions can be beneficial.