Sitemap
Gregory Brown

Gregory Brown

@practicingdev

Trace concepts back to their roots

3 min readOct 9, 2014

--

The web is amazing for technical research, because no matter how obscure your topic is, you’ll find at least a dozen interesting links on the first page of a google search. For example, suppose that you’re interested in learning about the Liskov Substitution Principle. A google search will yield you all of the following in the first few links on the page:

Between these three things, you will probably be well on your way to giving a great (and accurate!) presentation on LSP, right? Well… no, probably not.

Get Gregory Brown’s stories in your inbox

Join Medium for free to get updates from this writer.

Despite the quality and the richness of the above four sources, none of them are actually primary source materials. For that, you need to either dig up the original keynote address from Barbara Liskov (called “Data abstraction and hierarchy”), or find the more recent work from her and Jeanette Wing: A behavioral notion of subtyping (PDF) .

But why bother digging down to the lowest level with this stuff? It’s because if you don’t, you’ll end up consuming various end results of a long game of telephone. The wikipedia article is derived from Bob Martin’s paper which is a condensed version of a book of his, which in turn is based off ideas from Liskov’s original keynote address. And the accepted StackOverflow post is based off some other book which seems to assume that LSP is specifically related to class inheritance. That post summarizes the principle as follows: Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.

That’s an interesting principle, and it’s a meaningful derivation, but it’s NOT the whole story that Liskov was trying to tell. If you go back to the primary sources, you’ll find that Liskov was actually talking about a far more general concept than sub-classing; what she actually was setting forth was a way of formalizing how we think about duck typing, where class-based modeling was purely incidental. Notice how the former sounds like it’s not especially relevant to Ruby because we don’t do a lot of rigid class based modeling, and the latter sounds fascinating and applicable to our daily work? That’s the difference between reading a summary, and reading the orginal sources! In fact, if I never read “A behavioral notion of subtyping”, I would have never been able to write my own article on the how to apply these ideas in Ruby.

I’ve seen this time and time again while working on articles for Practicing Ruby: the original sources for software design principles are rarely close relatives to their summarized soundbites. This is also true when it comes to third-party claims made about open source projects vs. what their actual codebases reveal. It’s not that people aim to mislead or oversimplify — it’s just that there is always *something* lost in translation when discussing complex concepts. The further you are away from the root sources, the more likely it is that you’re contributing to the confusion.

This doesn’t mean that you can’t reference or build on top of summaries and derivations, but instead, that you should simply go back to their roots to understand where the ideas came from. I think if you do that, you’ll have a richer experience that will make you a better teacher, with more interesting things to say!

If you’re looking for some homework to help you apply these ideas, try reading A behavioral notion of subtyping, or take some other concept you’ve learned at a superficial level and trace it back to the roots. I’m willing to bet that you’ll uncover some uncommon knowledge in the process of doing so.

--

--