If you have ever stared at a line that mixes typeof, GetType and IsAssignableFrom and thought your code was speaking in riddles, you are not alone. I once spent a late night chasing a bug where two classes looked identical but behaved like siblings arguing over who touched the thermostat. The fix landed when I stopped treating type checks like a guessing game and learned what each tool really asks the runtime.

Meet the cast of characters

Think of typeof as the cast list, GetType as the actor on stage, and IsAssignableFrom as the casting rules. Each plays a different role, and mixing them up can turn your tidy drama into improv night.

This article will be available on March 2, 2026 at 8 AM Central Time US