The long way through Software Craftsmanship

Video: Nothing is something

May 4, 2015 - 2 minute read - Comments - talkvideosandy-metzbathruby2015composition-vs-inheritanceruby

I have seen this video: [Nothing is something][video] by [Sandi Metz][sandimetz], as I saw it recommended [here][recommendation]

In the video, she talks programming in this fashion: (it is a stack, not an unordered list)

  • Abstraction seeking
  • Message centric
  • Condition Averse
  • Smalltalk Infected

Not here to change the language but change you

This is a pattern I’ve also heard from [Alvaro Videla][old_sound], where he said that other, more powerful languages can change your mind and help you bring some of those concepts to your own language. He was talking about Haskell, she, about Smalltalk.

She shows how to smell the null object pattern (that she independently discovered herself too - can be improved studying the classics1), also called active nothing. Decorates the Animal with a wrapper, to call it GuaranteedAnimal

Later on, shows how to code an example on a ‘tail’, extending behaviour with inheritance and how to get rid of it: prefer composition versus inheritance. The importance of roles.

Inheritance is for specialization, not for sharing code

Steps to convert inheritance into composition:

  1. Isolate the difference
  2. Name the concept
  3. Define the role
  4. Inject the players

This is a trick I discovered here: when you don’t know what name put here, create a spreadsheet and ask yourself what name the row should have. There is an example [at this minute][video-showing-the-spreadsheet]


  1. a reference to a pattern by the same name at Apprenticeship Patterns [old_sound]: https://twitter.com/@old_sound [sandimetz]: https://twitter.com/@sandimetz [video]: https://www.youtube.com/watch?feature=player_detailpage&v=9lv2lBq6x4A [recommendation]: http://garajeando.blogspot.com.es/2015/04/interesting-talk-nothing-is-something.html [video-showing-the-spreadsheet]: https://www.youtube.com/watch?feature=player_detailpage&v=9lv2lBq6x4A#t=1959 ↩︎

Disclaimer about AI/GenAI

As of 2026-05-06, the text in these articles and blog entries has been written without AI/GenAI, except I sometimes use a spellchecker to fix errors. Think Word's spellchecker, not ChatGPT.

Notes, as of today (2026-05-06):

  • No code snippet has been automatically generated, nor vibe-coded, nor generated and reviewed.
  • I don’t have any article with AI contribution.

For future entries:

  • I may have used GenAI for the code in the repo. The code I exemplify/copy in the article will always be reviewed and tested, not vibe-coded. I will specify it in each snippet or at the top/bottom of the article.
  • I normally don't use it for the text contents, although if I have used it for the article text, it would be indicated as such.

Any entry before 2026-05-06 does not contain any AI/GenAI.

For more information, read the AI/GenAI Policy

Internal training: Introduction to AngularJs Internal training: Testing is hard - just do it