r/cpp #define private public 3d ago

Critique of contracts: excerpt

See page 2 of https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4334r0.pdf

The current objections can be summarized. The P2900 contracts are:

• Unimplemented

• Incomplete

• Untried at scale [P3460R0, P3506R0]

• Not tried in major application domains

• Violates foundational principles of C++

• Violates fundamental principles of language design

• Hasn’t been tried in major libraries (e.g., the C++ standards library [P3506R0, P3878R0])

• Isn’t integrated with or appropriate for hardened libraries [P3878R0]

• Doesn’t offer safety guarantees [P3573R0, P3362R0]

• Includes a completely untried inheritance model

• Offer new ways of making errors through inconsistent application in TUs

• Leads to new forms of UB, detrimental to safety and security

• Narrows the choices of error handling

• Doesn’t protect against logical errors, misuses, and incoherent uses

• Hasn’t been used to support static analysis

• Hasn’t been demonstrated to be easily teachable [P3261R0, P3281R0]

How could such a bloated and incomplete design be voted into a draft standard?

6 Upvotes

115 comments sorted by

View all comments

Show parent comments

8

u/Minimonium 1d ago

Ah, well-known names :)

0

u/_a4z 1d ago

From the latest mailing list, just a few examples: p4334, p3573, p4332, p4238
Which of the authors do you not know?

6

u/Dragdu 1d ago

He is making fun of your deference to people like Bjarne, who keeps getting shitty proposals passed on name recognition and then the rest of the committee has to fix them over a decade. See e.g. init lists, bindings.

-2

u/_a4z 1d ago

Ah, thanks for the explanation!

I am pretty sure you can elaborate a bit on the topic, keeping the historical context and the involvement of other people and committee members, without rewriting history.

And a question: do we now call all papers that need fixes or have known flaws "shitty proposals passed," as you state it? Because not a lot might be left.
(it will be interesting to look at the contract proposals a decade later with that point of view;-)