The two most popular approaches to casting – converting data types and objects – in C# are
It is speculated that most developers use the first approach, but have you ever wondered which approach is the better one, is more performance efficient, and why ?
According to Jon Skeet (on MSDN), the fundamental difference in the two approaches is as follows.
Performance: According to Jon, the AS operator syntax is known to be slightly faster than the casting syntax in v1.0 and v1.1.
Moreover, to me, it makes sense to use the AS operator where possible also because it does not throw an exception, which are in general very expensive in terms of performance. Lastly, I think the AS syntax also looks “more elegant”.
Further Reading