casey muratori would like to have a talk with you about the following :)) // Approximately what the JIT generates if (animal?.GetType() == typeof(Dog)) { ((Dog)animal).Speak(); // devirtualized, inlinable } else { animal.Speak(); // original virtual call, hopefully rare }
You can always just not use OOP. C#'s tooling for functional programming and C-style programming is really good, thanks to stuff like statics on interfaces or spans.
momocowcow · · focus · HN ↗
kg · · focus · HN ↗