Runtime introspection: What good is it?
In the last couple of years there seems to be an increasing interest (or hype) regarding run-time ‘reflection’ and/or run-time ‘introspection’. (Are they the same thing?). I’ve been googling for the terms and reading, essentially randomly chosen articles and snippets, and opinion seems to range from it being the best thing since sliced bread to the most evil coding technique yet devised. Update:corrected typos. Including the one stvn pointed out. There seems to be a lot of discussion of what it can do–in terms of “you can determine the type of something at runtime”–but little on why you would want or need to? And why it must be deferred to run-time? I’m having trouble seeing past the Ruby/Objective-C think that says: We can do it, and not many can, so let’s make much of it, as a desirable or even necessary feature. Premise: There’s nothing that can be done with run-time introspection that cannot be done (better) by compile-time decision taking. Counter arguments? Preferably of the fo