Sugar Free Ruby An Experiment in Object first Teaching - myronmarston/conferences GitHub Wiki

From Gogaruco 2012

Presenter: Steven! Ragnarök

Bio

During the school year, Steven! is a student of computer science, mathematics, and latte art, and this past summer he interned at GitHub. Year-round he's a passionate Ruby hacker who loves contributing to open source projects like Faraday, Rubinius and Archlinux. He teaches and contributes to KidsRuby, CoderDojo, and Rails Girls and is also on the core team for RailsBridge. He has spent more than a few evenings scrabbling to get out of the Bronze League in StarCraft II. Most importantly, Steven! is a dedicated engineer with a passion for creating beautiful things.

Abstract

Ruby has a lot of syntax to come to terms with. In an effort to reduce learning overhead we often restrict what we teach by avoiding serious coverage of objects in early lessons. Yet objects are what make Ruby great. Rather than sacrifice Object Oriented Mechanics, Sugar-free ruby uses a minimum of syntactic sugar to reinforce the message-passing objective semantics of Ruby until the pupil understands and then can assimilate new syntactic elements with greater ease. This talk explores the advantages and pitfalls of the technique as well as other ways to teach Ruby.

Notes

  • Teaching programming is really, really hard.
  • Programming tkes a lot of self-reflection to teach well.
  • It's getting better: Hungry Academy, Rails Bridge, etc.
  • CoderDojo: Kids programming clubs
    • Game Builder, Scratch, Python, Hackety-Hack / Shoes
    • Most important lesson: Programming is Fun
  • RailsBridge: Workshops for Women
    • Trying to install "Programming is Hard, but it's attainable"
  • Teaching Ruby: the challenge is finding out why your students want to learn ruby.
  • Teaching Ruby the good old fashioned way
    • Start with data types: integers, floats, strings, symbols, booleans arrays, hashes, variable assignment, conditionals, loops, etc.
    • Maybe if there's time, get to methods.
    • What's wrong with this: 6 concepts come before methods. No mention whatsoever of objects or classes.
  • "Ruby is not a computer language" -- it doesn't care about that it runs on a computer.
  • Let's teach objects and treat ruby as the computer.
  • IRB is the best tool for learning ruby.
  • How Steven teaches:
    • Everything is an object
    • They receive messages -- use send to show this.
    • Objects have a class
    • Instantiation with new; variable assignemtn as "giving an object a name"
    • Method definition
    • Introduce dot-syntax for calling methods.
    • Errors are your Friends -- try calling undefined methods
    • Use Kernel.puts as it is less "magical" than just "puts"
    • Define an accessor method, use an instance variable
    • Implicit receivers
    • Use conditionals to accomplish a goal.
    • Demonstrate creating a class with Class.new
    • This is focused on teaching objects with ruby.
  • This is better because the object metaphor provides a context for everything else we learn about Ruby.