dynamic vs object type

They’re hugely different.

If you use dynamic you’re opting into dynamic typing, and thus opting out of compile-time checking for the most part. And yes, it’s less performant than using static typing where you can use static typing.

However, you can’t do much with the object type anyway – it has hardly any members. Where do you find yourself using it? When you want to write general purpose code which can work with a variety of types, you should usually consider generics rather than object.

Leave a Comment