Trade-offs define software architecture, and short functions can shine in contexts like performance optimization or team onboarding. What didn’t work for one project might be gold for another. It’s about context, not absolutes.
Functions in your code should be no longer than five lines ... 🤦♂️
This has to be the stupidest practice I have seen many codebases follow. This just fills the codebase with a ton of tiny functions that do nothing important but call other abstract functions surrounded by some trivial logic.
Such a codebase is an absolute nightmare to understand and make changes to. Just imagine taking 79 clicks to just navigate and reach the place of interest, a sheer waste of time and effort. After a few taps, you will even forget where you began and how you end up here.
As a general rule of thumb, optimize the code for anyone to understand, extend, and modify today. Keep your functions large enough to be doing something substantial, but short enough to be reused at other places.
Remember, functions were introduced to programming languages to increase the reuse of business "logic".
a → b ≠ ~a → ~b.