vondrak's soapbox a tech blog

Classes & Inheritance: Unweaving the Rainbow

Philosophy will clip an Angel’s wings,
Conquer all mysteries by rule and line,
Empty the haunted air, and gnomed mine–
Unweave a rainbow, as it erewhile made

Lamia (John Keats)

I’m an academic at heart. I don’t think that’s a bad thing for a software engineer, but it gets kind of lonely.

I notice it when phone screening. As an interviewer, I might ask something about object-oriented design. “Can you tell me how inheritance works?” Typically, I’ll hear answers about code reuse, subclasses delegating to superclasses, quirks of specific programming languages, composition over inheritance, etc.

These answers aren’t wrong. But I die a little bit inside when it’s all I hear. The academic part of me yearns for more depth. In my experience, most programmers can describe what inheritance does, but not what it really is.

Read more...