3 ms·
When I see someone towards the middle of their career who is still in the thrall of C++ metaprogramming, it excites in me a mixture of genuine sympathy and cond
by psykotic 15y ago
When I see someone towards the middle of their career who is still in the thrall of C++ metaprogramming, it excites in me a mixture of genuine sympathy and condescending pity (and if they're a coworker of mine, righteous wrath). I am glad I went through that phase in my late teens and had the nonsense shook out of me by my first professional experience as a programmer.
It's fine to pursue this as fun for its own sake if you are under no pretense as to its practical utility. But the danger of having your fun it in a bread-and-butter language like C++ is that you will be tempted to let it infect your workaday coding style. That's one of the perpetual dangers of hiring bright, overeager C++ programmers at the junior level.
Boost is a minefield. Its less booby-trapped libraries have made it into the next C++ standard library, but the more hardcore indulgences in metaprogramming like Spirit deserve all the scorn that is customarily heaped on them, if not more.
- wolfgangK 15y agoYour post is very condescending but also very light on facts. To someone successfully using C++ metaprogramming you just sound like you failed to find how and when to use it. (I do agree that it can get ugly wrt error messages and syntax as neither the compilers nor the language were designed with metaprogramming in mind.)
- psykotic 15y agoThe condescension was very much intended. Look, I'm not going to convince anyone of this point of view with a few hastily typed-out paragraphs on Hacker News. No-one can do that. It's something that rings true or false depending on your experience. My experience is that most uses of C++'s features beyond the rudimentary lead to software that takes forever to build, forever to run and forever to maintain, all of which are unacceptable and inexcucable. I started out in my pre-career as an enthusiastic C++ supporter who knew most of the tricks and dark corners of the language; template metaprogramming was (and still is) easy as pie for me. But every experience I've had since then has pushed me in the opposite direction, away from immature self-indulgent cleverness. Nowadays I mostly use C or a very C-like subset of C++.
- roel_v 15y agoWell I'm happy for you that you reached such intellectual heights before you were twenty - if only everybody else was as smart and gifted as you are, the world would be a much better place rollseyes