Dynamic Lang. Runtime vs Reflection

前端 未结 6 991
醉梦人生
醉梦人生 2020-11-29 21:47

I am planning to use dynamic keyword for my new project. But before stepping in, I would like to know about the pros and cons in using dynamic keyword over Reflection.

6条回答
  •  时光取名叫无心
    2020-11-29 22:16

    If you are using dynamic specifically to do reflection your only concern is compatibility with previous versions. Otherwise it wins over reflection because it is more readable and shorter. You will lose strong typing and (some) performance from the very use of reflection anyway.

提交回复
热议问题