logoalt Hacker News

yakaccount4 • today at 4:23 AM • 0 replies • view on HN

I haven't really paid attention to C++ in a while (last neat feature I saw was concepts). Usually I kind of enjoy the weird, expressive code golf you can write with the new features. For example I tried out using concepts to ensure Matrix dimensions were compatible with the desired operation. Not really that useful, but was a neat thought experiment.

But these proposed contracts... I just don't really see much benefit it offers over just explicitly writing your own assertions.

I suppose you can see the requirements in the declarations, but I would wager that fancy modern C++ declarations quickly become so long and verbose that you'd get quickly fatigued from reading them. Perhaps in the LLM era they are more useful?