I am wondering why C# calls
System.Type.op_Equality
instead ofceq
.
Because types are compared by value, not by reference. There could be two type objects in memory that refer to the same type.
Which one of the three would you use?
If you want to know whether an instance is of a particular type, there is an operator specifically designed to solve that problem and that problem alone: is
. Why would you ever not use the tool that was specifically designed to solve your problem? If you're replacing a roof and you have a choice between a roofing hatchet and a hammer, I hope you would use the roofing hatchet.
Now, if you need to both do a type test and obtain the value then I would be inclined to use as
because that is the operator specifically designed to solve that problem.