Syllabus
Note (2-Sep-2009: The sequencing of the Rails lectures is pretty firm, but there will be some tweaks.
Overview
“Building Web-Based Software with Ruby and Ruby on Rails” is a thorough introduction to Ruby and Ruby on Rails, focusing especially on the Rails sweet spot: Rapid prototyping and iterative development. The course culminates in the design and implementation of a web-based software product of the student’s specification and design.
Pre-requisites
We assume that you already know at least one higher-level object-oriented language (Java, C, C++, C#, VB, (sophisticated) Perl…), have done some web development, and understand the relational database model. Web development is essentially the simultaneous orchestration of multiple skills; if you are significantly weak in your solid understanding of at least one programming language, how the web works, or databases, you will have a difficult time with the course.
To see last year’s syllabus, click here
Required texts
PR: Programming Ruby 1.9 (Amazon); AWDR: Agile Web Development with Rails, 3rd edition (Amazon). Only these editions are acceptable. You can buy PDF versions at the Programatic Bookshelf.
NOTE: I have just learned (12-Aug-2009) that the Pragmatic Bookshelf has graciously offered us a coupon for 35% off which will apply to print copies or PDFs or both. We will e-mail the coupon to registrants.
Assignments and Grading
See the Assignments page.
Schedule
Our schedule has two phases: First, a four-week introduction to Ruby; then the rest of the course is devoted to Rails.
Ruby
3-Sep. Lecture 1: Introduction; irb; ri; the “Hello, world!” application; Numbers, Strings; Symbols, Regexps; Arrays and Hashes; basic iteration. Diagnostic quiz.
Read before class (so you’re already a bit behind): Programming Ruby 1.9 (PR), chaps. 1, 2 (skim), 6, 7, 4 (just pp. 47-54). Please also read corresponding sections in Chapter 22, “The Ruby Language.” Note: You may also find useful the chapter “Introduction to Ruby” in AWDR.
NOTE: About the sequence of the lectures and the chapter readings: While the chapters might seem to be out of order, what we’re doing is following the sequence (more or less) from the Ruby.new chapter.
Please review Assignment 1, which we will be handing out. We think this assignment is eminently doable (and, based on prior years, highly rewarding), but we want you to look at it right away because 13-Sep. is Harvard’s last day to withdraw with a full tuition refund, and we want to make sure to give you the chance to get a feel for the course’s difficulty.
Before or on 14-Sep., Due: Assignment 0 (System Setup). Get this done as soon as possible.
10-Sep. Lecture 2: Control structures; iterators and blocks.
Read: PR: Chaps. 2 (re-read), 4, 9. Please also read corresponding sections in Chapter 22, “The Ruby Language.”
Monday, 14 Sep.: Due: Assignment 0 (System Setup).
17-Sep. Lecture 3: More on blocks; iterators; yield; classes and object instances; inheritance, scope, access control, visibility; modules.
Read: PR: Chaps. 3, 5, 23. Please read corresponding sections in Chapter 22, “The Ruby Language.”
24-Sep. Lecture 4: Exceptions, hooks; eval; monkey-patching. Testing and test-driven development.
Read: PR: Chaps. 10, 24, 13.
Monday, 28-Sep.: Due: Assignment 1 (One-Liners).
Rails
1-Oct. Lecture 5: MVC; DRY. A sample application.
Read: Agile Web Developer with Rails (AWDR), chaps. 4, 5, 6, 7, 14.
8-Oct. Lecture 6: ActiveRecord: The Basics
Read: AWDR: Chaps. 17, 18.
Monday, 12-Oct.: Due: Assignment 2 (Classes and Methods). Now due 19-Oct.
15-Oct. Lecture 7: ActionPack and the request cycle. Forms and models.
Read: AWDR: Chaps. 22, 23 (read “How Forms Work” and “Forms that Wrap Model Objects” until you understand these sections thoroughly).
Monday, 19-Oct.: Due: Assignment 2 (Classes and Methods).
22-Oct. Lecture 8: More on ActiveRecord.
Read: AWDR: Chaps. 19, 20.
Monday, 26-Oct: Due: Assignment 3 (Standalone ActiveRecord). Now due before 11:59 PM EST, Wed., Oct. 28.
29-Oct. Lecture 9: More on controllers and views. Routing.
Read: AWDR: Chap. 21.
5-Nov. Lecture 10: Ajax. ActiveRecord, ActionController, ActionView topics; start on REST.
Read: AWDR: Chap. 26.
Monday, 9-Nov.: Due: Assignment 4 (Models, Controllers, and Views). Now due 23-Nov.; see below!
12-Nov. Lecture 11: ActionMailer. Plugins: Authentication, uploading. More on form handling; more on REST. Some ActionMailer.
Read: AWDR: Chap. 25.
19-Nov. Lecture 12: REST. Ajax.
Read: Chap. 24.
19-Nov.: Due: Final project proposal.
Monday 23-Nov.: Due: Assignments 4 and 5. If you hand in Assignment 4 early, we will try to get comments back to you. Also, automatic extension to Wed., 25-Nov.
26-Nov. No class.
3-Dec. Panel of local Rubyists.
10-Dec. Lecture 13: Caching. Background tasks. Deployment strategies.
17-Dec. No class: Final project due.
I am intending to take the course in distant learning from Zurich (Switzerland), so I have a few additional questions:
1) Will there be live web-conference courses and on what time (timezone)? Is it required to attend them or are the (time-independent) videos sufficient?
2) Will there be exams, midterms, etc. for which I will need to organize proctoring or will it be possible to perform the grading requirements at home (since I would like to take the course for credit)?
The schedule sounds exciting and I would be thrilled to attend.
Thanks and Kind Regards from Zurich,
Gabriel
Gabriel,
(1) There will be live web conferencing for sections. They'll be EST (UTC -5). They are not required. There will likely be three sections, on Thursdays at 5:30 PM and 6:30 PM, and some other time. We do not record the sections, because we want people to attend. All lectures are recorded. You can watch the lectures live or recorded. It is not likely that I can easily find a time that matches up with any specific needs, but tell me what works anyway.
(2) You will not need a proctor because there is no final exam (only a final project).
Hi,
I'm already registered for this course. Real excited to start it! Are we going to be using Ruby 1.9? I figure from the suggested text that we are. It's just that i've been having difficulty installing the mongrel gem with 1.9 installed. Also, you mentioned that sections would not be recorded. For some reason I was under the impression that they would be because of the distance learning students as myself (I'm from Toronto). How will we be able to participate in the sections then?
I am in Distance Education, and currently ramping up for this class. I was wondering what platforms that lectures would be presented in (Windows, Mac, Linux, etc.). I am currently running Mac OSX and Windows 7, but not sure what would be the best setup to enable me to follow along with in class examples. I saw in last years discussion that you recommend a text editor and the most basic tools, such as reading the stacks on the command line. Are there any early suggestions on my basic configuration, so that I can get a little head start?
Lateral Punk and Jeff Ancel,
As it happens, I'm working on screencasts for setup on Windows and Max OS/X right now.
A few answers:
Ruby version:
Yes, we will be using Ruby 1.9. For Windows, your best bet is the "preview2" version of the one-click installer for Ruby 1.9, which is here: http://rubyforge.org/frs/?group_id=167&release_id=38052
For Mac OS/X and Linux, I would recommend an installation from source.
Mongrel:
You can skip the Mongrel gem. Webrick is faster under 1.9.
My platform:
I'll be using Max OS/X in lecture. The editor I will be using is TextMate, but any text editor will do (truly).
John
@Lateral Punk
If you are trying to get ruby and ruby on rails setup on debian lenny, this link helped me a lot:
http://aimee.mychores.co.uk/2008/09/14/post/331/installing-ruby-on-rails-on-debian-lenny
As the blog post suggests: do not use the aptitude versions!
@john
Do you have any response to my section concern?
@Lateral Punk
What we do in this course is schedule sections at a couple of times. The section leader will meet with students who are present in person, and there will be a phone link for distance students. Additionally, the teaching assistant will use screen-sharing software, so that you can see everything that the TA is doing. This "hybrid" approach to distance education has been successful for us in the past.
If we get enough enrollment, there will also be a section that is only for the distance students: Stay tuned.
I will definitely be taking at least the beginning part of the class as distance learning, and possibly all of it. I'm fortunate to be in the EST timezone, but I would find it very helpful to view the sessions "offline" if that becomes an option.
Jim
I just ordered the books for this course from the the Programatic Bookshelf, using the discount code that was sent to use via email. I did indeed receive the advertised discount, while I was there I picked up a few other books and the discount was applied to them as well.
The lectures will be available in recorded form.
Sections, however, will not be recorded. If we recorded them, no one would go to section. :-(
As someone who plans on taking this course via distance ed (from the suburbs of DC), the lack of a distance ed section is disappointing. But it does lead me to two follow up questions. Is there a possibility of offering a live streamed (non recorded) session, similar to what was offered in CSCI E-12 when I took a few years ago?
My second follow up is to ask when sections are planned on being held as I may have the opportunity make a few, very brief, trips up to the Boston area over the next few months, I would like to know when sections might be to see if any of these trips can be tweaked to include a section.
@Ken Vedaa
I said only that sections won't be recorded.
We are providing sections to distance students: They are hybrid in-person/distance sections. The teaching assistant will have a shared phone line or VOIP, and will be screen-sharing, so you will see everything that the TA is doing on his screen. We have found that providing the same section to both in-person and distance students to be very effective.
Sections will be at 5:30 PM and 6:30 PM on Thursday (before the lecture, which will be streamed live, as well as recorded). Additionally, there will be an extra "drop-in" section on Sundays, probably at 2 PM or 3 PM; I'll be hosting that section 1/2 of the time, with the TA's rotating for the other half.
Professor,
Thank you for correcting my incorrect assumption regarding the sections, and for the info regarding the section times.
Hi,
I am wondering if I have enough experience for this course. I have taken E75, E153, and E12 getting an A, A, and A- respectively, in the last year and a half. I also took E-50A and B (Java I and II) prior to the previous three. I do not do any programming at work (most of the programming I've done has been in class) - except for a little JavaScript, PHP, reports formula language - maybe 20% of my workload. I do have a database and SQL background however.
My goal is to become a proficient web programmer so I can do more of that at work and less of the stuff I don't like.
Your opinion is appreciated.
Thanks.
You sound like you're in a good situation for the course.
The three areas where we expect experience are: Object-oriented programming (you have that with your Java), relational databases / SQL (you have that), and some web dev (you have that with your PHP). So you're in good shape.
Our concern is when one has two or more deficits. That is, if you have some Java and web development, but no SQL, you should be able to pick it up; ditto for SQL and web dev with a lack of much programming with classes, inheritance, etc. But if you've only done SQL, no web dev, and no programming, it's going to be tough.
I would like to do the reading for today's class, but don't want to purchase the ebooks until I get the 35% off coupon. How can I snag one of those? Much obliged!
Daniel, everyone: I've sent the coupon to e-mail addresses in the Harvard system -- if you've joined the class very recently, or are using a different e-mail, you probably haven't gotten it.
I'll send the e-mail again this evening; or you can e-mail me at john at 7fff dot com : If you e-mail me personally, you should include your name as Harvard knows it, because I will have to look you up in the course roster.
I don't think the page numbers of the PDF are the same as the printed version. I'm reading the PDF now, and pages 47-54 of the PDF are part of chapter 2, not chapter 4.
@Ron Newman
I'll check after lecture tonight. If this is the case and I need to refer to pages, I'll refer to both sets (unless everyone turns out to be using the PDF).
The ruby examples in the second half of the 1st lecture aren't working on my system. The firefox (3.5) error console reports:
Error: document.RubyApplet.evalRuby is not a function
Source File: file:///home/bmccann/docs/Harvard/E168/L/1/finished/support/additional/ruby-control.js
Line: 24
Do we have to install Jruby explicitly to use the lecture presentation ruby examples? And, if so, do you have directions? I tried the procedure at http://leonardom.wordpress.com/category/linux/ubuntu without success.
@Ben
Ben, you should not need to intall JRuby -- notice that the interactive slides are a "nice to have," but we do not promise that it will work on every system.
Having said that:
-- What is your operating system? (Windows, OSX, Linux)? Sounds like you're on Linux.
-- Do you have Java installed? (to check, try java -version from the command line)
Also, do you have Java enabled in your browser? (See the 'Content' tab in Firefox preferences). If you don't have Java enabled, you'll get exactly the error that you reported here -- I just now tried it.
This is too weird. The inline ruby (in the lecture notes) fails on my laptop running Ubuntu 9.04 (32-bit). Java is installed and enabled. The inline ruby *is* working my desktop which is Ubuntu 9.04 (64-bit). I have no idea why one works but the other doesn't but its not critical.
Thanks for your help.
@Ben
I will check that out.
You can always copy-and-paste the code into irb or into a program and try it that way . . .
@Ben
I notice in the html that it has a class on the dom element 1(runnable) and 2(irb). It works fine on my system and here (Mac OSX) I can access IRB by typing irb in the command line/terminal. Does your system use irb as the access to the inline ruby command?
@Jeff Ancel
It's all done through embedded JRuby - the system Ruby is not involved at all.
@Ben
On your 32-bit machine, change your directory to support/OTS/ruby-in-browser (in the download) and do:
java -cp lib/jruby-complete.jar:lib/ RubyApplet
Does it print 1.9.1? Or raise an exception?
It printed 1.9.1.
I have one CPU that works, and I can use IRB on the other, so I'm happy. There's no need (from me) to keep digging unless you want to keep investigating. If so, let me know.
Actually, I'll be bringing the laptop to the recitation tomorrow so if anyone wants to poke around, I'd be happy have them look around,
@Ben
Ben: Since it printed 1.9.1 (and worked normally from the command line) it means that something is screwed up in your browser. So I would review my browser version carefully.
I have Firefox 3.5.2 and Google Chrome 4.0.0 (latest beta) installed and both fail to find the function 'evalRuby'. For example, in chrome, I get:
Uncaught TypeError: Object # has no method 'evalRuby'
I see similar errors in Firefox. Anyhow, I give up. I'll use IRB.
Is there a release date for Assignment 3?
@Jeff Ancel
Soon.
I missed the class for the fall semester is this class going to be offered again? I am interested in taking the class.
Thanks!
@Uma
The course is usually offered in the Fall only, but the next class may be deferred to Spring, 2011, because I am considering having the class be Rails only (no Ruby), and the Ruby would go into a new "January Session" six-week course.
Thanks John!
Six Weeks course in Jan will be Jan 2010 or the year after? if in 2010, I am very much interested in enrolling, I don't see it listed for 2010 classes. Can you please let me know when the enrolment would start?
Thanks!
@Uma
2011. I don't have enough time to work up a January session course.
If I do it, it will probably be 2 credits (which may be a problem for ALM students).
The core ideas would be:
1. Three weeks, meeting twice a week (so six meetings), each meeting 3 hours
2. Combination of lecture and in-class learn-by-doing
3. Possibly paired programming
4. Emphasis on testing
5. Going pretty deep into Ruby; the current course seems to produce good, solid, basic Ruby developers, but this course could get into metaprogramming, using C in Ruby, topics like that
Isn't January term only 3 weeks long?
@Ron Newman
Oops, sorry, six MEETINGS.
@Ron Newman
In any case, it will be exhausting for all parties, but I think it's time to split Ruby off from 168. Meanwhile, I would be helping Harvard would record everything, so that for Ruby newbies in 168, one would say: Go check out the videos.
The 4-credit January session courses meet 4 times/week for 3 hours each time. That seems kind of crazy to me. I honestly can't see how Harvard imagines that working people would be able to teach such a class -- might be a good topic to bring up on extensionstudent.com . . . I am not really sure how these January courses can be viable.
I have let some other instructors in CSCI know that we should have more 2-credit courses, which would be key for the ALM students.
Thanks John!. I really look forward for the next session. But, 4-credit session meeting 3hours will need lot of energy after a long day work!
@Uma
If I was unclear, the Ruby course would NOT be a full 4-credit course. It would be two credits -- meeting two nights a week, each night for 3 hours.
Still, a lot I think.