Open nathany opened 6 years ago
My intuition is update the slides to Integer
and provide footnotes on the slides that it may be Fixnum
? Moving forward, Integer
will become more correct for more learners as systems update.
Alternatively, rewrite the slides to avoid dependency on the class name distinction (eg. remove any checks for x.class == Fixnum
, which is generally a code smell anyway).
We could also maybe update the learner instructions to use Homebrew and install a particular version? That would resolve some of the confusion on what version is needed.
My intuition is update the slides to
Integer
and provide footnotes on the slides that it may beFixnum
? Moving forward,Integer
will become more correct for more learners as systems update.
I think this is pretty reasonable!
Alternatively, rewrite the slides to avoid dependency on the class name distinction (eg. remove any checks for
x.class == Fixnum
, which is generally a code smell anyway).
I also agree with this. That's kind of a weird check, tbh. You can do this check in Ruby versions before 2.4:
irb(main):001:0> 12345.is_a?(Integer)
=> true
irb(main):002:0> 12345.class
=> Fixnum
We could also maybe update the learner instructions to use Homebrew and install a particular version? That would resolve some of the confusion on what version is needed.
This I agree with less. Homebrew requires XCode's command line tools to be installed, and at the workshop, this may be the first time they've ever opened the terminal. They probably won't have XCode, and the common way to install Homebrew is by copy-pasting some random line of code from the internet. Yikes! So I don't think having learners use brew install
is the right way to go.
That's a good point. I forgot that Integer was the common parent for Fixnum and Bignum. I'm even more in favour of the change now.
This I agree with less. Homebrew requires XCode's command line tools to be installed, and at the workshop, this may be the first time they've ever opened the terminal. They probably won't have XCode, and the common way to install Homebrew is by copy-pasting some random line of code from the internet. Yikes! So I don't think having learners use brew install is the right way to go.
I've never used brew myself (Linux shop here), so I defer to your expertise - all I can say is that I agree installing two things is definitely harder than installing zero things.
People running Windows will download Ruby, and the big download button gets the latest version (currently 2.5). People running macOS only have Ruby 2.3 installed by default, even on the latest High Sierra.
In Ruby 2.4 (release notes) the Fixnum class was renamed to the more common name Integer.
Some of the slides refer to Fixnum, such as
x.class == Fixnum
which fails on Ruby 2.4 or newer.Updating the slides to use Integer won't work for macOS users, unless they all install a newer version of Ruby. So what's the solution?