3 ms·
Having to rely on reflection is bad though.
by hacknat 12y ago
Having to rely on reflection is bad though.
- eropple 12y agoWhy? I hear this a lot, but I never understood it. I do a lot of work with reflection to achieve things I can't otherwise do (around application extension, dynamic systems for games, etc.). I mean, attributes are reflection, and they're absolutely invaluable.
- hacknat 12y agoBecause it's not maintainable in a large code base. You write your code, and move on to something else, someone else comes a long and does a refactor, but they and/or the IDE misses the member names that were in strings. The program crashes on the next deploy because it built just fine. Reflection is like anything else it can be used properly and it can be abused. I've seen it abused far too many times. I realize there are times in Java when reflection is unavoidable (Android's animation libraries rely on it), but I consider it to be a feature of C# that, so far, I've never had to use reflection in C#.
- marvelous 12y agoA killer feature of the Ceylon programming language is its typesafe metamodel. Metamodel references are refactored like everything else in eclipse.
- benjiweber 12y agoAbsolutely. My point is just that the Java generics not being available at runtime is a common complaint, but it's only partially true. Most of the issues can actually be resolved even with type erasure. e.g. method overloading can be resolved statically.