Hacker News new | ask | show | jobs
by vips7L 1669 days ago
Personally I think reflection is the devil and the reason why we can’t abandon VMs for native compilers.
1 comments

Reflection does away the need to manually implement serializers. In a growing codebase where data models transform and references to those models begin to rot, that is incredibly useful.
That can be done with code generation at compile time. We don’t need to reflect at runtime for that.
Usability is worse, IMO.

Serialization libraries need to be decoupled from the records being serialized. These two things are compiled into different assemblies, and often written by different people.

Still possible to replace with compile time codegen, but the implementation gonna be complicated and fragile.