I’m ready to contribute. So far, there isn’t much there to follow. It seems prudent to code according to an agreed set of guidelines to make the code reasonably consistent. Code layout (indentation, placement of curlies/parenthesis, West or East const
) can reasonably be achieved using clang-format
possibly with some specific setting (I’m not gonna like it but I could adhere to the defaults). So, that’s not what I’m talking about. However, here are some of the items which should probably be consistent:
- Files should have a copyright. I know that Boost started off with personalized copyrights but eventually moved to one common Boost copyright. Probably the files for the Beman Project should have a Beman Project copyright although that isn’t a legal entity (yet?). That detail should be sorted out early on to avoid having to deal with copyright assignments later.
- Names of source and header files, in particular their suffixes. The
beman/example
uses.hxx
and.cxx
. - Location of the files: the
beman/example
places the files intosrc/example
next to each other. What structure is expected. - It may be nice to use modules for a freshly created C++ project. On the other hand, it seems module support still isn’t quite there according cppreference status. Should projects be structured in a way which would allow use as modules or use via headers depending on some deployment options? I’m not quite sure what that structure might be, though. I could imagine some code annotations in files which are picked up by a program to transform a header-based code based into mdules-based one.
- What namespaces are the projects supposed to use?
- Successful standard proposals will live in
std
. To replicate the intended final interaction, the code should probably, indeed, live in namespacestd
, at least, optionally. Sadly, namespace aliases can’t be used to open a namespace for definitions: otherwise there could be one local place for configurations defining the namespace without resorting to macros. As is, it seems we may need to resort to macros. - Unless modules are used, it will be necessary to hide names into specific namespaces to avoid ADL to accidentally find entities not intended to be found. How should the corresponding namespaces be named and where should they be located?
- It would be great if tests could seamlessly test actual standard library code and Beman Project code. To that end it is probably necessary come up with a strategy referring to names in namespaces which can be somehow configured. Mostly that can probably be done using an agreed namespace alias referring to the namespace supposed to get into namespace
std
eventually.
- Successful standard proposals will live in
- Standard library code needs to uglify non-standard names, typically using reserved names like those starting with an underscore followed by a capital letter. Should Beman Project contributions also uglify names.
- The files should probably be generally structured consistently and contain certain key parts:
- All files should include a copyright notice and probably a license/pointer to a license. The exact text should probably be consistent boiler plate, adjusted for different files (e.g., source files and
cmake
files use different comments). - Header files should include guards against multiple inclusion. I’m not a fan of
#pragma once
and would rather use consistently named include guards.
- All files should include a copyright notice and probably a license/pointer to a license. The exact text should probably be consistent boiler plate, adjusted for different files (e.g., source files and
There are likely many more details which should be agreed upon. Maybe the code should also adhere to the Core Guidelines or a subset thereof. Is there a checker for (a subset of) these guidelines and if so, can/should it be configured for Beman Project projects? Are there other guidelines which should be followed.
I’m quite certainly that I’ll come across various other aspects once I start working on an actual project.