Skip to content

Disambiguate headers #87

@benedekkupper

Description

@benedekkupper

There are two major problems with this project's header style, that should be addressed:

Header file extensions

Most embedded projects use a mix of C and C++ language code. In this environment it is very misleading to use .h for C++ headers that the C compiler cannot compile. Having a clear separation (using .h for C and .hpp for C++ headers) makes detecting wrong includes immediately visible and easy to troubleshoot.

Furthermore, the generated header files should also adopt this, preferably with .pb.hpp extension, as the .pb is a canonical semi-extension that commonly refers to protobuf generated output.

Header file scope

Having very generic header names such as Defines.h, Errors.h gives a high chance of header name collision with the application it is integrated into. The headers should either be prefixed with the project name, or moved into a subdirectory and included with the directory name, e.g. #include "EmbeddedProto_Defines.hpp" or #include "EmbeddedProto/Defines.hpp".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions