Ruby Immersion (Tue Sep 5, lecture 3)

Homework due for today

Legend: : Participation | : Early | : PDF | : Portfolio | : Zipped

  1. RTHW: Continue with Learn Ruby The Hard Way up to exercise 26. Your success in the whole course will be strongly affected by how comfortable you get with Ruby. It’s a really fun and interesting language. You should be at least up to Lesson 26 where you will learn about working with files, functions and other foundational topics.
  2. Products: Come up with a few product ideas. Just think about what you always wanted in the world. Maybe you already have an idea in mind? Anyway, for inspiration you may look at Product Idea Inspirations or anywhere else. It doesn’t matter where. Select between one and three that you might want to work on in this class. Remember the caveat: Don’t set the bar at “this is the most wonderful product idea I ever saw”. Set it at “this is a product that could be interesting to develop and work on.” Write up (in 1 or two paragraphs) your favorite product idea(s)! Deliverable: Submit your report as a pdf to Latte.
  3. PA_MOVIES_1: Continue working on PA_MOVIES_!. It is due next class! This assignment will get you to write some basic code with Ruby. You will learn how to read files work with data in arrays and hashes. If you are stuck, ask one of our wonderful TAs for assistance. Up to now you have been coding inside your own Portfolio.

Intro to Ruby

  • Key differences from Java
    • no semicolons
    • optional parentheses around method calls
    • no public static main
    • dynamic typing
  • Big concepts
    • Dynamic typing
    • Blocks
    • No compile step
    • gems
    • rake
  • Running a program
    • ruby filename`
    • irb or pry
    • How does ruby handle a multi-file program?
  • Aggregates (or collections or containers)
    • Array
    • Hash

Handy demo files

Homework Review

  • Discuss progress on the ruby work.
  • Look at some representative code in the portfolio

Product Brainstorm

  • Look over results of product review

Next Class