Usually you put things in .hrl that you want to share between modules, usually write definitions and macros. Things that should be purely local to the module, you do not put in the .hrl file. Thus, a purely local definition of the record, for example, the local state on the server, will not be in .hrl , but only in the module that defines the server. Same thing with macro definitions. You should always avoid unnecessarily exposing inside information.
Since the included file is directly inserted into the including file, then any code contained in it will be duplicated in each module that includes it. Usually you do not want this.
rvirding
source share