# Avoid Public Functions Calling Other Public Functions

DevFeed: [Avoid Public Functions Calling Other Public Functions](<https://devfeed.tech/articles/avoid-public-functions-calling-other-public-functions-107178.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/10/29/pub-calls-pub.html>)

Author: Alex Kladov

Published: 2026-10-29T00:00:00Z

Content type: opinion

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [modules](<https://devfeed.tech/topics/modules.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [dry](<https://devfeed.tech/tags/dry.md>), [function](<https://devfeed.tech/tags/function.md>), [functionality](<https://devfeed.tech/tags/functionality.md>), [functions](<https://devfeed.tech/tags/functions.md>), [guidelines](<https://devfeed.tech/tags/guidelines.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interface](<https://devfeed.tech/tags/interface.md>), [io](<https://devfeed.tech/tags/io.md>), [isolation](<https://devfeed.tech/tags/isolation.md>), [library](<https://devfeed.tech/tags/library.md>), [mock](<https://devfeed.tech/tags/mock.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [module](<https://devfeed.tech/tags/module.md>), [optional](<https://devfeed.tech/tags/optional.md>), [public](<https://devfeed.tech/tags/public.md>)

## AI overview

When two public functions share implementation, have both call a private helper instead of having one call the other. A public API should suit its callers; reusing a public function internally can create pressure to add parameters that outside users should not set, degrading the interface over time. Changes to a private helper's signature remain local. The exception is a shortcut API intentionally defined as a chain of public calls, where the author says to avoid private calls. The author also argues against mocking methods and testing them in isolation, favoring mocks of I/O and tests of software functionality, and says guidelines should be followed for their reasoning rather than authority. No concrete example is provided.

## Source excerpt

A small-scale rule of thumb. This article will land much better with a concrete example, but I am drawing a blank here, so you gotta just blindly trust my say so!