3 ms·
Exactly. You can do it, but it doesn't feel right.
by talles 11y ago
Exactly. You can do it, but it doesn't feel right.
- recursive 11y agoAnd furthermore, you have less reason to do it in the first place.
- moron4hire 11y agoI find more and more uses for C#'s reflection all the time. I have a project that is built almost 100% on it. Tagging things with attributes, reflecting over them, slicing and dicing all of the available data in all kinds of different ways. I can't imagine trying to do such a thing in JS, which provides so little information about exactly what I'm reflecting over. And it's so clunky. Some things you can typeof, some you have to instanceOf, such that you basically end up doing both all the time. With JS, I know that I have a bag full of things named something. I have to do my own work from there to find out if they are methods or properties or fields. In C#, I can just ask it to give me all of the properties. Oh, but stick to just the public ones. Or skip any that have an attribute named "Exclude" tagged to them. Yeah, I have no idea what people are talking about that JS is better for reflection. That's just bonkers.