Intro to Ruby Syllabus (with extra thoughts/clarifications)
- Complete "help" on http://tryruby.org
- With that basic knowledge, complete some small program using tryruby.org
- Week 1:
- Introduction to Ruby
- What is Ruby?
- How is it different from other languages? How is it similar?
- Installing Ruby (instructions for Windows / Mac / Linux users)
- Guidance on choosing a programmer's editor
- Introduction to Ruby syntax through small code examples (try to subtly introduce how everything is an object and has methods on it)
- Numbers
- Strings
- Variables
- Expressions (basic)
- Operators
- Methods (basic)
- Introduction to free/publicly available Ruby documentation
- Homework/classwork: run various code samples using `irb` Experiment with other language features as they come up.
- Discuss in chat room/sync meeting
- Week 2:
- Introduction more basic data types (again, mostly using code examples)
- Arrays
- Hashes
- Ranges
- Symbols
- nil
- Introduction/review of basic object oriented concepts
- Classes
- Class instances
- Instance variables
- Instance methods
- Introduction to Ruby syntax for creating classes
- Homework/classwork: create a simple class that stores some data (instance variables) and operates on it (specifics TBD)
- Discuss in chat room/sync meeting
- Introduction to blocks and iterators
- Homework/classwork: experiement in `irb` (or by creating small scripts in an editor) with blocks and iterators (specifics TBD)
- Discuss in chat room/sync meeting
- Week 3:
- Review/catchup from weeks 1-2
- Control statements
- if / unless
- case
- while / until
- Boolean operators
- More advanced object oriented concepts
- Inheritance
- Overriding
- Overloading (splat arguments)
- Access control (public/private/protected)
- Homework/classwork: some practical example that shows inheritance, etc... (specifics TBD)
- Discuss in chat room/sync meeting
- Week 4:
- Overview of the Ruby standard library
- File I/O in Ruby (including ability to fetch from the web)
- Homework/classwork: create a Ruby program to read and/or write from a file and/or web (specifics TBD)
- Discuss in chat room/sync meeting
- Modules
- Accepting blocks in methods
- Homework/classwork: either create a simple module to mixin to a class or create a class that mixes in a module (specifics TBD)
- Discuss in chat room/sync meeting
- Week 5:
- Review/catchup from weeks 3-4
- Open classes / monkey patching
- Exceptions
- Homework/classwork: TBD
- Introduction to RubyGems
- Homework/classwork: create a program that requires installing and including a gem (specifics TBD)
- Discuss in chat room/sync meeting
- Week 6:
- Unit testing with Test::Unit
- Homework/classwork: complete the Ruby Koans
- If time allows, high level overview of metaprogramming
- Won't aim for full understanding, but maybe spur some folks to do some research to better understand all that is possible in Ruby
- Topics Intentionally Left Out
- Regular expressions
- The regex operator in Ruby is very convenient, but I don't want to get bogged down trying to teach regular expressions themselves. If a student knows regular expressions or learns them in the future, applying them to Ruby is pretty trivial.
- Threads/fibers
- Advanced topic and not very applicable to the potential follow on Rails course
- Throw/catch
- Not used enough to focus on; trivial to learn later if required
- Duck typing
- I'd like to throw this concept in somewhere, but not sure where yet .. if we don't get to it, I think it'll be OK though