3 ms·
Why are they strange? Interceptors seem to enable migration away from reflection, for better support of AOT compilation. For example: https://github.com/Dapper
by zigzag312 3y ago
Why are they strange? Interceptors seem to enable migration away from reflection, for better support of AOT compilation.
For example: https://github.com/DapperLib/Dapper/issues/1909 https://github.com/DapperLib/Dapper/issues/1909
- pjmlp 3y agoInterceptors are a hack, instead of a properly designed AOP framework, which Microsoft already has, although comes with Visual Studio Enterprise price tag, Microsoft Fakes. Inline arrays are another hack, instead of properly designed language grammar, like in languages like D or Swift.
- zigzag312 3y agoC# interceptors are a metaprogramming feature. AOP is a higher-level concept. An implementation of AOP can use these metaprogramming features to achieve aspect weaving.
- pjmlp 3y agoAre a badly implemented, and clunky, metaprogramming feature. Where a sound AOP framework, or macro system are much more sane. Belongs to the same trash bucket as the C# 11 bang-bang operator, and I will vote for the same outcome, in all places asking for community feedback.
- zigzag312 3y agoI lack experience to assess quality of C# interceptors, so that might be true. I'm just happy that C# ecosystem is slowly becoming less dependent on runtime reflection.