Guideline RP1: Do not repeat whole functions
As trivial as it seems, it is common to duplicate a function from one file into another file. For any repeated code, maintenance is difficult at best, impractical and error-prone at worst. There is no enforcement to change all copies unless there is only one copy. And if the duplication is in separate files, it is even more difficult. Perhaps initially one developer owned two files and just copied a support function from one to the other. But later, when other developers work on one of the files, they may not even be aware that another copy exists when they change one. Depending on the language, this pitfall can have greater or lesser consequences and avoiding it requires different amounts of work.
In Java, on the other hand, everything resides in a particular package. Within the package one can just refer to method m(). A different file typically will be in a different package, so it takes a bit more work to reference a single copy of a method. One must qualify the method with a package name, and access the package API via the
import statement. But this small effort gains a lot by avoiding duplicate code.
In Perl, on the third hand, you can do it either way (single namespace or package namespaces). See the namespace guideline for recommendations.