
Rubinius wants to help you make Ruby better - raju
http://www.engineyard.com/blog/2010/rubinius-wants-to-help-you-make-ruby-better/
======
ubernostrum
Once again reminding people to be careful about how they interpret the LSP:

[http://www.reddit.com/r/programming/comments/7zy40/writing_u...](http://www.reddit.com/r/programming/comments/7zy40/writing_unit_tests_is_reinventing_functional/c07w5bx)

------
kingkilr
IMO the authors understanding of the LSP is incorrect. The way he uses it ANY
change would be invalid, for example adding a new method would change the
property of "raises AttributeError when attempting to access XYZ" (in Python
parlance).

~~~
btilly
What you are criticizing isn't the author's understanding of the Liskov
Substitution Principle. It is Barbara Liskov's attempt to formalize the Liskov
Substitution Principle.

I dare say that she knows her own intent better than you do. It is also
unsurprising if her formulation is imperfect.

In a practical world what the LSP means is that you should be able to replace
an object of a given type with another object of any subtype and it should
still work. If it doesn't, then that wasn't really a subtype. As you correctly
pointed out, the challenge in dynamic languages with exception handling is
that it is possible to write code that depends on a particular method not
existing. Similar code in C++ would give a compilation error. Therefore no
subtype can quite be perfect in some languages.

Still even though perfection is impossible, it is good to be aware of the
principle, and adhere to it as closely as is practical. Meaning make your
changes be one that will break the smallest amount of code that your code
change is likely to encounter at any point in the future.

