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 a 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 did you begin and how did 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.
β‘ I keep writing and sharing my practical experience and learnings every day, so if you resonate then follow along. I keep it no fluff.
youtube.com/c/ArpitBhayani