Proposal: Private modules (general discussion)

Here’s my issue.

In OO programming, private methods and variables make sense to restrict the manner in which the state of an object can change.

In an explicitly functional, call function, get response, no side effects context the value of preventing a method call from a space outside of the developer’s initial intent is minimal.

The case that brought this up was just from a published library with a degree of popularity utilizing something that wasn’t supposed to be utilized. A warning alone would have solved this problem because a) the developer would see it and b) anyone who installed and used the library would see it likely resulting in an issue being created, a PR being created and/or a conversation from the library developer to the team to communicate needs better.

I just don’t see any value that can come from potentially increasing the chances for errors in running code when there’s no a discernible benefit over a warning.

2 Likes