Open robinetmiller opened 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.
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.
I'd like to remove any (or most) references to IRB in the slides. Over the years I've found that IRB:
end
, close a bracket, etc)puts
actually do (eg. "the string is already showing up on the screen, why do we need puts?")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?