Ruby for Highschoolers?


#1

Howdy list,

I’m a highschool student with a very high chance of ending up
student-teaching the Programming I course during the 07-08 schoolyear.

This year was the first year for the course, and Scheme was used.
However, I’ve been talking to the teacher about Ruby, suggesting that
she should try it for one of the programming courses next year.
(Unfortunately, there’s no ready-made curriculum for Ruby available to
her, and she is not really a techie, so that idea was shot down.)

If I end up teaching it, I think it would be cool to cover Ruby instead
of Scheme. I’d have to develop my own curriculum, but whatever.

The goal of the course is to teach programming concepts in half of a
school year. The things that were covered during this year’s course were
writing functions to do a simple calculation, using variables, and using
cond/booleans. Many students struggled during the beginning of the year
with writing basic functions. Our teacher kind of blamed herself for
that, because this was her first year teaching programming, and she had
never been trained on Scheme.

I think that teaching students Ruby might be a bit less…arcane. It
looks friendlier, for one. It would also open the course up to more
concepts than Scheme offers, like automagic testing, manipulating files,
object orientation, etc. Teaching OO during this course would probably
also benefit the kids later on for Java during Programming II…

So, given all of that, I have two questions for ya, list. One, do you
think there’s any merit from teaching pretty non-technical sophomores in
highschool Ruby over Scheme? And two - Is there a DrScheme-eqsue
environment available for Ruby (screencap:
http://www.plt-scheme.org/software/drscheme/tour/images/editor-repl.gif)?

The DrScheme-esque thing is a big deal. The computer labs are all
Windows labs, and nothing will change this. The program serves as a sort
of incredibly simple IDE. In the top pane, you can put in your code, and
the bottom pane displays results and lets you use an irb-for-scheme type
thinggy.

I appreciate any comments you can give me, list.

Regards,
Nick Evans


#2

Nicholas E. removed_email_address@domain.invalid writes:

If I end up teaching it, I think it would be cool to cover Ruby
instead of Scheme. I’d have to develop my own curriculum, but
whatever.

I know this sounds heretic and probably is not what you expect from
this list, but why?

The goal of the course is to teach programming concepts in half of a
school year. The things that were covered during this year’s course
were writing functions to do a simple calculation, using variables,
and using cond/booleans. Many students struggled during the beginning
of the year with writing basic functions. Our teacher kind of blamed
herself for that, because this was her first year teaching
programming, and she had never been trained on Scheme.

Do you think an untrained teacher better teaches Ruby instead of Scheme?

I think that teaching students Ruby might be a bit less…arcane. It
looks friendlier, for one.

That’s a matter of taste; people that never saw code didn’t yet
develop a taste for it.

It would also open the course up to more concepts than Scheme
offers, like automagic testing, manipulating files, object
orientation, etc. Teaching OO during this course would probably also
benefit the kids later on for Java during Programming II…

I’d say, due to the small core of Scheme, it’s even easier to explain
these topics. You have everything: write a few macros for
unit-testing, files can be done with ports (they are in the spec),
object orientation can be done with closures. Once they did all this,
they know what they are talking about.

Of course, teaching this is not that easy. Did you ever read SICP?
Have a look into it and rethink your choice.

(Despite all of this, I prefer Ruby for coding, of course. But
Scheme is the better choice for teaching. YMMV.)


#3

Nicholas E. wrote:

Howdy list,

I’m a highschool student with a very high chance of ending up
student-teaching the Programming I course during the 07-08 schoolyear.

Boy, do I envy you guys. When I was in high school, I learned
BASIC and Fortran.

This is not a bad idea IMO. Start with simple things, of course.
Introduce OO fairly early.

Are these people who have programmed before at all? Or not?

Look up whatever Ruby tutorials you can. I don’t have links
handy, but there are some good ones out there.

Good luck…

Hal


#4

On Mon, 12 Jun 2006 01:55:39 +0900
Nicholas E. removed_email_address@domain.invalid wrote:

http://www.plt-scheme.org/software/drscheme/tour/images/editor-repl.gif)?
Nick Evans

I think non-technical High Schoolers would definitely benefit from
learning Ruby before moving on to other statically-typed languages. I am
a junior next year and we only have one Computer Science course that
teaches Java. I have a couple friends who took it this year and some of
the code they have written this year could have benefited from prior
knowledge of any basic programming. I taught myself Ruby using the
Pickaxe book among others and I would have to say it is just absolutely
fun to program in Ruby.

The IDE could be a problem, but if anything, it could probably be coded
in Ruby using one of the toolkits in a couple days/weeks (using Fox, Tk,
etc.).

-Steven D.


#5

Christian N. wrote:

Nicholas E. removed_email_address@domain.invalid writes:

If I end up teaching it, I think it would be cool to cover Ruby
instead of Scheme. I’d have to develop my own curriculum, but
whatever.

I know this sounds heretic and probably is not what you expect from
this list, but why?
I figured I’d be killing a few birds with one stone. I think Ruby is
simple enough to teach basic programming concepts with (although my
opinion on the matter probably isn’t worth much, because I don’t know
Scheme, really). It’s also practical and a hellava lot closer to Java
than Scheme is. And we are kids are compelled to take the Java course
senior year if we take the Scheme one sophomore year.

I also like Ruby better than Scheme.

The goal of the course is to teach programming concepts in half of a
school year. The things that were covered during this year’s course
were writing functions to do a simple calculation, using variables,
and using cond/booleans. Many students struggled during the beginning
of the year with writing basic functions. Our teacher kind of blamed
herself for that, because this was her first year teaching
programming, and she had never been trained on Scheme.

Do you think an untrained teacher better teaches Ruby instead of Scheme?
I think I’ve underexplained the situation. If I end up as the teacher’s
assistant and I can sell Ruby, I’m going to be the one teaching it to
the class AND the teacher.

I think that teaching students Ruby might be a bit less…arcane. It
looks friendlier, for one.

That’s a matter of taste; people that never saw code didn’t yet
develop a taste for it.
That said, I saw people getting incredibly confused by the idea of
matching the curly braces up. Ruby looks a lot more natural, so I think
it would be easier for people to relate something like this:

def do_something(n)
if n < 10
true
else
false
end
end

As opposed to:

(define (do_something n)
(cond
[(< n 10) true]
[else false]
)
)

(Sorry for parse errors, if there are any.)

they know what they are talking about.
I was unaware that Scheme had OO. I don’t really know Scheme, so I
guess I’m not being terribly fair.

Of course, teaching this is not that easy. Did you ever read SICP?
Have a look into it and rethink your choice.
I haven’t even heard of that. I’ll look into it. =)

(Despite all of this, I prefer Ruby for coding, of course. But
Scheme is the better choice for teaching. YMMV.)
Thank you for the feedback!


#6

Hal F. wrote:

This is not a bad idea IMO. Start with simple things, of course.
Introduce OO fairly early.
I’d find it difficult to not talk about it from the very start.

Are these people who have programmed before at all? Or not?
For the most part, no. The assumption that the course makes is that the
students are complete beginners.

Look up whatever Ruby tutorials you can. I don’t have links
handy, but there are some good ones out there.
Aye. Another benefit is having the first edition of the pickaxe
available online. We used How To Design Programs a lot during the class.

Good luck…
Thank you!


#7

Steven D. wrote:

I think non-technical High Schoolers would definitely benefit from learning Ruby before moving on to other statically-typed languages. I am a junior next year and we only have one Computer Science course that teaches Java. I have a couple friends who took it this year and some of the code they have written this year could have benefited from prior knowledge of any basic programming. I taught myself Ruby using the Pickaxe book among others and I would have to say it is just absolutely fun to program in Ruby.

The IDE could be a problem, but if anything, it could probably be coded in Ruby using one of the toolkits in a couple days/weeks (using Fox, Tk, etc.).

I know this will be controversial, but…IDE? Why do you need an IDE?
They’re learning programming, not clicking on things. They can write
their Ruby programs using whatever text editor is convenient, vim,
emacs, Scite, whatever.

“IDE? We don’t need no stinkin’ IDE!”


#8

I’m not after a full-blown IDE. They’d be working under Windows, and I’m
(perhaps wrongly) reluctant to open up the command prompt. I want to
focus on programming, and not have to bother with Windows shell commands
too.

DrScheme worked out really well. I guess what I’m after is a nice
frontend to irb, and if I have to, I’ll write it myself (and release it
to the world, of course!).


#9

false
)
I wouldn’t be too worried about the ()'s, I’d be more worried that Ruby
has a lot of various syntax…

method arg1, arg2, arg3
method(arg1, arg2, arg3)

var = if true then ‘1’ else ‘0’
# or the case equivalent…

etc…

I personally love it, but when you are a complete beginner this sort of
thing just makes your head hurt and I haven’t even hit the ones that
make
my head hurt…

Might be just be, but when I’ve tried to teach people languages they all
seem to want a very rigid syntax… for example, they liked for(;:wink: but
didn’t want to deal with do/while because they had their “one true
looping
construct”.

Not saying scheme is any better in this regard though, but something to
think about…

anyway, more to chew on.


#10

Hi Nick,

I recently landed a job teaching math and IT at a school here. I have
just
finished my first 6 months, where we have mostly been focusing on HTML
and
relational databases.

However, there’s still programming and OO left in the curriculum (as
well as
ERP and other things).

I initially had the idea that I would teach PHP, because it ties in
nicely
with what my students know about html and the web, and I could do the OO
part with PHP, too.

But I think that Ruby would be better as a teaching language.

I’d be very interested in seeing what you come up with, if you decide to
teach Ruby. Maybe we can bounce some ideas off of eachother.

Regards,

Kenneth.

2006/6/11, Nicholas E. removed_email_address@domain.invalid:

her, and she is not really a techie, so that idea was shot down.)
never been trained on Scheme.
environment available for Ruby (screencap:
Regards,
Nick Evans


Med venlig hilsen / Best regards

Kenneth Johnsen


#11

Nicholas E. wrote:

I’m not after a full-blown IDE. They’d be working under Windows, and I’m
(perhaps wrongly) reluctant to open up the command prompt. I want to
focus on programming, and not have to bother with Windows shell commands
too.

A big part of programming is understanding the world you live in.

There is nothing spooky about the command line, even in Windows.

Don’t treat people like children, or they’ll start acting like children.

Assume the best, and let them show you otherwise.


James B.

“The greatest obstacle to discovery is not ignorance, but the illusion
of knowledge.”

  • D. Boorstin

#12

James B. wrote:

There is nothing spooky about the command line, even in Windows.
Agreed. Even in win32, I spend a lot of time at the command line. It’s
certainly better than it used to be years ago, now that it understands
the up/down arrows and filename completion.

A command line is simple and intuitive in a different way from how a
GUI is simple and intuitive. It still has its place, and will for years
to come. Although I won’t be sad if we come up with something better.

Don’t treat people like children, or they’ll start acting like children.

Assume the best, and let them show you otherwise.

True enough. They are high school students, though. Cut them
a little slack.

Still, if you’ve never used the command line, you can learn
most of what you need in half an afternoon.

Hal


#13

On Jun 11, 2006, at 17:55, Nicholas E. wrote:

Howdy list,

Howdy Nicholas.

I think that teaching students Ruby might be a bit less…arcane.
It looks friendlier, for one. It would also open the course up to
more concepts than Scheme offers, like automagic testing,
manipulating files, object orientation, etc. Teaching OO during
this course would probably also benefit the kids later on for Java
during Programming II…

When it comes to teaching programming, I’m not certain Ruby is a good
fit. There are definitely some points in its favour, which have been
pretty much covered it seems to me, so I’ll point out a couple of
reasons I think it’s not an appropriate fit. For a bit of context,
I’m a PhD student at the moment, and have been a tutor/TA on
introductory programming courses for a couple of years now (they were
in Java).

The reason for this is that there are many, many different ways to
accomplish things in Ruby, and this can actually be detrimental to
the students’ fully understanding the basic concepts involved. They
tend to get hung up in trying to sort out the minor differences
between, say, all the different ways of doing a conditional. When
this happens, I’ve noticed students tend to drift towards “string
substitution” - basically just fiddling with the order of what
they’ve written, hoping to hit the right combination by chance; they
get the assignment done, but they’ve learned essentially nothing.

Basically, there are many ways to accomplish a given task, which
makes it comparatively easy to write a program that - while it
produces the desired output - completely misses the point of the
learning exercise.

Another difficulty is that while the syntax might look straight-
forward, but in part that’s because a lot of Ruby relies on
programmers having an understanding of how programming works in
general, and a lot of the generic terms can be elided or condensed.
When you’re learning programming, you need to know about those
implicit bits, and having to write them out explicitly helps with that.

To give a concrete example, think of the ‘return’ statement - it’s
required in Java for the method to return anything, and is optional
(but generally not used) in Ruby. For someone learning Ruby, this
means they have to remember that the last statement evaluated is the
return value, which is just one more thing to put on their stack of
not-quite-understood concepts (and they have LOTS of those concepts
when they’re learning).

matthew smillie.


#14

On Jun 11, 2006, at 12:55 PM, Nicholas E. wrote:

shot down.)

If I end up teaching it, I think it would be cool to cover Ruby
instead of Scheme. I’d have to develop my own curriculum, but
whatever.

Maybe you could base the curiculum/text on Chris P.'s Learn to
Program. (Either that or Cartoon Foxes).

So, given all of that, I have two questions for ya, list. One, do
you think there’s any merit from teaching pretty non-technical
sophomores in highschool Ruby over Scheme? And two - Is there a
DrScheme-eqsue environment available for Ruby (screencap: http://
www.plt-scheme.org/software/drscheme/tour/images/editor-repl.gif)?

Hmm, Ruby or Scheme for non-technical students? That’s tough,
Scheme’s sysntax makes your eyes bleed, but it has very very simple
semantics(short of callcc). OTOH the subset of Ruby I’d imagine you’d
be using for this class would have pretty simple semantics to.

The DrScheme-esque thing is a big deal. The computer labs are all
Windows labs, and nothing will change this. The program serves as a
sort of incredibly simple IDE. In the top pane, you can put in your
code, and the bottom pane displays results and lets you use an irb-
for-scheme type thinggy.

I don’t know of any DrScheme-ish environment for ruby. You could try
using FreeRIDE or Scite (both come with the one-click installer). Or
possibly FXIrb [1]

I appreciate any comments you can give me, list.

Regards,
Nick Evans

Good luck

[1] http://rubyforge.org/projects/fxirb/


#15

Matthew S. wrote:

Basically, there are many ways to accomplish a given task, which makes
it comparatively easy to write a program that - while it produces the
desired output - completely misses the point of the learning exercise.

If accomplishing a given task is not the point of the learning
exercise, then what is, and why might students be unclear on what is
expected of them?

I’m skeptical that Tim Toady is the culprit here. If you, as the
teacher, don’t want students diddling arounf with every syntax for a
conditional, then tell them the one form they are allowed to use for the
exercise and leave it at that.

(but generally not used) in Ruby. For someone learning Ruby, this
means they have to remember that the last statement evaluated is the
return value, which is just one more thing to put on their stack of
not-quite-understood concepts (and they have LOTS of those concepts
when they’re learning).

Actually, this is fundamental to understanding Ruby; expressions return
values; methods are a series of expressions.

The “must remember to type a gratuitous ‘return’” seems like the extra
work.

Students will learn the Ruby you teach them. Don’t throw a lot of
syntax at them before explaining basic principles. Otherwise the
syntax just seems arbitrary (or more arbitrary than it is), and the
principles will not make much sense after they’ve been blindly coding
with random expressions in search of code that simply runs without
errors.

It may be useful to watch the SICP videos from MIT (and they may be the
best argument for teaching Scheme over Ruby :slight_smile: )

http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/


James B.

“Take eloquence and wring its neck.”

  • Paul Verlaine

#16

Steven D. wrote:

I think non-technical High Schoolers would definitely benefit from
learning Ruby before moving on to other statically-typed languages.

I disagree.
I think that learning a stricter/statically-typed languages first would
benefit people better.

It’s far easier to go from strict(statically) to free(dynamic).

I come with 20 years of C/C++ experience.

It took me no time to understand that variables don’t have types,
classes can be changed midway through the script, Arrays can hold
anything.

If you start with this knowledge and try to go to C++, you will commit
suicide.


#17

You’re asking for views on teaching a particular programming language to
high-schoolers. This may sound like the dumbest imaginable question, but
have you decided exactly why your students need to be studying a
programming
language?

Are you trying to impart some early training to young people who are
thinking about pursuing careers as professional programmers? Are you
thinking of it as an adjunct to a math or science courses? Are you
thinking
about orienting future businesspeople who will spend a lifetime
programming
Word and Excel macros (aarrgh, where’s my razor… I can’t face that
future)? Are you thinking about people destined for technical careers
for
whom some mild familiarity with scripting can be useful? Or have you
smply
taken a personal interest in imparting some of your own joy of
programming?

If you know your goals and your audience’s goals, then the choice of
language(s) may be self-evident.


#18

Timothy H. wrote:

I know this will be controversial, but…IDE? Why do you need an IDE?
They’re learning programming, not clicking on things. They can write
their Ruby programs using whatever text editor is convenient, vim,
emacs, Scite, whatever.

For student just starting to learn a language, a good IDE would help
greatly.


#19

Hi,

I do not think that teaching ruby is a good idea because they will get
used
to built-in function and built-in function without even be able to
understand how something is built ( design patterns and etc ), IMHO
learning
what is programming better than what is programming language


#20

Ruby and Scheme are both beautiful languages.

I think Ruby would be an excellent choice for a first programming
language. You don’t need to know a lot of concepts to get started
programming in it, but it’s also a very rich language. I’m tempted to
say that Ruby will grow with you, meaning not that Ruby will gather
more and more syntax with age, but that as you become a better
programmer, you’ll discover other areas or ideas in that language that
you have yet to explore.

However, as you know Ruby but not Scheme, I’d recommend that you
advantage of the opportunity to learn Scheme. You’ll probably find
that it will make you a better programmer in Ruby, as well.

Jeff