logoalt Hacker News

airstrafer • today at 3:55 AM • 3 replies • view on HN

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.


Replies

pjmlp • today at 7:51 AM

Some do bother, e.g. Microsoft Office uses modules, there is a talk on it.

locknitpicker • today at 6:29 AM

> 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 • today at 4:58 AM

I think you're confusing it with Concepts. Contracts are basically just asserts, nothing to do with templates.