Skip to main content
2 of 8
edited body
candied_orange
  • 114.6k
  • 27
  • 222
  • 352

There is a principle that makes you do this but it doesn’t say it the way your professor did.

Every function orchestrates other functions. Even adding two numbers together and assigning them to a variable is orchestrating functions. This you can twist yourself in knots thinking this way.

The single level of abstraction principal holds up spirit of that idea but doesn’t require you to pretend you know where the bottom is. It only requires that you set a level of abstraction and stick with it.

That means this is not structural. It’s conceptual. It doesn’t matter if you mix functions from your own code, a library, or even the basic language functions.

What matters is that when you mix them together they don’t yo-yo your brain up to hand waving high abstraction and down to low level details all within the same function.

Follow this principle and you’ll end up separating orchestrating and doing just fine.

candied_orange
  • 114.6k
  • 27
  • 222
  • 352