📝API/SLOC

tags

#insight § Software Design

Let’s consider how Surface-area-to-volume ratio (and maybe The Heartbeat Hypothesis) could apply to § Software Design.

It’s straightforward that surface area = API of a module, and volume is how big the module is (e.g., SLOC—lines of code). Now, sa/vol says that (if we take the same basic shape) small modules are expected to have higher API/SLOC ratio and larger modules are expected to have lower API/SLOC ratio.

Due to The Heartbeat Hypothesis, lower sa/vol leads to lower heart rates, which leads to higher life expectancy.

  • Can we say that lower API/SLOC ratio is better?

  • Can calculating API/SLOC tell us something about module quality?

  • For cells, increasing cell size required more effective ways to produce energy (i.e., aerobic ATP synthase). Can we say that larger programs require better tools?

    • e.g., Haskell is known to require less lines of code to express the same concepts than Java.

Backlinks