wroc_love.rb 2016: Lessons of Liskov

Hands down the best talk of the entire weekend.

A redefinition of the Liskov Substitution Principle, giving insight to why Ruby struggles with NoMethodError on nil, why all the Rails Base classes include callbacks, and how to avoid “oh what the hell now” when you get an exception five steps from where the bug is.

This talk has grown into a book: The Concise Guide to Substitutability.

The video is now on YouTube.


ten minutes and already awesome @pankowecki

That was just splendid talk by @pushcx. @swistak35

10/10 talk – would listen again @michal_q_zajac

the talk by @pushcx on #LSP was eye-opening. thank you @siaw23

Lessons of Liskov by @pushcx was amazing – excellent content @jakubniechcial

Great talk about OOP in Ruby by @pushcx. Kill nil!@wpiekutowski

WOOOOOW, @pushcx #wrocloverb, THANK YOU! @antonpaisov

lessons on liskov by @pushcx were THE talk this year :) thanks!! @gosiaczu

best talk so far by @pushcx! 🍪clean interfaces are one of the most overlooked aspects of ruby @mrgrodo

The “Lessons of Liskov”, with no doubt, was the best talk of the conference. In four acts, Peter Bhat Harkins:

  • explained the difficulties you may have understanding the Liskov Substitution Principle;
  • showed how to spot places in the code where there are “bugs waiting to be written”;
  • demonstrated how to avoid “oh what the hell now” situations, when you get an exception five steps from where the bug is.
  • As a conclusion, Peter proposed to extend the definition of LSP principle to general Substitutability Principle, which boils down to the idea of writing more substitutable modules.

    The lecture was very well received: “Accurate level of balance between abstract concepts and practical tips – just as I like it” to quote one of conference attendees.
    Also, Peter turned out to be one of the best speakers I’ve had a chance to watch on stage: fluent, prepared and passionate. If you have time to see only one talk from this conference – choose this one – it will be worth your time.

    Tomek Ruskilo

Hands down the best talk of the entire weekend.

Peter is an awesome speaker, he had the audience totally captivated. Plus the topic – ideas how to create easily maintainable systems through writing classes that enforce substitutability. He talked about Duck Typing and how to apply it and make it better instead of guarding for nils the entire time.

Mateusz Sagan

This presentation by Peter was definitely the best during wroc_love.rb. Peter presented the liskov substitution principle and its usage in Ruby code. He talked about working with nil object, how to avoid nasty consequences that might occur regarding nils and how to make use of a NotImplementedError as a way of designing code. And of course, he elaborated superbly on Duck Typing. I strongly recommend this as a should-have-watched for every Ruby developer, no matter how experienced!

Jakub Niechciał


Here’s a copy of the study links from a slide near the end of the talk:

Definitive take on null objects in Ruby: http://devblog.avdi.org/2011/05/30/null-objects-and-falsiness/

Interfaces vs Typeclasses: https://stackoverflow.com/a/8123973

A gentle introduction to Maybe: http://maybe-haskell.com

More exploration of Maybe, Either, and composition: http://fsharpforfunandprofit.com/rop/

More of them in Ruby: http://codon.com/refactoring-ruby-with-monads

This talk has grown into a book: The Concise Guide to Substitutability.

More Lessons in Good Code

Get the slides with my speaker script by signing up. I’ll also send email one or twice a month about related topics in practical applications of theoretical concepts: how to use computer science to write better code. Unsubscribe when you’re not interested. I have cleaned up enough servers hacked by spammers that I’ll never sell or spam your email address.

Leave a Reply

Your email address will not be published. Required fields are marked *