Hacker News
points by LugosFergus 4 days ago | 0 comments
I get why some folks would like to see contracts in the language, but C++ is also buckling due to the shear complexity that's getting tacked on to it. I'd rather see more proposals such as C++26's "erroneous behavior" that attempts to reign in the language's shortcomings.
[–] airstrafer 4 days ago
Agree. There's an argument that Contracts reduces the complexity of using the language because it offers a more readable alternative to template metaprogramming (also, it has better error messages). But the argument really falls apart when you review WG21's track record for other features.

Like for example, Coroutines were billed as an easier way to write concurrent code, but personally I think it completely failed and ended up being hopelessly complex and confusing. Modules are the same - superficially they make things simpler, but when people actually go to adopt it, the details are so complex that nobody bothers.

[–] locknitpicker 4 days ago
> There's an argument that Contracts reduces the complexity of using the language because it offers a more readable alternative to template metaprogramming

Like most people in this thread, you should really read up on contracts before commenting. The contracts proposal is for runtime assertions, and their problem is that they are poorly specified and fundamentally broken. Their proponents haven't been addressing any of their concerns and tried to push a half baked version of them down everyone's throats, which was why they failed to pass.

[–] kllrnohj 4 days ago
I think you're confusing it with Concepts. Contracts are basically just asserts, nothing to do with templates.
[–] pjmlp 4 days ago
Some do bother, e.g. Microsoft Office uses modules, there is a talk on it.
[–] layer8 4 days ago
*sheer
[–] MathMonkeyMan 3 days ago
It's shear complexity because it's about cross-cutting concerns, or because it's a difficult yak to shave.