Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Why doesn't Ruby have Boolean class?

Why doesn't Ruby have Boolean class?

https://burikaigi.dev/speakers/004/
This is BuriKaigi, so I talked about "Boolean (Bu-rian)" :)

Masafumi Okura

January 19, 2024
Tweet

More Decks by Masafumi Okura

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • ໊લɿେ૔խ࢙ • ॴଐɿϑϦʔϥϯε • ՝֎׆ಈɿKaigi on RailsνʔϑΦʔΨφΠβʔɺOSS։ൃɺ֤छొஃ ʢEuruko,

    RubyConfTw, VimConf, σϒαϛ2024ʣ • ޷͖ͳݴޠͳͲɿRubyɺRailsɺNeovim • ෋ࢁྺɿ2ճ໨
  2. Rejected for several reasons: many gems and libraries had already

    introduced Boolean class. I don't want to break them. true and false are the only representative of true-false values. In Ruby. nil and false are falsy values, and everything else is a true value. There's no meaning for having a superclass of TrueClass and FalseClass as Boolean. Matz. ʢԼઢ͸Ҿ༻ऀʣ
  3. Rejected for several reasons: many gems and libraries had already

    introduced Boolean class. I don't want to break them. true and false are the only representative of true-false values. In Ruby. nil and false are falsy values, and everything else is a true value. There's no meaning for having a superclass of TrueClass and FalseClass as Boolean. Matz. ʢԼઢ͸Ҿ༻ऀʣ
  4. Rejected for several reasons: many gems and libraries had already

    introduced Boolean class. I don't want to break them. true and false are the only representative of true-false values. In Ruby. nil and false are falsy values, and everything else is a true value. There's no meaning for having a superclass of TrueClass and FalseClass as Boolean. Matz. ʢԼઢ͸Ҿ༻ऀʣ