canadalearningcode / llc-intro-to-ruby

Intro to Data Analysis with Ruby -- (SLIDES - http://ladieslearningcode.github.io/llc-intro-to-ruby/slides.html), (LEARNER FILES - http://bit.ly/llc-ruby-data) - No sample project.
Other
7 stars 10 forks source link

Remove IRB #19

Open robinetmiller opened 5 years ago

robinetmiller commented 5 years ago

I'd like to remove any (or most) references to IRB in the slides. Over the years I've found that IRB:

  1. Confuses learners as to how to run Ruby code (eg. "should I use irb for this or ruby?")
  2. Allows learners to get into deep syntax holes. Folks will:
    1. Write a statement
    2. Make a mistake (forget to add end, close a bracket, etc)
    3. Now they're stuck in an incomplete statement without realizing it.
    4. GOTO i) above until they get frustrated and ask for a mentor's help
    5. Often be told by mentors to just kill the terminal session and start again
  3. Muddies what functions like puts actually do (eg. "the string is already showing up on the screen, why do we need puts?")
  4. @ChaoticBoredom pointed out after the April 27th session that it kills momentum in the middle of the course when we switch from IRB to code files; 100% agree.

The only utility of IRB it that I can think of is to give immediate feedback for the exploration around types. I think this exploration could be accomplished with normal code files, if we do a little bit of slide reordering.

Changing the course to only run ruby with .rb files would remove the above troubles, match how it actually gets done in the wild, and it's where we end up in the lesson anyway.

Is there a reason why IRB is beneficial that I'm missing?

eddieantonio commented 5 years ago

I LOVE the interactive prompt in any programming language—this is how I got hooked on learning Python when I was a teenager. But you do make valid points. I have tried to explain the switching of modes between command prompt, irb, and gets and, in my experience, even after explaining this for the entire morning, learners are still confused about which mode does what. It also makes explaining the puts a lot easier, when it's clearly redundant in irb.

I find that when I'm learning a new language or new API, experimenting in the interactive prompt is an invaluable tool. Making a file, saving it, running Ruby, going back and changing something is too cumbersome of a process when trying to pick up something quick. That said, I make this argument coming from the perspective of a professional software developer, who is very comfortable with the command line and mode switching—my favourite editor is Vim, for crying out loud! I think irb is worth a mention, maybe toward the end (hey, by the way, you can experiment really quickly by using irb), BUT! When first learning a programming language, I think it's less confusing to write scripts than to go from the interactive prompt to scripts and having to learn what is applicable in what mode.

robinetmiller commented 5 years ago

I'm not as big a fan of interactive interpreters, but I do use them once in a while to quickly test something (usually syntax).

I'd be fine with changing the deck to start with .rb files and then later on mention IRB as a sidenote.