

Teaching Ruby to High School Girls - whalesalad
http://teachingkids.railsbridge.org/2009/08/15/teaching-ruby-to-high-school-girls.html

======
clofresh
Here's a crazy idea. Let's teach Ruby in intro programming classes instead of
C, so as not to frighten away 90% of the population with pointer dereferencing
and segfaults. You should teach C eventually to make them appreciate high
level languages, but just not right away.

~~~
tsally
We teach Shakespeare and Calculus in high school, though those are certainly
not the easiest choices in their respective fields. For an introductory
programming class, I agree that Python is a great choice. However for seniors
in a computer science class, C should be a fairly important part of the
curriculum. There are some fundamentals of computer science that are best
grasped through experimentation with C (pointers, memory, etc).

Note that several years ago the AP Computer Science exam got switched from C++
to Java. I personally support this change because most high schoolers are not
mature enough to fully grasp the complexities of C++. Java is a bit gentler
(Python would be better). However I don't see why C can't be the Shakespeare
of Computer Science in high school. Everyone hates studying it, but it's
probably better for the student in the long run.

On a slightly related note, I don't hear of too many efforts to make Calculus
more accessible to girls or Shakespeare more accessible to men. This whole
women in programming thing is an interesting phenomena. Don't get me wrong,
efforts like this are great, and I've even participated in a few myself. But
let's be clear about the source of the 'problem'. Deeply embedded society
pressures and bias in early education are two major factors working against
women in programming. By the time they've gotten to high school we've already
lost quite a few for good. Let's also be careful not to attribute every
inequality in sight to socialization. That's a nice PC answer, but unlikely.

~~~
jerf
"We teach Shakespeare and Calculus in high school, though those are certainly
not the easiest choices in their respective fields."

I'm not sure that's the best argument. In my sophomore year in high school, we
covered Romeo and Juliet. At that point, it is fair to say that I had reading
skills _well_ above average. I could read original texts from the 19th, 18th,
and even to a limited extent the 17th centuries and understand them just fine.

Shakespeare I could make the plot out, but little more. The footnotes assured
us that all kinds of funny jokes and puns were being made, but we pretty much
had to take that on faith. Seeing the plays helps a bit more because you get
the additional channel of seeing real people, but even then we're taking the
humor and puns on faith. I suspect that if someone from Shakespeare's time
could see a modern production they would consider it atrocious (once they got
past the superior delivery technology); places my footnotes assured me were
hilarious were usually delivered straight in the videos I saw, as if the
actors didn't realize they were making a pun and it was supposed to be funny.
Most likely because, well, they _didn't_ realize it.

I question whether we teach Shakespeare as anything other than "the
traditional curriculum", and with a desperate-but-futile hope that this will
somehow inculcate a desire to be exposed to more "good culture" in the
students... fresh on the heels of teaching the students that "good culture" is
written in an incomprehensible vaguely-English language which is completely
inaccessible without footnotes which assure us that it's good, really, in
plain contradiction to the evidence of their eyes. The shock of the literati
at the failure of this plan is amusing, but still sort of odd.

I see a lot of parallels to this with teaching high school students C. We're
going to teach them a nearly-40-year-old language (might as well be from the
1500s) written to run on computers the size of rooms with less power than the
cell phones the students have, with copious verbiage telling the students _no,
really, this is computing!_ despite the fact their eyes will tell them their
programs resemble none of the programs they actually use? Gosh, how could that
_ever_ fail?!

Save it for college.

Just to highlight one of my points, I think one of the worst things you can do
is contradict what the students are seeing. They see an archaic, musty
language that can barely be understood, that resembles nothing they see in
current use, but you assure them that this is the height of Western culture
and they'll be better for understanding it. All you do when you do that is
blow your precious credibility. I'm sure one or two people will pop up here
and insist that Shakespeare changed their lives in school. Maybe one of them
is even actually telling the truth, and not just defending the status quo
because it's the status quo. But nevertheless, statistically, it's a terrible
approach; it can't convert anyone who isn't already very interested and it
turns away the _vast majority_ of any who may be interested. I'm not saying we
should be feeding our students educational candy, but let's teach things in
High School that, when we claim they are awesome, might actually be able to
_stand up_ to that point, within the student's _actual_ reference frame and
not the "desired" one, which only exists in the educator's head. Dickens, or
Melville, Swift perhaps, or perhaps Python or Processing. Jumping to C or
Shakespeare isn't done to help the students, it's done to gratify the
teachers, and it fails in entirely predictable ways.

A world full of great literature and great computer languages, and we insist
on homing in on the very things most likely to turn off the students forever.
Then we wonder how schools manage to turn out so many students who hate
"learning". Gosh, how could that be?

 _Edit_ : One final note. I often get a lot of shock when I question
Shakespeare's value. But I think "question dogma" is part of the Hacker's
credos. Is Shakespeare holy because you've worked with exposing people to it
and seen it change their lives (not just your own, either) and because you
yourself love it, or is it holy to you because people have been telling you
all your life how wonderful it is to the point that saying "Shakespeare is
great!" has become a social signaling mechanism to indicate how cultured you
are? I freely acknowledge that there are people who truly do love it... I just
don't think they are that numerous.

~~~
psykotic
You are in effect making the argument that "tough learning" has no place in
the curriculum. It's absolutely crucial that students are confronted with
learning curves that are discontinuous compared to what they have previously
faced. The other road leads to common denominator mediocrity. The real problem
is that you cannot set an individual curve for students because of the need to
teach them en masse.

The most significant experiences in my life have been about overcoming
learning curves that seemed insurmountable. Two experiences stand out for me,
one with mathematics, the other with literature. Even one experience like that
can last you a lifetime. It can lead to a career and a lifelong passion.

My epiphany in mathematics came at age 16, the one in literature much later at
age 22. The reason both came so relatively late was that my arrival was by
circuitous paths of self-study. Unfortunately I never had a truly inspiring
teacher.

I'll say a little (or a lot) about the epiphany I had with literature since
you seem to have a particular problem with canonical literature. Until my
teens, I read more than most kids but not very much and virtually nothing but
pulp fantasy and science fiction. When I became interested in programming and
later mathematics I read a lot of technical books in those areas. But anything
vaguely literary with a challenge accompanied by no immediate reward was a
complete turn-off.

Poetry in particular was incomprehensible to me. I could not understand any of
the poetry we covered in school, and I could not understand how anyone could
understand it, much less appreciate it. In short, my attitude was the same as
yours: All these people who pretend to love it must be pretentious pricks all
hoodwinked by the Emperor's New Clothes.

I eventually stopped reading almost any fantasy and science fiction and stuck
to nonfiction, mostly technical material. But when I was age 22 I picked up a
copy of Pullman's The Golden Compass and read it through in one sitting. I
thought (and still think) it was the best work of fantasy I had read.

I looked the author up online and found that elements of the books had been
inspired by Milton's Paradise Lost. I had heard of this work but never read
it. I swifly found a free copy on Gutenberg and discovered to my dismay that
it was a narrative poem. A fucking poem! But this writer guy says it's the
best poem in the English language, so there must be something to it. I tried
to read the first page but was defeated by Milton's tortuous syntax and
mythological allusions again and again.

I gave up and told myself that poetry was simply not for me. But at least I
had now convinced myself that this kind of old and difficult poetry was not an
elaborate inside joke or some sort of hoax.

A few months later, after rereading The Golden Compass, I decided to give it
another shot and this time ordered a handsome printed copy that incidentally
came with an introduction and a chapter by chapter commentary by Pullman. This
time I forced myself to read everything aloud and that was the trick that let
me crack it.

Wow! Poetry should be read out loud!

For some stupid reason this had never really occurred to me. Soon I had gone
through and understood the first several pages. Suddenly I could read and
understand the poem with surprising ease. It was the most sudden zero-to-hero
experience I'd had in my life. I was covered in goosebumps and tears were
welling up in my eyes. I was forced to stand up and pace around the room for
several minutes to calm myself down. Finally I sat down and spent several
hours memorizing the first couple of thousand lines, despite my generally
awful memory for such things. After that experience I found I could read
through a book of the poem at the rate of one per night. Not all the allusions
made perfect sense on a first pass, but now that I had learned to sound out
the words the syntax was no longer an obstacle at all.

The poem possessed me so completely that I eventually memorized the first two
books of the poem almost effortlessly, possessing the poem in turn. And when I
say memorize I don't mean by rote but by the kind of compulsive rereading and
rethinking that only passion can motivate.

Anyway, that was my epiphany. I decided to try Shakespeare next and bought a
copy of Midsummer Night's Dream. That was a lot harder! The word to word,
sentence to sentence writing of Shakespeare is so far beyond the likes of
Marlowe, Milton or Melville in terms of subtlety and modulation. All of those
guys are at their best when they write majestic rhetoric blasting on all
cylinders. That's not to say they lack subtlety in other areas; both Milton
and Melville are incredibly deep.

Anyway, I slogged my way through Midsummer Night's Dream. It was fun but it
didn't deliver Milton's spine-tingling bombast in the same way. It was subtle
the way the world is subtle. If you read it superficially you are likely to
leave with little else but the plot and a general but vague sense of the
characters. Shakespeare's plots are expendable and the strength of his
characters are in their variety, distinction and depth, so this way of reading
him does him poor justice.

I put aside Shakespeare for another year or so. My next attempt was with
Hamlet and that was what cracked Shakespeare for me. It had all the gratifying
high rhetoric I so loved about Milton but it also had complexity in subtlety
and depth to last you an infinite number of rereadings. From there I
eventually went on to read all of his works. Unlike Paradise Lost, several of
them took me several rereadings to love. They rarely give away their secrets
on the first stroll through.

Holy crap was that ever long. Anyway, I present this as antidote to your
criticism. What this and a few similar experiences has taught me is to never
assume that something is a worthless sham simply because you don't get it
right away.

~~~
jerf
"You are in effect making the argument that "tough learning" has no place in
the curriculum.... you seem to have a particular problem with canonical
literature."

No, which is why I explicitly mentioned Swift, Dickens, and Melville. We read
both Gulliver's Travels and A Modest Proposal in school (nowhere near a
complete list, of course), and even if it wasn't everybody's "favorite
literature ever", at least it was _comprehensible_ to people. You could send
students home with a reading assignment, and they might actually do it, and
then when they come to class the next day, they can _discuss_ the text, and
find out the deeper meanings, rather than having to come to class to find out
just what the hell it was they just read. This is not a valuable use of
literature time. Also, as I said, I read quite a bit of the "canon" of my own
free will and could read Ye Olde Texte far better than most people of my age.
More than once I was given a school assignment to read a book I had already
read.

Your story is not a counter to my point; it proves my point. You had to be
interested and bring a _lot_ of effort to the task of reading those things.
This makes them grotesquely unsuitable to be using them in high school where
those things are not generally available. That you found it rewarding is
great. I too have done that, both in the computer domain and the literature
domain. But an awareness of what it took is precisely why I say it's a
terrible approach to general education.

I never said it was a worthless sham. I said it _wasn't worth teaching in high
school_ , and that it should be left for college. Based on the age you had
your experiences, you hardly provide a counterexample for that. It would be
way better to simply _allude_ to Shakespeare's genius and let motivated people
find it, than spend valuable time jamming it down students throats only for
them to see an incomprehensible mass that they are never again motivated to
look into. There's no way school could every have given you that experience.
(Maybe a really motivated teacher, but even then it would have been a personal
interaction, not a schooling thing.)

Basically, my position is that you have to educate the students you have, not
the students you wish you had. And, if we are going to build our education
system around teaching masses of children, building our core curricula around
something that will maybe appeal to one or two kids per year, and then only
several years later, is such a waste when we could be teaching people things
that might actually _encourage_ rather than _discourage_ the pursuit of
further learning.

So often the choice is presented as "Shakespeare or nothing", or "only
incomphrehensible literature or nothing". You sort of have those memes in your
response too, when you read into my post that I'm against literature. But when
I spell that out, it's obvious that there are tons of other choices. There's
thousands of other school-worthy candidates that won't have the side effect of
firmly squashing all future interest in "literature".

(There's also a frequently unrecognized assumption that we have infinite time
for students to learn in, and therefore it is sufficient to establish that
something is "good", and therefore we then put it in the curriculum. That's
not even close to true. Our time as students is _terribly_ limited compared to
what there is to learn, and it's getting worse every year. The question is not
"Is Shakespeare worth learning?". Duh. Of course it is. But then, there's
enough "stuff worth learning" to fill your lifetime and beyond. The question
is, is it the _best_ thing to learn? _That's_ what I'm challenging. Given the
enormous liabilities that teaching Shakespeare... oh, and by the way, C, since
the parallel continues to hold(!)... brings to the table, including the very-
real risk of completely destroying any interest in literature/programming that
may have been present, why shouldn't we teach the things that don't carry that
risk?)

------
stevenbedrick
The key to this (lovely) story, IMHO, is the iterative nature of the lesson.
Each step was very small, built on the previous one, and resulted in clearly
visible changes to the program. For novices, this is absolutely vital-
especially in a classroom environment like this. Now, re: the appropriateness
of Ruby's somewhat-odd syntax for this lesson- I agree that there's definitely
some weird arbitrary-seeming stuff in Ruby ("darkred" vs "dark red", etc.).
But, let's face it- ALL languages have a few weird syntax things here and
there, especially from the standpoint of a novice programmer. It's just part
of the way that computers and programming languages work, and anybody who
wants to write code is going to have to learn to deal with it. From my
experience teaching novice programmers, however, I can tell you that a lot
depends on HOW

The problem is that, with most languages and in most intro lessons that I've
seen, the student is exposed to all of them all at once without much context.
I feel like the lesson described in this article did a great job of
introducing the students to these language "features" one or two at a time and
in a relatively sensible order. Eg, the students first got used to the idea
that the computer was picky about upper- vs. lower-case letters. Next, they
got their heads around the idea that attributes often involve a weird sequence
of characters ("=>"). Then, they were exposed to the "identifiers-can't-have-
spaces" rule. Etc., etc., etc. By the time they were exposed to each new
oddity of the syntax, they'd had a chance to absorb the one that had gone
before.

------
Nervetattoo
I'm amazed as well that it went that well. And its really great to hear that
they weren't put off, lets hope the coming generation can help improve the
genre ratio within programming workplaces. I like you approach, and choosing
shoes probably was a good choice. Instant gratification should be #1 goal in
classes like this, its all about building excitement, which it seems you
nailed.

"Another girl dug into the documentation she had seen me use, and figured out
how to use the color picker to let the user select a color for the line!" I'm
impressed. Figuring out manuals can at times be hard even for us who use them
on a day-to-day basis.

------
callahad
When it comes to pedagogy, the sigils and syntax of Ruby have always bothered
me. The author notes the girls having trouble with _dark red_ versus _darkred_
, or getting the hash syntax right. I imagine a number of them wondered why
_"center"_ and _"xx-large"_ went inside quotation marks, while _saddlebrown_
did not. Furthermore, special string values like "center" and "xx-large"
somewhat undermine the teacher's assertion that quotations demarcate "a sort
of free zone for text."

Are there better languages or tools for this task? Has anyone here tried to
teach programming to non-programmers using a visual language like Scratch or a
simpler language like Scheme or Basic? How did it go? Shoes is an incredible
platform, I just wish the underlying language had a more immediately
comprehensible syntax. (PLT-Shoes, anyone?)

~~~
WilliamLP
> simpler language like Scheme

I really think Scheme is only simpler if you have a _really_ atypical kind of
mind.

~~~
callahad
Actual development in Scheme is a bit mind-bending, but sexps are wonderfully
simple.

    
    
      (fn arg1 arg2 ... argn)
    

Add quoting, and you're pretty much done explaining the language's syntax.

What sort of facilities can you build on top of that foundation to create an
easy, accessible learning environment like Shoes?

~~~
WilliamLP
The average high-school girl might not be able to instantly see the elegance
of the idea that functions, programs, data structures, numbers, etc. are all
interchangeable and that it all can be represented recursively with lists all
the way down. (High school girls who have read Hofstadter, maybe.)

They might be able to understand "later, rinse, repeat", or making a cake by
making three layers, and then making the frosting, where each becomes a
separate modular and reusable problem.

~~~
jcl
His point isn't that Scheme's syntax is elegant, but that the syntax is
_simple_.

There's no need to worry about the precedence of operators, or indentation, or
why you use one character to separate function parameters and variable
declarations, but you use another character to separate the arguments of a
"for" statement, which happens to be the same character you need to use at the
end of statements (but as a terminator, not a separator), but don't forget
that control structures are not separate statements even though they're on
separate lines, etc.

Each of these points is an obstacle between the beginning programmer's intent
and a running program. Scheme's almost total lack of syntax gets a beginning
programmer started quicker.

~~~
WilliamLP
That might seem simpler to you, but you have the kind of mind I was talking
about:)

To the average person, to make a toy car, it's straightforward to take a box,
put on two axles, then put on two wheels. You could do all that with just
toothpicks, but it's not really simpler in practice.

------
DanielStraight
Totally awesome. It's so cool to hear such great success stories about
teaching programming, especially to those who are unlikely to take it up
otherwise. I wish I could upvote this 100 times.

------
nopassrecover
I am surprised how well that went down to be honest - they must have been some
bright kids!

I don't think you'd have as much luck with first year uni students in a three
hour segment.

Great work and I love the extension ideas (including USB drives!)

~~~
pterodactyl
I had similar success teaching Shoes to fourth & fifth graders in a series of
3 1-hour lessons. I liked Sarah Mei's lesson even better, but for another
datapoint, here's my report:
[http://teachingkids.railsbridge.org/2009/07/20/fifth-
grade-s...](http://teachingkids.railsbridge.org/2009/07/20/fifth-grade-
shoes.html)

I think kids find programming more natural than adults do. They are used to
learning many strange and arbitrary rules :)

------
pbhjpbhj
Instead of just having the program files on USB memory stick could you have a
had a custom bootable linux environment instead - then getting the environment
set up would just be a case of plugging in to a PC and booting up. Sometimes
getting to the point where you start programming can be hard.

Just a thought.

~~~
brandnewlow
I'd say it's one of the biggest barriers to entry out there. Getting a dev
environment set up for anything other than hacking a Wordpress template is
non-trivial for most.

I use the stuff at PortableApps.com quite often with consulting clients who
need Firefox/Audacity/Gimp in a hurry. Could there be a portable
Ruby/Python/Django dev setup that could get a novice going quickly without
having to install a bunch of files?

~~~
RyanMcGreal
<http://www.instantdjango.com/>

