You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've never encountered a project with (otherwise standard) functions implemented within header files. Traditionally, headers contain only information that must be shared between compilation units (function signatures, type definitions, etc). In some settings, header files contain functions, but these are (charitably) to deal with language quirks, like the handling of "inline" functions in C. It's also somewhat common to see very simple object methods defined directly within header files.
The existing structure places the bulk of the code in header files.
There are some software engineering reasons to avoid this arrangement; compilation units (the .cpp files) provide for limited variable scoping, which provides some degree of separation between the various compilation units.
In the present arrangement you have exactly one compilation unit per binary, so you miss out on that compiler-enforced abstraction interface.
The text was updated successfully, but these errors were encountered:
I've never encountered a project with (otherwise standard) functions implemented within header files. Traditionally, headers contain only information that must be shared between compilation units (function signatures, type definitions, etc). In some settings, header files contain functions, but these are (charitably) to deal with language quirks, like the handling of "inline" functions in C. It's also somewhat common to see very simple object methods defined directly within header files.
The existing structure places the bulk of the code in header files.
There are some software engineering reasons to avoid this arrangement; compilation units (the .cpp files) provide for limited variable scoping, which provides some degree of separation between the various compilation units.
In the present arrangement you have exactly one compilation unit per binary, so you miss out on that compiler-enforced abstraction interface.
The text was updated successfully, but these errors were encountered: