isocpp / isocpp/CppCoreGuidelines

Are F.55 and ES.34 the same?

Open
#1,690 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
45.3k
Forks
5.6k
PR merge metrics
No merged PRs in 30d

Description

It looks to me that these two are very similar in what they are trying to say:

https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#f55-dont-use-va_arg-arguments
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-es34-dont-define-a-c-style-variadic-function

They both talk about lack of type safety:
F.55: Reading from a va_arg assumes that the correct type was actually passed
ES.34: Not type safe.

They both provide examples of how passing the wrong thing can be bad.
They also provide more or less the same alternatives:
F.55:

Alternatives
    overloading
    variadic templates
    variant arguments
    initializer_list (homogeneous)

ES.34: Alternative: Overloading. Templates. Variadic templates.

The first one seems more complete as it mentions that these functions are applicable to catch all in overload sets.

Should we remove ES.34 and keep only F.55?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in CppCoreGuidelines.md at F.55 and ES.34, reading both rules, alternatives, and examples side by side. Determine whether they are redundant and document the rationale for retaining, revising, or removing one; done means the guideline text and cross-references clearly resolve the overlap.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.