[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby Curriculum for coworkers

Sam Smoot

12/28/2005 3:42:00 PM

I've been tasked with coming up with a curriculum for Rails coworkers.
I was hoping you guys might have some tips to share on how I might go
about this.

Also, any information on formal Ruby or Rails courses (preferrably in
the Plano/Dallas, TX area) such as pricing, skill level, etc would be
appreciated since the assumption right now is that .NET training will
be cheaper for a comparable course.

And if we can persuade Dave Thomas to come out for a day for... lets
see... I've got $20 and a stick of unchewed gum in my pocket... ;-) No
seriously, if there are any skilled trainers/evangelists we can have
come out for a marketing/training blitz for a day I'd love to attempt
to work out a budget.

Anyways, here's my 5-minute attempt at a curriculum. No times or
anything down yet:

1: Install Ruby
2: Go through the TryRuby.Hobix tutorials
3: Read the Ruby Book
3a: Read the Rails book for web development (if applicable)
4: Install Subversion and Eclipse (with Ruby Development Tools) and
recieve basic training
5: Write a series of simple programs (To Be Determined)
6: Code Review and Optimization of task programs
7: (Minor) Code Review and Optimization of existing Ruby projects
8: Review Rails based project (for Web Development) (if applicable)
9: Create Rails based project for simple time-tracking/ticket system
(if applicable)

One of the coworkers is going to be learning Ruby, and the other is
going to be more Rails focused. I don't think it's necessary for the
first to learn Rails, but I'd like the second to get as good a handle
on Ruby in addition to Rails as I can offer.

I'd like to think I and a coworker are pretty decent Rubyists, and one
on one I think I can get the message across with an eager learner, but
I'm anticipating a less than eager reception, and I'm not very good at
marketing. (Which I think is really key here).

Any and all tips/criticism are appreciated!

13 Answers

Steve Litt

12/28/2005 4:13:00 PM

0

On Wednesday 28 December 2005 10:42 am, ssmoot@gmail.com wrote:
[clip]
> One of the coworkers is going to be learning Ruby, and the other is
> going to be more Rails focused. I don't think it's necessary for the
> first to learn Rails, but I'd like the second to get as good a handle
> on Ruby in addition to Rails as I can offer.
>
> I'd like to think I and a coworker are pretty decent Rubyists, and one
> on one I think I can get the message across with an eager learner, but
> I'm anticipating a less than eager reception, and I'm not very good at
> marketing. (Which I think is really key here).
>
> Any and all tips/criticism are appreciated!

Rather than commenting on the structure of your curriculum, I have some ideas
for how to present that curriculum.

I might have started Ruby 3 years earlier, but was put off by the constant OOP
wardrums of Ruby evangelists. When they touted Ruby as "fully OOP", I read
that as "all OOP all the time" like Java, where you need to create a class to
print "Hello World", and there's really no such thing as a quick and dirty
program.

In teaching these reluctant learners, I would work from the known to the
unknown -- a standard technique for teachers. These people have probably been
hammering C for years -- start by showing them that they can write Ruby the
same way as C, while promising that as time goes on they'll probably want the
advantages only Ruby'esque coding can offer.

Have em start with HelloWorld, then a loop, then an if elsif else. Demonstrate
that most functions are methods of objects, and that integers, floats,
strings and the like are really objects with methods.

With a few programs under their belt, you can say "the stuff you did is the
hardest Ruby you'll ever do. Now let me show you the easy way", and proceed
to show them the real Ruby way of doing things, in each case demonstrate why
the Ruby way is easier.

Personally (Litt dons flameproof suit) I wouldn't stress these long 1 liners
so popular in the Ruby community. There's no shame in using 4 short
statements instead of one long one, and I think the average programmer (not
necessarily Ruby programmer) finds the 4 line version easier to understand.
Remember the complex 1 liners Kernighan and Ritchie used in version 1 of "The
C Language Book"? Weren't they obnoxious? I have the same feeling about long
and complex 1 liners in Ruby.

Show them how beautifully Ruby encapsulates object member data, and yet how
easy it is to reveal them with methods with the same name. Show attr_reader,
attr_writer and attr_accessor. That was a BIG selling point for me. Show them
how, unlike Perl and Python, they have full public, protected and private
methods. Show them how much easier inheritance is in Ruby than in C++. Show
them just how easy it is to make an operator represent a method. Sure, you
can do that in C++, but it's just not as easy.

When you get around to demonstrating blocks:

my_array.each{|element| puts element}

make the point that this feature saved them the need for a confusing callback
routine (pointer to function and the like).

Show them how to use yield() to create a method that can take a block.

HTH

SteveT

Steve Litt
http://www.troublesh...
slitt@troubleshooters.com


James Gray

12/28/2005 4:37:00 PM

0

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.

Also Ruby has no loop equivalent to the famous for(...; ...; ...)
{ ... } construct from most other languages.

> 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.

James Edward Gray II


Robert Klemme

12/28/2005 4:44:00 PM

0

Steve Litt <slitt@earthlink.net> wrote:
> On Wednesday 28 December 2005 10:42 am, ssmoot@gmail.com wrote:
> [clip]
>> One of the coworkers is going to be learning Ruby, and the other is
>> going to be more Rails focused. I don't think it's necessary for the
>> first to learn Rails, but I'd like the second to get as good a handle
>> on Ruby in addition to Rails as I can offer.
>>
>> I'd like to think I and a coworker are pretty decent Rubyists, and
>> one on one I think I can get the message across with an eager
>> learner, but I'm anticipating a less than eager reception, and I'm
>> not very good at marketing. (Which I think is really key here).
>>
>> Any and all tips/criticism are appreciated!
>
> Rather than commenting on the structure of your curriculum, I have
> some ideas for how to present that curriculum.
>
> I might have started Ruby 3 years earlier, but was put off by the
> constant OOP wardrums of Ruby evangelists. When they touted Ruby as
> "fully OOP", I read that as "all OOP all the time" like Java, where
> you need to create a class to print "Hello World", and there's really
> no such thing as a quick and dirty program.
>
> In teaching these reluctant learners, I would work from the known to
> the unknown -- a standard technique for teachers. These people have
> probably been hammering C for years -- start by showing them that
> they can write Ruby the same way as C, while promising that as time
> goes on they'll probably want the advantages only Ruby'esque coding
> can offer.

Although this might be a good move from a pedagogical perspective I feel a
bit uncomfortable about encouraging people to write Ruby like they write
C... :-)

> Have em start with HelloWorld, then a loop, then an if elsif else.
> Demonstrate that most functions are methods of objects, and that
> integers, floats, strings and the like are really objects with
> methods.
>
> With a few programs under their belt, you can say "the stuff you did
> is the hardest Ruby you'll ever do. Now let me show you the easy
> way", and proceed to show them the real Ruby way of doing things, in
> each case demonstrate why the Ruby way is easier.
>
> Personally (Litt dons flameproof suit) I wouldn't stress these long 1
> liners so popular in the Ruby community. There's no shame in using 4
> short statements instead of one long one, and I think the average
> programmer (not necessarily Ruby programmer) finds the 4 line version
> easier to understand. Remember the complex 1 liners Kernighan and
> Ritchie used in version 1 of "The C Language Book"? Weren't they
> obnoxious? I have the same feeling about long and complex 1 liners in
> Ruby.

I'm all with you. There's especially one idiom that makes me wonder why
people use it so often:

if ( foo = calculate_something() ) {
....
}

over

foo = calculate_something()
if ( foo ) {
....
}

It's reasonable to do it in a while loop because that often gives elegant
code by avoiding redundancy:

while ( ( item = io.read() ) != EOF ) ...

but I can't see a reason to do it with simple if statements.

> Show them how beautifully Ruby encapsulates object member data, and
> yet how easy it is to reveal them with methods with the same name.
> Show attr_reader, attr_writer and attr_accessor. That was a BIG
> selling point for me. Show them how, unlike Perl and Python, they
> have full public, protected and private methods. Show them how much
> easier inheritance is in Ruby than in C++. Show them just how easy it
> is to make an operator represent a method. Sure, you can do that in
> C++, but it's just not as easy.
>
> When you get around to demonstrating blocks:
>
> my_array.each{|element| puts element}
>
> make the point that this feature saved them the need for a confusing
> callback routine (pointer to function and the like).

But please use another example because this code is much easier written
"puts my_array". :-)

> Show them how to use yield() to create a method that can take a block.

Yeah!

Kind regards

robert

Steve Litt

12/28/2005 4:54:00 PM

0

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.

>
> 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

ss = 4
while ss > 0
puts ss
ss -= 1
end

The preceding are constructs they've seen in every language. Armed with these
two loops, it is now a perfect time to introduce object.each(){}, introducing
both iterators and blocks. Now show him how much more can be done with
object.each(){}. IMHO the important thing is to move from the known to the
unknown.

>
> > 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.

SteveT

Steve Litt
http://www.troublesh...
slitt@troubleshooters.com


Sam Smoot

12/28/2005 5:02:00 PM

0

Thanks for the well thought out and thought-provoking reply!

>> In teaching these reluctant learners, I would work from the known to the
>> unknown -- a standard technique for teachers.

This is great advice and I'll be sure to give it a lot more
consideration.

>> These people have probably been hammering C for years

This is my fault for not being very clear. Actually the target audience
is an ASP/VBScript programmer, and a SQL developer who has focused on
Microsoft SQL Server 2000's DTS package development for the past few
years.

The mandate is that something is going to change. C# is up for
evaluation. Having done a lot of C#, used NHibernate, Aspect#, ASP.NET,
went to MonoRail, and then to Ruby and Rails, I'm very pro-Ruby.
Technically I suppose anything is up for evaluation, so we could throw
Java in the mix, but I don't see much reason to muddy the waters.

Naturally the more tools available the better IMO, and I plan to use C,
C++, C#, etc in the future, but I'm trying to make a focused effort
here and keep it simple.

James Gray

12/28/2005 5:17:00 PM

0

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



Robert Klemme

12/28/2005 5:25:00 PM

0

ssmoot@gmail.com wrote:
>>> These people have probably been hammering C for years
>
> This is my fault for not being very clear. Actually the target
> audience is an ASP/VBScript programmer, and a SQL developer who has
> focused on Microsoft SQL Server 2000's DTS package development for
> the past few years.
>
> The mandate is that something is going to change. C# is up for
> evaluation. Having done a lot of C#, used NHibernate, Aspect#,
> ASP.NET, went to MonoRail, and then to Ruby and Rails, I'm very
> pro-Ruby. Technically I suppose anything is up for evaluation, so we
> could throw Java in the mix, but I don't see much reason to muddy the
> waters.

From what you write it seems MS languages are a better choice than Java as
your people have quite a bit of experience in MS land.

> Naturally the more tools available the better IMO, and I plan to use
> C, C++, C#, etc in the future, but I'm trying to make a focused effort
> here and keep it simple.

I'd leave C and C++ out of the mix if you're not forced to do low level
stuff. C# is powerful enough and it might be a good mix together with Ruby
(as replacement for VB?). OTOH the new VB has some nice features - I heard
it supports native threads now - something that Ruby can't at the moment.

Kind regards

robert

Ezra Zygmuntowicz

12/28/2005 6:41:00 PM

0


On Dec 28, 2005, at 9:02 AM, ssmoot@gmail.com wrote:

> Thanks for the well thought out and thought-provoking reply!
>
>>> In teaching these reluctant learners, I would work from the known
>>> to the
>>> unknown -- a standard technique for teachers.
>
> This is great advice and I'll be sure to give it a lot more
> consideration.
>
>>> These people have probably been hammering C for years
>
> This is my fault for not being very clear. Actually the target
> audience
> is an ASP/VBScript programmer, and a SQL developer who has focused on
> Microsoft SQL Server 2000's DTS package development for the past few
> years.
>
> The mandate is that something is going to change. C# is up for
> evaluation. Having done a lot of C#, used NHibernate, Aspect#,
> ASP.NET,
> went to MonoRail, and then to Ruby and Rails, I'm very pro-Ruby.
> Technically I suppose anything is up for evaluation, so we could throw
> Java in the mix, but I don't see much reason to muddy the waters.
>
> Naturally the more tools available the better IMO, and I plan to
> use C,
> C++, C#, etc in the future, but I'm trying to make a focused effort
> here and keep it simple.
>
>


Hey-

I wrote a very simple primer for ruby blocks for iterators and how
yield works with a method for some people at sitepoint.com. It might
be of interest: http://www.sitepoint.com/forums/showt...
t=329378

Cheers-
-Ezra


Steve Litt

12/28/2005 6:57:00 PM

0

On Wednesday 28 December 2005 01:40 pm, Ezra Zygmuntowicz wrote:

> Hey-
>
> I wrote a very simple primer for ruby blocks for iterators and how
> yield works with a method for some people at sitepoint.com. It might
> be of interest: http://www.sitepoint.com/forums/showt...
> t=329378
>
> Cheers-
> -Ezra

That URL didn't work, even when I pasted the wordwrapped parts together.

SteveT

Steve Litt
http://www.troublesh...
slitt@troubleshooters.com


Dan Diebolt

12/28/2005 7:59:00 PM

0

>That URL didn't work, even when I pasted the wordwrapped parts together.

I have taken to using rubyurl instead of tinyurl:

http://rubyu...

The only problem is that rubyurl does not handle https url correctly.


---------------------------------
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping