5 ms·
All non-toy programming languages support encapsulation, usually implemented with "private" or "public"/"export" keywords (well-designed languages make private
by devit 2y ago
All non-toy programming languages support encapsulation, usually implemented with "private" or "public"/"export" keywords (well-designed languages make private the default), which means that unless the "thing" was marked as public/exported, in which case it's designed to be reused and stable and thus it's OK to depend on it, that will trigger a compiler or runtime error (in well-designed languages, a compiler error).
Obviously, in that case it's perfectly normal and acceptable to either export or make public the thing, if it is a good idea for it to be part of the module interface, or if that's not a good idea factor out the useful thing and make it a 3rd module that both the original and new modules depend one; this should come with some documentation about the interface if it's not obvious or fully specified by the types.
- bluGill 2y agoThey try but there is puplic to this submodule but not the full module.