logoalt Hacker News

vlovich123today at 4:38 AM2 repliesview on HN

This has appeared multiple times over the years as “compiler improves c++ errors” and is even the reason given as motivating things like concepts. Sure it keeps improving but the errors don’t seem to actually get smaller. The problem is inherent to templates - c++ got it wrong by having templates start weakly typed and it has no mechanisms to correct it in the language - concepts helped but didn’t definitively fix it and also are a serious level of complexity (ie for writing and defining concepts) - it just shifted the burden one level but ultimately the mess is still there.

After more than 20 years in c++, I gave up that the situation will ever really be fixed vs constantly being made better at the margins, but not as fast as new ideas get added to the language.


Replies

ChristianJacobstoday at 4:56 AM

You're not wrong there. The late stage (compilation wise) of template instantiation doesn't help either, as so much context has been built up. The art of debugging C++ compiler output is knowing which 90% to ignore. If you read it all you'll simply go mad.

Concepts at least tells you which criteria you didn't satisfy (as long as the concept is correct...), which - admittedly - feels like putting a bandaid on bullet wound.

show 3 replies
pjmlptoday at 5:10 AM

The problem isn't C++, the problem is that the meagre resources those teams have available, rather spend their time catching up to ISO C and ISO C++, than improving error messages.

Hence why SARIF has seen big adoption, as they hope that by exposing that , there are others ways to have others have tools that process SARIF.