Hi All,
I will be teaching a class called Introduction to Object Oriented Programming with Ruby at Brookline Adult and Community Education this summer. The course should appear on their Web site soon (http://www.brooklineadulted.org/).
Here is my draft outline. I am looking for feedback. Please let me know if you have any ideas on how to improve the outline.
Introduction to Computer Programming with Ruby
Course Outline
Week 1: What is Object-Oriented Programming?
- What is an object?
- What are the 3 programming paradigms?
- How is object-oriented programming different from the other two paradigms?
- The history of Ruby
- Installing Ruby
- Interactive Ruby (IRB)
- Ruby Gems
- require, include and load
Week 2: Classes, Modules and Methods
- Classes, the blueprints of objects
- Classes as objects
- Making an object out of a class
- Modules, functionality to add to classes and objects
- Dynamic vs. static typing
- Strings and numbers
- Methods, the verbs of the object-oriented world
- Object-dot notation
- Passing parameters into methods
- The return value of a method
- Method chaining
Week 3: Collections, the self Object and Flow Control
- The Array class
- The Hash class
- self
- Iterators
- do loops
- for loops
Week 4: Inheritance, Encapsulation and Polymorphism
- What is inheritance?
- How is it useful?
- Can it be overused?
- What is encapsulation?
- Why is it a good thing?
- What is polymorphism?
- Polymorphism in Ruby
Week 5: Logging and Input/Output
- Logger
- Log4r
- Reading in various kinds of input
- Writing out text output, HTML output
Week 6: Exceptions
- Handling unexpected conditions in an object-oriented program
- Raising exception
- Dealing with exceptions
Week 7: Testing
- Test Driven Development (TDD)
- Behavior Driven Development (BDD)
- Test::Unit
- RSpec
- Shoulda
- Cucumber
Week 8: Next Steps
- Next steps
Friday, March 6, 2009
Sunday, February 22, 2009
Tom found a meeting place in Central Square
Hi All,
Tom Marx, through the extraordinary effort of calling dozens of churches in Central Square, has found us a place to meet.
There's a church on Columbia Street, probably just a 5 minute walk from Sidney Street, that is willing to rent us a room for $30 a night. The room has a blackboard and is available at our regular meeting time.
We tried meeting via Skype once and I thought that it went pretty well. It also had the advantage of allowing our former colleague (and current UMass graduate student) Boxun to join us. Unfortunately, many of the usual students were unable to make it. It seems that the time and medium were not necessarily conducive to keeping this class going. Plus, I feel that though it's nice to have the option to meet in cyberspace if we need to, there is no substitute for face-to-face teaching and learning.
That said, I'd like to get a feel for how the group would like to proceed. Does Tuesday night at 4:30 in Central Square still work for most of us? Or is the Skype option better? Please let me know via comment to this posting which you prefer.
Thanks!
Glenn
Tom Marx, through the extraordinary effort of calling dozens of churches in Central Square, has found us a place to meet.
There's a church on Columbia Street, probably just a 5 minute walk from Sidney Street, that is willing to rent us a room for $30 a night. The room has a blackboard and is available at our regular meeting time.
We tried meeting via Skype once and I thought that it went pretty well. It also had the advantage of allowing our former colleague (and current UMass graduate student) Boxun to join us. Unfortunately, many of the usual students were unable to make it. It seems that the time and medium were not necessarily conducive to keeping this class going. Plus, I feel that though it's nice to have the option to meet in cyberspace if we need to, there is no substitute for face-to-face teaching and learning.
That said, I'd like to get a feel for how the group would like to proceed. Does Tuesday night at 4:30 in Central Square still work for most of us? Or is the Skype option better? Please let me know via comment to this posting which you prefer.
Thanks!
Glenn
Tuesday, February 17, 2009
Can't make it to Hackfest tonight
Something came up at home, can't make the Hackfest tonight.
For those of you who want to go, it's actually in Cambridge this week, not far from us. Check out the location at the Boston Ruby Group's web site at http://bostonrb.org/.
Thanks,
Glenn
For those of you who want to go, it's actually in Cambridge this week, not far from us. Check out the location at the Boston Ruby Group's web site at http://bostonrb.org/.
Thanks,
Glenn
Sunday, February 15, 2009
No Ruby class on February 17th, Hackfest instead
Hi,
I will not be holding class on Feb. 17th. I am considering going to the Hackfest in Boston instead.
Please let me know via comment to this blog if you are interested in joining me at the Hackfest.
Thanks,
Glenn
I will not be holding class on Feb. 17th. I am considering going to the Hackfest in Boston instead.
Please let me know via comment to this blog if you are interested in joining me at the Hackfest.
Thanks,
Glenn
Tuesday, February 10, 2009
The Ruby Group is on for tonight
We are planning to meet over the Internet starting on Skype at 7:00 tonight. The class will probably go to 8:30.
If you are planning to attend tonight, please let me know via email (or, better yet, post a comment to this post). I would need to know your Skype name. If you don't have a Skype name, you can gt one at www.skype.com.
The topic for tonight is Test::Unit, Ruby's built-in testing framework.
Hope to see you all tonight!
Thanks,
Glenn
If you are planning to attend tonight, please let me know via email (or, better yet, post a comment to this post). I would need to know your Skype name. If you don't have a Skype name, you can gt one at www.skype.com.
The topic for tonight is Test::Unit, Ruby's built-in testing framework.
Hope to see you all tonight!
Thanks,
Glenn
Sunday, February 8, 2009
Topic for the next session: Test::Unit
Hi,
I am planning to go over Test::Unit in the next session.
Test::Unit is the basic testing framework that is built into Ruby. There are other frameworks for testing that are probably better (RSpec, Shoulda), but I figured that Test::Unit would be a good place to start.
There is a program that I found in a excellent introductory book called the Ruby Visual QuickStart Guide written by a guy named Larry Ullman. The program is called testing.rb, and it's in a zip file at the following link:
http://www.dmcinsights.com/ruby/downloads.php.
The link for the zip file is towards the bottom of the screen and a bit to the left. Once you unzip the file, you'll file the testing.rb file in the scripts/11 folder.
I recommend taking a look at the program before the session this week. Basically, it's a program with a Rectangle class with an initialize method that defines a rectangle. Pretty basic stuff that the regulars to the Ruby sessions should be familiar with. There is also another class in there which will be new to most of you. It's the TestRectangle class, and it is a subclass of Test::Unit::TestCase. There are various assertions in TestRectangle. Assertions are what the tests are called. If you execute the program, the tests in TestRectangle are executed and the results are written to the console. There are 3 tests, 11 assertions, 0 failures and 0 errors in this example.
To understand what is going on in TestRectangle, I recommend messing with the code a bit. If you change the code on line 35 to:
assert(Rectangle.new(6, 6.1).is_square?)
you will get an failure as expected, because the inputs to Rectangle are not equal, and therefore the shape created is not a square.
You can even mess with the code in the Rectangle class. For example, if you change line 15 to:
(@height + @width) * 2.1
you will get a failure because the perimeter method is no longer correct.
See you (via the Internet) at the next session.
Thanks,
Glenn
I am planning to go over Test::Unit in the next session.
Test::Unit is the basic testing framework that is built into Ruby. There are other frameworks for testing that are probably better (RSpec, Shoulda), but I figured that Test::Unit would be a good place to start.
There is a program that I found in a excellent introductory book called the Ruby Visual QuickStart Guide written by a guy named Larry Ullman. The program is called testing.rb, and it's in a zip file at the following link:
http://www.dmcinsights.com/ruby/downloads.php.
The link for the zip file is towards the bottom of the screen and a bit to the left. Once you unzip the file, you'll file the testing.rb file in the scripts/11 folder.
I recommend taking a look at the program before the session this week. Basically, it's a program with a Rectangle class with an initialize method that defines a rectangle. Pretty basic stuff that the regulars to the Ruby sessions should be familiar with. There is also another class in there which will be new to most of you. It's the TestRectangle class, and it is a subclass of Test::Unit::TestCase. There are various assertions in TestRectangle. Assertions are what the tests are called. If you execute the program, the tests in TestRectangle are executed and the results are written to the console. There are 3 tests, 11 assertions, 0 failures and 0 errors in this example.
To understand what is going on in TestRectangle, I recommend messing with the code a bit. If you change the code on line 35 to:
assert(Rectangle.new(6, 6.1).is_square?)
you will get an failure as expected, because the inputs to Rectangle are not equal, and therefore the shape created is not a square.
You can even mess with the code in the Rectangle class. For example, if you change line 15 to:
(@height + @width) * 2.1
you will get a failure because the perimeter method is no longer correct.
See you (via the Internet) at the next session.
Thanks,
Glenn
Subscribe to:
Comments (Atom)