This type of C++ code makes me sad. I can follow along and figure out what it's doing, but I really have to slow down and think about it. C++ template metaprogramming has the ugliest syntax of a "real" programming language that I've ever seen. Brainfuck might win for hardest to follow code, but god damn it, C++ is really trying. IMO, Lisp did metaprogramming the right way, 40 years ago. It's built into the language a…
This type of C++ code also makes me sad. I actually can't follow along. I can't glance at the code and parse what it is doing because the template keyword has many flavours, as does class , as does typename , as does using , as does ... , and so on. and > seem to be the template equivalent of ( and ) . I can't tell the intent of a piece of template code quickly. I agree with your Lisp sentiment. It appears that the C…
Maybe it will make you and jlarocco happier to know that Stroustrup feels your pain.
Years ago at a standards meeting (well, having drinks, not during the meeting itself) he and I were talking about C++ and Lisp and I said how much I missed defmacro. He became quite animated that #define had "polluted the ecological niche" and that templating "was the best we could do to bring macros to C++".
C++ is/was hobbled by its C back compatibility (lucky eventually they became brave enough to snap that link). In retrospect I still think it was a good idea for the sake of growing the C++ user base, but it has had some dreadful implications.
The syntax is horrible but it is still one of the most expressive languages I have used. And much as I look back fondly to my years as a Lispm hacker, I have to say, times move on.