I can't really put a finger on why, but for some reason runtime reflection in programming languages makes me feel slightly uneasy in the back of my mind. It feels like it's both cheating, but it should also be perfectly natural somehow. But it's neither. But at the same time it's also both.
Compile time reflection? Perfectly fine. Makes total sense.
Runtime reflection? Weirds me out every time I use it or see it used. Just that tiny little bit.
@tulpa more or less. Yeah. The lower level you think about computers, the more it feels like something that shouldn't be happening. In some way it makes the program feel that little bit less "real" for the lack of finding a better term for it.
@piggo Or deserializing JSON into structs or classes with a single line of code.
I mean... using lots of macros and templates and code generation you can probably do similar things in languages that directly compile to binary and not just some intermediate bytecode like Java or C# or whatever, but no matter what, it just always feels "wrong" to me somehow.
wanted to write a little rant on how reflection and laziness are very closely linked, but technically dlopen and dlsym together are also a kind of reflection. so, not quite so convinced of my own argument any more
@dhivael Even in languages that have good reflection support I refuse to use it unless I absolutely have to, because I agree. It ends up in a big mess more often than it helps, and the time you spend figuring out why your random reflection breaks is better spent just avoiding it in the first place I feel.
yeah, same. using reflection is tantamount to writing in an untyped fragment, which is ... not great
@dhivael Nevermind that once you start using runtime reflection, your compiler can't help you once you mess up. Things that become convenient compile time errors now crash your program. Woo!
A fun, happy little Mastodon/Hometown instance. Join us by the fire and have awesome discussions about things, stuff and everything in between! Admins: @Talon and @Mayana.