On Dec 28, 2005, at 10:54 AM, Steve Litt wrote: > On Wednesday 28 December 2005 11:37 am, James Edward Gray II wrote: >> On Dec 28, 2005, at 10:13 AM, Steve Litt wrote: >>> Have em start with HelloWorld, then a loop... >> >> Hmm, that's a tricky one to me. You really need to nail iterators >> ASAP to become a Rubyist. If you post code here with a loop, odds >> are good we'll start "correcting" it. > > That's precisely my point. I'm advocating some "corretion". If you > start a > non-motivated learner with iterators, he'll bail. The long term > goal is to > turn him into a Rubyist, but the immediate goal is to have him > accept Ruby > enough to learn a couple more things. It's an interesting idea. >> Also Ruby has no loop equivalent to the famous for(...; ...; ...) >> { ... } construct from most other languages. > > for ss in 1...10 > print ss, " Hello\n"; > end 1. That's not a loop. (It's syntactic sugar for the each() iterator.) 2. It's not equivalent to for(...; ...; ...) { ... }. 3. I'm against teaching that at all. ;) > ss = 4 > while ss > 0 > puts ss > ss -= 1 > end If you're looking to go from ugly to pretty, I agree that you've found ugly. ;) >>> Show them how much easier inheritance is in Ruby than in C++. >> >> "Favor composition over inheritance." I think that's even more true >> in Ruby where inheriting the core classes sometimes has surprising >> side effects. > > OK, show em how easy composition is, and how well it can be > encapsulated. > attr_accessor rules. "Push, don't pull." (I'm just full of great quotes today, eh? <laughs>) I think I understand what you're trying to say though... James Edward Gray II