Hacker News new | past | comments | ask | show | jobs | submit login

The first time I wondered how the hell C++ didn't support introspection, I was 1/3 as old as I am now. I have literally been wondering for most of my life.

But hey, at least they have a Turing-complete template language to go with their macros! Priorities, right?




Yes, priorities. The evolution of C++ is driven by its users in the industry. That C++ not yet has support for reflection or introspection is an indication that there hasn't yet been a great need for it.

Any C++ user (you know, the people who actually use the language) will tell you that templates is a central part of the language and something that is far more important than introspection.

Anyway, like I said in the other comment, there's a study group for reflection now. We'll see what comes out of it.


> Any C++ user (you know, the people who actually use the language)

Funny, because I am a heavy C++ user (why did you assume differently?). C++ probably accounts for between 1/3 and 1/2 of my lifetime lines-of-code. Trouble is, I've had to use it for more than algorithms work, which is the only place I've ever seen templates shine. I've used a half dozen C and C++ GUI frameworks that painstakingly work around the introspection issue, and while these frameworks often make do quite nicely without templates, they always have a bolted-on monstrosity of an introspection system. Qt is probably the most direct example: they built their own preprocessor/parser around C++ to take care of their need for introspection.

I'm glad there is a study group, but the absence of introspection has been hurting the C++ community for a long time. It's the flaw that has launched 1,000 high-level languages and 100,000 dirty hacks.


> But hey, at least they have a Turing-complete template language to go with their macros! Priorities, right?

And with that you can build reflection:

http://stackoverflow.com/a/11744832/375343


Great, now all I have to do is convince every company in the world that uses C++ to paste a macro into each class and keep duplicates of all their variable declarations.

(Poe's law applies, sorry if you were attempting humor and I missed it.)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: