| ▲ | cogman10 2 hours ago | |||||||||||||
It comes up pretty frequently in java. Serialization/Deserialization, adding capabilities based on type, Adding new capabilities to a type, general tuning (for example, adding a timing or logging call onto methods). Almost all the Java web frameworks are giant balls of reflection. Name a function the right way or add the right magic annotation and the framework will autowire it correctly. It's a pretty powerful tool. (IDK if C++'s reflection is as capable, but this is what was enabled by java's reflection). | ||||||||||||||
| ▲ | SuperV1234 an hour ago | parent | next [-] | |||||||||||||
Java reflection is another beast altogether as it is runtime reflection. C++26 reflection is purely compile-time, which not only means it adds zero runtime cost, but also prevents those kind-of-insane use cases you see in Java and C#. | ||||||||||||||
| ▲ | david422 an hour ago | parent | prev [-] | |||||||||||||
> Almost all the Java web frameworks are giant balls of reflection. Name a function the right way or add the right magic annotation and the framework will autowire it correctly. I find this to be very powerful, and also very unintuitive/undiscoverable at the same time. | ||||||||||||||
| ||||||||||||||