C++ Project Mistakes

21 Dec 2024

[ c++  design  development  ]

Recommendations

Mistake: Unclear Project “Contracts”

Instead: Have a README

Mistake: Inconsistent/Claimed Project Name

Instead: Do some homework

Looking for “zerocode” in arbitrary C++ packaging ecosystems:

Other languages?

Mistake: Neglecting Library Filenames

What: zerocode given libzerocode.a or libzerocode.so

Instead: Name your library files after your project!

Mistake: Ignoring Users with Build Systems

Instead: Define a Build System Identity

How do build systems describe you as dependency?

If you CMake:

If you don’t:

Mistake: Unconsidered Header Identity

These are all “valid” references to one header

Instead: Namespace your headers

Mistake: Invented/Ambiguous File Extension

Instead: Use a Language-Specific File Extension

Define your files as being implemented in a specific language

Mistake: No Correctness Contracts

Instead: Provide tests

Mistake: Little/No Build Support

Instead: Have a Build System

Mistake: Overspecifying Build Rules

Many choices must to be made before environment provision

Mistake: Overspecifying Build Rules - CMake Edition

Instead: Defer to “Higher Level” Contexts

Mistake: Treating Warnings as Errors

Instead: Allow Choice Per Workflow

References