Getting my sister to learn programming

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.

  • Yes, a trip home. I spend most of my life in the dorms of the Israeli
    Institute of Technology (BTW, I’ve heard of other Rubyists there. Would
    a
    RUG be appropriate?)

To those not familiar with the story (previously discussed here), I’ve
tried
teaching my 13-year-old sister programming more than twice. At first, I
used
C and tried to get her to create text adventure games as a way to
interest
her. It simply didn’t work.
Her English isn’t perfect and combined with the C syntax and extra
commands
needed to invoke an editor, gcc and the program, it was too much for her
to
remember at once and she just didn’t like it.

After two or three times I gave up, but lately I gave it one more try,
this
time not touching a computer:

I took a sheet of A4 squared paper and an orange pen (and a ruler,
although I later found no use for it) and taught her turtle graphics in
HEBREW, serving myself as a substitute for an interpreter.
It took about half an hour for her to grasp variables, loops and
control
structures.
We started to talk about programming theory, now that she had enough
theory, and I was amazed to hear her suggesting the abstraction of
functions.

She had to sleep and I had to leave.

A month later, I come back home and find her enthusiastic to learn more.

But now I’m confused over my head with the dilemma of what to teach her
next:

  • C has proven to be a no-go, although it’s what I myself wish I’d
    have
    learned first.
  • Pascal, C++/Java are crossed out for personal opinion.
  • Lisp would be a great environment in which to build on the idea of
    functions as the universal abstraction (and a very very simple syntax is
    a
    huge pro), but reverse-polish is yet one more thing to confuse her with,
    and
    I’m not sure what environment to use within Lisp (some GUI library? a
    turtle-graphics environment? pure text?) and what libraries exist to
    support
    these in ways that would be easy for her to learn.
  • Squeak seems like a really great thing to teach, and Smalltalk a
    great
    language (simple syntax and ideas), but I can’t seem to do useful things
    in
    Squeak myself (perhaps I didn’t find the good resources? If so, could
    someone point me to them?)
  • Other languages people seem to love and I don’t know might include
    one
    more befitting (perhaps Haskell? ML?)
  • I can’t find any advantage to Python over Ruby
  • I’m considering LOGO, esp. after browsing through this text:
    http://www.cs.berkeley.edu/~bh/v1-toc2.html
    My only problem is with interaction-with-the-outside-world.
  • I love Ruby and it is the language I would LIKE to teach, but I have
    a
    few doubts:

    Discoverability would be greatly diminished by her beginners’
    English
    Ruby has a LOT of syntax, which would confuse her
    Lisp and Smalltalk have very simple models underlying code
    interpretation, which make it very easy to grasp how programs are
    executed.
    Lisp has the same model I’ve already explained to her, and Smalltalk’s
    would
    be really simple to explain. Ruby has a very complicated model (well,
    everything is an object or a message, but each certain thing maps to an
    object or a message in a different way to make it the most convenient to
    use.More to the point, not everything LOOKS like an object or a message,
    and
    most things are intentionally disguised to look more like Algol. M-Exps,
    anyone? :stuck_out_tongue: ) that it would be REALLY hard for me to explain to her.
    Thus,
    I’m afraid, I won’t be able to teach her ALL of Ruby (e.g. how to
    metaprogram, how to read code that uses metaprogramming) and she will be
    left knowing only half a language (When I learned Ruby I’ve had
    familiarity
    with how computers execute code on all levels, and thus intuitively
    understanding how ruby code is interpreted was simple, but when I think
    about it, it’s very complicated for someone who isn’t used to think like
    a
    computer)
    Ruby culture, I think, is a lot about making things a programmer
    already knows easier to use (e.g. _why’s Camping or Rails, both of which
    let
    you write Ruby code that translates almost linearly to many other
    languages
    and protocols used in Web D.)

I’m posting this to the Ruby list, of all lists, for a few reasons:

  • I really hope to get responses that convince me to use Ruby
  • Ruby guys know their stuff and aren’t too religious
  • I just like this list
  • This can spawn an interesting discussion on teaching programming to
    beginners, esp. those who aren’t fluent in English

So, what do you think? What language should I teach her, and what should
I
teach her to do with it first?

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

Can’t wait to hear back,

Aur S.

  • Squeak seems like a really great thing to teach, and Smalltalk a great
    language (simple syntax and ideas), but I can’t seem to do useful things
    in
    Squeak myself (perhaps I didn’t find the good resources? If so, could
    someone point me to them?)

There’s a book out that uses Squeak as an introduction to programming:

http://www.apress.com/book/bookDisplay.html?bID=444

I’ve leafed through it a little and it looked very cool. Professor
Ducasse
also maintains a page with free online editions of a lot of classic
Smalltalk books at:

http://www.iam.unibe.ch/~ducasse/FreeBooks.html

Mushfeq.

Yes, but I want to teach her an environment where if she comes to me and
wants to program, say, a GUI, or a game, or a website, I can show her
how.

With Squeak, I haven’t figured out the only simple task I’ve ever tried
to.

That isn’t a good sign…

Aur S.

SonOfLilit wrote:

support
these in ways that would be easy for her to learn.
If you don’t mind switching from Lisp to Scheme, there are lots of great
resources. Scheme is pretty much the ultimate pedagogical/academic
language. I don’t know what, if anything, is available in Hebrew, but
the wealth of information in English on Scheme and the underlying
computer science is phenomenal. “The Little Schemer” is one way to get
started. “drscheme” from PLT is another. I’d personally go with
“drscheme”; I found “The Little Schemer” hard to read. Check out
http://www.plt-scheme.org/

I’m posting this to the Ruby list, of all lists, for a few reasons:

  • I really hope to get responses that convince me to use Ruby
  • Ruby guys know their stuff and aren’t too religious
  • I just like this list
  • This can spawn an interesting discussion on teaching programming to
    beginners, esp. those who aren’t fluent in English

So, what do you think? What language should I teach her, and what
should I
teach her to do with it first?
Well … I guess if you’re talking about programming languages, I’d pick
Scheme/Lisp or Ruby. But the natural language issue – English vs.
Hebrew – is obviously a big factor here. You’ve mentioned it enough
times that perhaps you should be teaching her English as well as
programming. One way to ease into that might be to find some open source
natural language processing software and break it up into small pieces.
The open source world seems to me to be way ahead of the commercial
world in natural language processing. It’s not my area of expertise, but
I’m pretty sure there’s quite a bit of natural language processing
software written in Lisp, if not Scheme, and there are also some things
in Ruby.

I’d stay away from “toy” languages like Logo, and I’d stay away from
Squeak. As far as I can tell she’s smart enough to work in a real
language – Logo just isn’t a real language. It’s designed for kids
and she’ll outgrow it quickly. In fact, I’m guessing she already has
outgrown it! And Squeak is, as you’ve noticed, just plain bizarre. I’ve
been programming since … well, let’s just say you had to be a graduate
student to get your hands on a machine with core memory and solid-state
logic. :slight_smile: And I found Squeak so counter-intuitive that I gave up on it
after a week. Smalltalk is a wonderful language, but Squeak is just
plain weird.


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

By the way, this is looking REALLY great:

It’s… It’s like TryRuby with graphics!

No installation is a huge advantage if I want to teach her remotely.

I think I’ll postpone my decision and teach the first few lessons here,
and
then ask her what kind of thing she would like to create and choose by
her
answer.

Still, until I start I am very open to suggestions.

Aur S.

On 11 Feb 2007, at 15:12, SonOfLilit wrote:

Yes, but I want to teach her an environment where if she comes to
me and
wants to program, say, a GUI, or a game, or a website, I can show
her how.

With Squeak, I haven’t figured out the only simple task I’ve ever
tried to.

That isn’t a good sign…

Do you have to pick one language? When people decide to write a game,
or GUI or website, they use different languages, generally. So why
not pick the right tools for the job, and encourage her to do the same.

I think you did excellently starting with Logo. Maybe you should
teach her a bit more of that, and actually get her doing graphics on
her own. I’d favour languages with a low barrier before results -
that’s what I favour in work too. Logo is good for that in the right
domain. Ruby is good in others. c has a few places too. Excel can be
pretty cool for learning, even.

Perhaps learning several languages can be part of the fun. I don’t
think it’ll make the task harder either. It’s more likely to be easy
because she’ll be seeing the same concept from different points of
views and settings.

Good luck :slight_smile:

Cheers,
Benj

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.

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

On 11 Feb 2007, at 15:18, SonOfLilit wrote:

By the way, this is looking REALLY great:

http://www.logowiki.net/

It’s… It’s like TryRuby with graphics!

That’s really cool! I can’t see how it works. Doesn’t seem to be SVG.
Anyone know?

Cheers,
Benjohn

On 2/12/07, Benjohn B. [email protected] wrote:

Anyone know?
It’s using the canvas[1] tag, a vector graphics canvas built into
Safari & Firefox. Might be fun to use for learning JavaScript (esp.
with Firefox+Firebug.)

You can do fun stuff like
http://www.cs.helsinki.fi/u/irkheikk/fireworks2.7.html with it

[1] Canvas tutorial - Web APIs | MDN

i would start with scheme (drscheme environment):

9 year old was able to start programming:

http://www.teach-scheme.org/
http://www.htdp.org/

the reason being that the “syntax” of scheme is so regular and easy to
pick up + drscheme environment was designed with teaching in mind. once
she knows the concepts, she can move to something else (like ruby).

vlad

ps:

On Mon, Feb 12, 2007 at 09:42:19AM +0900, Morton G. wrote:

I also think Ruby with turtle graphics added would be good way to
start. We recently did a Ruby Q. 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-talk/138245

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

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

Cheers,

Brian.

It is done with Canvas (so it might not work in IE).

It IS very very fun.

I had lots of fun just playing with it.

Interesting, how neat design makes playing with graphics more fun.

Only problem is that they seem to be read-only - I’d want to put lessons
for
my sister there that others could read and enjoy too.

Aur S.

On Mon, Feb 12, 2007 at 08:58:41AM +0000, Brian C. wrote:

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

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

Regards,

Brian.

That’s really cool! I can’t see how it works. Doesn’t seem to be SVG.
Anyone know?

It’s using the canvas[1] tag, a vector graphics canvas built into
Safari & Firefox. Might be fun to use for learning JavaScript (esp.
with Firefox+Firebug.)

Oooh, wonderful! That’s kind of what I’ve been looking about for.

You can do fun stuff like
http://www.cs.helsinki.fi/u/irkheikk/fireworks2.7.html with it

grin but not when you open it from work where the browser is IE
though?

[1] Canvas tutorial - Web APIs | MDN

I’ll take a good look at this, thank you very much.

On 2/11/07, M. Edward (Ed) Borasky [email protected] wrote:

If you don’t mind switching from Lisp to Scheme, there are lots of great
resources. Scheme is pretty much the ultimate pedagogical/academic
language. I don’t know what, if anything, is available in Hebrew, but
the wealth of information in English on Scheme and the underlying
computer science is phenomenal. “The Little Schemer” is one way to get
started. “drscheme” from PLT is another. I’d personally go with
“drscheme”; I found “The Little Schemer” hard to read. Check out
http://www.plt-scheme.org/

I was talking about the Lisp FAMILY, of course, so scheme is included.

I would have gone for DrScheme, I think, as it is the only sane choice I
know except for emacs+SLIME - and as much as I like this one, I don’t
think
my sister will.

Well … I guess if you’re talking about programming languages, I’d pick

Scheme/Lisp or Ruby. But the natural language issue – English vs.
Hebrew – is obviously a big factor here. You’ve mentioned it enough
times that perhaps you should be teaching her English as well as
programming. One way to ease into that might be to find some open source
natural language processing software and break it up into small pieces.
The open source world seems to me to be way ahead of the commercial
world in natural language processing. It’s not my area of expertise, but
I’m pretty sure there’s quite a bit of natural language processing
software written in Lisp, if not Scheme, and there are also some things
in Ruby.

Getting her to learn English is part of the fun. Well, her English is OK
on
a basic language - she can have a conversation in English and could
eventually understand every text I throw at her, I think (school ruined
it a
bit - you know how schools work). But she’d have difficulty studying
from an
English book / tutorial, and English names in APIs wouldn’t feel natural
to
her, so she’d have to memorize every word. That’s why I said Ruby’s
advantage of very clear and obvious names would be lost.

I’d stay away from “toy” languages like Logo, and I’d stay away from

Squeak. As far as I can tell she’s smart enough to work in a real
language – Logo just isn’t a real language. It’s designed for kids
and she’ll outgrow it quickly. In fact, I’m guessing she already has
outgrown it! And Squeak is, as you’ve noticed, just plain bizarre. I’ve
been programming since … well, let’s just say you had to be a graduate
student to get your hands on a machine with core memory and solid-state
logic. :slight_smile: And I found Squeak so counter-intuitive that I gave up on it
after a week. Smalltalk is a wonderful language, but Squeak is just
plain weird.

Logo seems quite real to me (I’m talking about Brian Harvey’s UCBLogo).
He
shows how to do some very nifty things in his books about it, like for
example a BASIC to Logo translator:
http://www.cs.berkeley.edu/~bh/v2ch6/basic.html

As a matter of fact, Logo (a language I was first taught to “use” for
turtle
graphics at third grade but totally forgot about and rediscovered today
as
an experienced programmer) seems to me like having a relationship with
Lisp
like that of Ruby with Smalltalk: Take the underlying engine and make it
look like simple English. I especially like the keyword “to” used for
function definition, as in “to draw a triangle, repeat three times doing
this and that”.

If only it had a FFI, I’d have no doubts and teach her Logo.

Without one, I’m afraid to say it’s a VERY limited language (AFAIK it
doesn’t have PEEK and POKE, BASIC’s FFI in the times of ASM reign).

That leaves Ruby or Scheme.

Ruby is more natural, Scheme is simpler. Part of Ruby’s “natural”
advantage
is lost because of language mismatch. Ruby’s libraries are allowed to
have
simpler APIs, but the cost is in the complication of implementing such
APIs.
I know Ruby far better than Scheme (have only played a bit with the
latter).

What do you think?

SonOfLilit wrote:

I was talking about the Lisp FAMILY, of course, so scheme is included.

I would have gone for DrScheme, I think, as it is the only sane choice I
know except for emacs+SLIME - and as much as I like this one, I don’t
think
my sister will.
Well … yes, but there are clear differences in the popularity of
Common Lisp and Scheme. There is a lot of real-world software written in
Common Lisp. Scheme, on the other hand, is primarily a pedagogical
language. The most common non-pedagogical use for Scheme is as a
“scripting language” for tools like TeXmacs. And that is most often done
using the Guile implementation.
an experienced programmer) seems to me like having a relationship with
Lisp
like that of Ruby with Smalltalk: Take the underlying engine and make it
look like simple English. I especially like the keyword “to” used for
function definition, as in “to draw a triangle, repeat three times doing
this and that”.

If only it had a FFI, I’d have no doubts and teach her Logo.

Without one, I’m afraid to say it’s a VERY limited language (AFAIK it
doesn’t have PEEK and POKE, BASIC’s FFI in the times of ASM reign).
What is it about MIT and wanting to build languages and computers for
children? :slight_smile: Seriously, though, I started programming for a living when
APL was a gleam in someone’s eye and Lisp 1.5 was the most advanced
functional language you could actually get your hands on. My programming
“childhood” was spent in the FORTRAN and macro-assembler world. I was
sad to see Lisp “dumbed down to Logo for kids” and FORTRAN “dumbed down
to BASIC for Dartmouth undergraduates”. The other side of that coin,
though, is that I was also sad to see the first really high quality
computer for kids, the TI 99/4, die.

My point remains that programming students who will go on to become
programmers or electrical engineers or computer scientists or applied
mathematicians or software engineers quickly outgrow things like Logo
and Dartmouth BASIC.

What do you think?
Well … despite the obvious pedagogical nature of Scheme in general and
Dr. Scheme in particular, I’m leaning towards Ruby unless the goal is to
prepare her for an academic career or something similar. Scheme isn’t
much used by professional programmers, and it isn’t growing in
popularity relative to other languages. Ruby, on the other hand, is
growing in popularity and can do more things without having to build
them from the ground up.

One final note – perhaps you can persuade Chris P. and the good folks
at Pragmatic Programmers that a Hebrew translation of “Learn to Program”
is a good idea. Why should all the good Ruby books be in Japanese and
English only?


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

Scheme isn’t much used by professional programmers…

maybe it is not used much (meaning being popular), but my very good
friend is doing advanced programming for a big bank in germany, mainly
using scheme 48 implementation (he very rarely uses any other
programming language). so it does happen - mainly if the projects get
hard enough…

vlad

Vladimir K. wrote:

I went to a Scheme satellite session at a conference on functional
languages in Portland last September. The overwhelming majority of the
papers were academic; there were IIRC only two papers on people using
Scheme for actual automation of something. One was an Air Force lab that
was using it as a scripting language, a task for which 99 percent of the
world uses Perl or Python these days. :slight_smile: And the other one was about a
port of Scheme to a mobile phone OS.


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

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

On Mon, Feb 12, 2007 at 09:42:19AM +0900, Morton G. wrote:

I also think Ruby with turtle graphics added would be good way to
start. We recently did a Ruby Q. 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 Q…
  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 Q. 104. The url is http://www.rubyquiz.com/index.html.

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

=> Turtle(0,[0,0])

require ‘mock’
require ‘turtle’

The Ruby Q. 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