News for hackers. Stuff that matters.
Re:Write code. Not too much. Mostly functions. by UK-Al05 on Tuesday December 22, 2020 @06:58AM (#25505413)
That'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.

Re:Write code. Not too much. Mostly functions. by smaddox on Wednesday December 23, 2020 @12:57PM (#25520190)
No, 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.