Skip to main content
  1. Posts/

Should you use small functions?

··165 words·1 min·

🧩 Small functions? Not always the best idea
#

In programming we often hear that “functions should be small.” Cindy Sridharan’s article offers an interesting perspective: question that mantra.
Sometimes breaking code down too far creates more problems than it solves:

  • 🔍 More functions = more names to remember
  • 🔄 Loss of context when jumping between files
  • 🧠 Higher cognitive load for the reader
  • 🧱 Fragile abstractions that break with small changes
  • 🧪 More complex tests when dependencies aren’t explicit

The main idea: it’s not about making functions small, it’s about making good abstractions.


✨ Explanation in a nutshell
#

  • Imagine your code is a recipe.
  • If you split every step into micro-steps (“cut”, “grab knife”, “move hand”, “place on board”), the recipe becomes impossible to follow.
  • But if you group steps sensibly (“chop onion”), everything flows better.

👉 Size matters less than clarity and ease of future modification.

More information at the link 👇

More in the following external reference.
Also published on LinkedIn.
Juan Pedro Bretti Mandarano
Author
Juan Pedro Bretti Mandarano