top | item 18778554

(no title)

whatifitoldyou | 7 years ago

A pretty good summary of the state of C++. I actually enjoy the language and most of the new features. The 'modern' part is not at fault here. This has always been a problem. The cult of generic metaprogramming was always a pain to deal with. In part, the new language features can help reduce over reliance on templates. As a community we must push for features that can get is out of this situation, like a sane modules system.

I think Bjarne Stroustrup is partly to blame here. He has succeeded in creating a versatile and popular language but has given little priority to problems like build time, error messages and debug performance. These sound like petty, practical problems that the tooling guys should eventually figure out. Except they aren't. They are hugely dependent on the language design.

Another thing we are missing is a high profile figure that will show the way on correct patterns and that will literally publicly shame the authors of too "meta" template heavy libraries. You are not smart if you are writing these monstrosities. It should not feel good. Making it simple requires much more intelligence.

discuss

order

_slyo|7 years ago

> The cult of generic metaprogramming was always a pain to deal with. In part, the new language features can help reduce over reliance on templates. As a community we must push for features that can get is out of this situation, like a sane modules system.

The "cult of generic metaprogramming" is the very community pushing for those features.

> literally publicly shame the authors of too "meta" template heavy libraries.

This is pretty harsh. I agree that metaprogramming abuse in application code is a problem, and it's not something that should be advocated. However, there is a big difference between promoting C++ literacy and saying "everyone should commit metaprogramming code at work". The blame for metaprogramming abuse lies _squarely_ on engineering teams with poor quality control, not on library developers who like to push the language to its limits in their free time.

Everyone knows that C++ is a language of footguns. Metaprogramming is one of them; Boost is a mixed bag. Every successful C++ engineering team enforces coding standards to address this.

erik_seaberg|7 years ago

> publicly shame the authors of too "meta" template heavy libraries

Wouldn't they say we should instead shame the people who can't read them? What makes you right and them wrong?

red75prime|7 years ago

It's hard to change people, it's easier to change code.