[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Getting my sister to learn programming

Morton Goldberg

2/12/2007 12:42:00 AM

On Feb 11, 2007, at 7:56 AM, SonOfLilit wrote:

> Hello fellow Rubyists,
>
> I've just come back from a trip home* and was surprised to find my
> sister
> very enthusiastic about programming and wanting to continue our
> lessons.

...

> I guess I should state my intentions first, so here they are:
> * I want it to always stay interesting and intellectually
> stimulating for
> her. I want her to want to discover new things and be able to (this
> also
> speaks of documentation. QBASIC, my first language, had the best
> documentation-in-IDE I've ever used, since it was so small and F1
> would get
> you to what you wanted, always, with examples. But QBASIC had an
> advantage
> that what I teach will not have: it didn't need to interact with
> the outside
> world)
> * I want her to be able to continue on her own as quick as possible
> * I want her to emphasize on abstraction as a means of solving
> problems
> * I want her to be able to interact with the outside world

I think Logo is great as a first computer language. There are some
Logos available today that let one do some really neat stuff. They
usually have really good documentation written by people who really
understand the needs of beginning programmers. Google "Brian Harvey
+Logo".

I also think Ruby with turtle graphics added would be good way to
start. We recently did a Ruby Quiz where the problem was to add
turtle graphics to Ruby. I've found that with this add-on it's easy
to translate Logo code into Ruby. If you would like to try it, I'll
send you the complete Ruby turtle graphics kit with a bunch of Logo
programs I've translated into Ruby (direct to your e-mail address --
its too much to post here).

One advantage of Ruby with turtle graphics is that after the initial
lessons with the turtle, you can go off into more advanced
programming in any direction you want. The main disadvantage is that,
compared to Logo, there is relatively little in documentation/
tutorials for entry-level programmers.

Regards, Morton

4 Answers

Brian Candler

2/12/2007 9:00:00 AM

0

On Mon, Feb 12, 2007 at 09:42:19AM +0900, Morton Goldberg wrote:
> I also think Ruby with turtle graphics added would be good way to
> start. We recently did a Ruby Quiz where the problem was to add
> turtle graphics to Ruby. I've found that with this add-on it's easy
> to translate Logo code into Ruby. If you would like to try it, I'll
> send you the complete Ruby turtle graphics kit with a bunch of Logo
> programs I've translated into Ruby (direct to your e-mail address --
> its too much to post here).

How about sticking it up on rubyforge?

I asked exactly the same question a couple of years ago,
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-t...

A reply pointed to
http://onestepback.org/packages/ru...

but I've not tried it.

The advantages I can see in teaching Ruby are that it's a language you can
do real work in; it's easy to install; and it's sufficiently "normal" that
normal people don't have to work hard to read your code (unlike, say, LISP)

At least the basic syntax is clean. I know there are skeletons lying in the
cupboard for the more advanced Rubyist to trip over, but by that stage
they're probably hooked anyway :-)

Cheers,

Brian.

Brian Candler

2/12/2007 9:37:00 AM

0

On Mon, Feb 12, 2007 at 08:58:41AM +0000, Brian Candler wrote:
> A reply pointed to
> http://onestepback.org/packages/ru...

I've tried it now. It works exactly how I was hoping:

$ irb1.8 -rtkturtle
irb(main):001:0> include TurtleGraphics
=> Object
irb(main):002:0> fred = Turtle.new
=> Turtle(0,[0,0])
irb(main):003:0> fred.pendown
=> nil
irb(main):004:0> 3.times { fred.forward 100; fred.turn 120 }
=> 3

The included examples all work, although the test suite generates a few
parser warnings (possibly meaning it was written for ruby 1.6)

However I love the following stanza from testturtle.rb:

require 'mock'
require 'turtle'

Nice one Jim :-)

Regards,

Brian.

Morton Goldberg

2/12/2007 7:40:00 PM

0

On Feb 12, 2007, at 3:59 AM, Brian Candler wrote:

> On Mon, Feb 12, 2007 at 09:42:19AM +0900, Morton Goldberg wrote:
>> I also think Ruby with turtle graphics added would be good way to
>> start. We recently did a Ruby Quiz where the problem was to add
>> turtle graphics to Ruby. I've found that with this add-on it's easy
>> to translate Logo code into Ruby. If you would like to try it, I'll
>> send you the complete Ruby turtle graphics kit with a bunch of Logo
>> programs I've translated into Ruby (direct to your e-mail address --
>> its too much to post here).
>
> How about sticking it up on rubyforge?

Here are few reasons why not:

1. It's already available (except for some of my Logo translations)
from Ruby Quiz.
2. I haven't the slightest clue on how to put something on rubyforge.
3. My very limited understanding of rubyforge is that if I post
there, I become responsible for maintaining what I post. I can't do
that with the turtle graphics kit because it's only partly my code.

Regards, Morton

P.S. It Ruby Quiz 104. The url is <http://www.rubyquiz.com/inde....


Morton Goldberg

2/12/2007 7:48:00 PM

0

On Feb 12, 2007, at 4:36 AM, Brian Candler wrote:

> On Mon, Feb 12, 2007 at 08:58:41AM +0000, Brian Candler wrote:
>> A reply pointed to
>> http://onestepback.org/packages/ru...
>
> I've tried it now. It works exactly how I was hoping:
>
> $ irb1.8 -rtkturtle
> irb(main):001:0> include TurtleGraphics
> => Object
> irb(main):002:0> fred = Turtle.new
> => Turtle(0,[0,0])
> irb(main):003:0> fred.pendown
> => nil
> irb(main):004:0> 3.times { fred.forward 100; fred.turn 120 }
> => 3
>
> The included examples all work, although the test suite generates a
> few
> parser warnings (possibly meaning it was written for ruby 1.6)
>
> However I love the following stanza from testturtle.rb:
>
> require 'mock'
> require 'turtle'

The Ruby Quiz turtle graphics kit is more Logo-like. One can write in
the style of your example or one can write (using Logo short form
commands)

Turtle.new.run { fd 100; rt 120 }

or (using Logo long form commands)

Turtle.new.run { forward 100; right 120 }

It was written and tested with Ruby 1.8.

Regards, Morton