Ruby for Highschoolers?

Jeremy Tregunna wrote:

If you can teach someone to program, learning a new language isn't
going to be a big problem. Your decision should be less about the
language and more about the concepts you need to be teaching. Scheme
is an excellent language for teaching people how to program. Sure,
most of them are unlikely to use scheme much if ever in day to day
operations on the job (if they choose to go down this path and stick
with it), but it's an excellent language to teach programming concepts.

I completely agree with the above.

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?

No, I don't. Keep the language simple, teach them how to program;
those who continue on with programming will find languages that they
wish to pursue, and will learn those when the time is appropriate.

And almost agree with this too.

Knowing almost nothing about Scheme (it's a lisp), and not prejudiced
agaist it at all (honestly), a possible advantage of Ruby could be that
its libraries let you do some really fun stuff very quickly, cleanly and
easily. I can imagine that being extremely appealing in a learning
environment. However, there may be equally wonderful libraries for
Scheme, in which case this is a moot point.

The other possible advantage with Ruby is that it has a current, active
community (which, again, Scheme may have; I don't know), and if these
children are good at looking for things for themselves (which I hope
they are), then they may have more luck with Ruby in this respect.

Having made those two points, I would expect Scheme to have more
teaching environment material available for it - potted courses,
teacher's notes, etc; I believe it was originally conceived as a
teaching oriented language (this may well show my total ignorance!).

Once again though, Jeremy Tregunna is absolutely right that concepts are
transferable, and there's not a great deal of value in choosing a
teaching language because of current "real world" use.

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.

Glad to hear you have that priviledge, as a student :slight_smile:

This year was the first year for the course, and Scheme was used.

Scheme? Wow, that must really beat the students to death.

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.

This is why I love Ruby. Ruby is very adventurous, and with every
adventure you have a good time, and it's not so difficult to
understand.

I thought I needed to add my $0.02 here. My background - Medical Informaticist
with an undergrad in Engineering/Programming. Program in 16+ languages
on a fairly regular basis. Love Ruby. This being said, Scheme is one of those
languages that do more than teach you how to write lines of code. Many can
write programs, however, the design and understanding to put together interfaces,
applications, etc. take a bit more understanding. Also, computer languages are
like tools in a tool box. Many mechanics like programmers only use one tool.
We have computers, calculators and other helpful devices, however, one still
needs to understand the math, science, biology, etc. fundamentals
behind these devices to be fully effective.

Ruby is easy to explore, and really doesn't get in your way. If you
want to teach the students some of the basics first, perhaps you
should consider the QuickRef, which is an excellent reference
(Ruby | zenspider.com | by ryan davis).

The Pickaxe also covers a lot of the language in an orderly fashion
(http://www.rubycentral.com/book\).

The goal of the course is to teach programming concepts in half of a
school year.

Scheme is very good here.

If you can teach Java or C++ in half a school year (as my high school
did), then you can most certainly teach Ruby in half 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.

I don't believe that programming is about solving only one person's
problems. Only focusing on a specific set of functionality for a
semester seems to only restrict the students from doing what they want
to do.

I'd suggest walking them through the basics, handing them lessons, but
also every now and then telling them to write programs which solve
problems they have.

Maybe one student's problem may be that he wants to calculate his
monthly allowance based on his grades. Say this student wants to see
how much allowance his parents will give him if he aces his US History
exam. Maybe another student wants to write a small game. This can be
sort of a project the students will get every 2 weeks.

I feel that programming is more about having fun.

One can have fun with programming. However, the scope of such courses
are generally fundamentals in nature.

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.

Here is an example of poor programming principles and understanding.

If the students don't learn anything, it's natural for the teacher to
feel ashamed and feel that she is to be blamed.

I think this is where Ruby fits in well, because Ruby has a more
readable syntax than Scheme (obviously) and it has a better flow of
logic as far as the student's concerned.

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

Teaching Ruby is good, but I suggest you stay away from
metaprogramming. Students may get as confused by Ruby's
metaprogramming than they did with basic Scheme.

All in all, I think it's a good idea to teach high school students Ruby.

I have to warn you though, I'm obviously biased :slight_smile:

I use Ruby for quite a few things and am quite happy with its functionality.
I too am biased in many ways, however, stepping back and looking at the
larger picture one needs to keep in mind the scope of the project.

--
Matt

-Bob-

···

On Jun 11, 2006, at 23:29, Matthew Harris wrote:

On 6/12/06, Nicholas Evans <OwlManAtt@owlmanatt.com> wrote:

Leslie Viljoen wrote:

···

On 6/11/06, Nicholas Evans <OwlManAtt@owlmanatt.com> 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.

Brian Schroeder put together quite a nice course:
http://ruby.brian-schroeder.de/course/

I found a few errors but mostly I thought it was very good.
FXRI comes with the Ruby one-click installer and may be able to
replace DrScheme.

As to whether to teach Ruby - of course! The advantage with Ruby is
that it's FUN, and I think that's the biggest factor when learning
anything.

See previous post on fun ... Scheme is just as much fun as Ruby IMNSHO.

--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com

Hello,

I have followed this thread now for a while, and cannot resist to add a few
words. (Background: Freelance Programmer/Sysadmin with quite some experience
in teaching 'Something about Computers', including various programming
languages. No LISP or Scheme, though.)

Jeremy Tregunna wrote:

[Ruby or Scheme as programming language?

If you can teach someone to program, learning a new language isn't going
to be a big problem. Your decision should be less about the language and
more about the concepts you need to be teaching.

I have to support and stress that point. The biggest mistake in a lot of
courses seems to be that the instructor mixes up 'How to program' with
'learning a specific programming language'. The most basic concepts
(calculations, conditions, operators) can be taught with the help of a
multitude of languages. The 'not-so-basic-anymore' stuff (for example
variables, functions/procedures, assignment ...) will exclude a handful from
the set, but there's still enough left.

But all of these things can be presented even without the use of any language.
These concepts should be like templates or blueprints: (Almost) every language
has/needs those, and the only difference for the programmer is the syntax.
Especially for a non-technical person, approaches that use metaphors and
'real-life examples' are easier to understand and realize.

It really doesn't matter which tools you use to visualize and exemplify those
concepts. The real focus in this phase should be the ease of access to the
tools of choice for the student. In this case, a scripting language has
immense advantages over every compiled language: no wait for success. But I
digress.

The more advanced topics will sometimes be bound to the use of a certain
language, but what good does that? Knowing about specifics of a programming
language does as little for programming skills as knowing (only) about MySQL
(or dBase, or BDB) teaches about databases. With good basics, though, one can
come far.

All in all, an understanding is much more productive and helpful than
mechanical repetitions and 'cookbook recipes'.

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?

For me, it's all about the question 'Which tools will enable the student to
learn without being sidetracked or even hindered?'

AFAIK, DrScheme or Smalltalk have a clear advantage there. Knowing only the
latter, I dare to simplify: the IDE is the VM is the IDE. Now, my personal
preference is still Ruby.

First reason: Because I can -- without having to specify anything -- leave the
choice of the most important tool, the editor, to the students whose interests
are deep enough for making that kind of choice, and show the other simple yet
powerful alternatives (my own choice doesn't count, as I personally prefer
vim, but wouldn't try to force anyone to make use of all the builtin goodness).

The second reason is the ultimate blackboard, the try-and-error playground
which is built in: irb. Readline support, even completion is available, and
the success for the most basic things is immediately visible, which is
invaluable for overall success and progress.

In the end, it's all about personal preference. If you feel more comfortable
with Ruby, stick with it. If any other programming languages feels more
natural to you, and you manage to explain the most basic concepts to someone
new to programming with the help those, stick with that.

No, I don't. Keep the language simple, teach them how to program; those
who continue on with programming will find languages that they wish to
pursue, and will learn those when the time is appropriate.

This is the second statement I want to support with all emphasis. The
/concepts/ are more important than any specific language skill at the end of
the day. There is no need to teach every possible way (as mentioned somewhere
else in this thread): the skillful will find the way, the less skillfull will
work with what has been given to them.

Now, I want to freely comment on some other statements within this thread:

It seems that sometimes 'learning how to program' is confused with 'not having
fun' or even 'no pain - no gain'. I had the mixed blessing to learn various
things (not only programming) from very different people. The things I
remember best and that helped me most were those where learning was coupled
with 'having fun'. And nowadays, where we have (as instructors) the freedom of
choice of tools, why should we still transfer 'our' pain of the past onto the
back of our poor students?

Or maybe it's just elitism, and the creepy feeling that these days 'hackerdom'
isn't as removed from 'the masses' as it has been?

On another note: if a certain concept doesn't exist in a certain language, and
the concept is too important to be skipped, why sticking to one language all
the time? If it's really *that* necessary to teach it, there's ways around the
'restrictions' we put on ourselves. I do not preach babylonic confusion, but
eclectic picking of choices.

Yes, the signature is random, no, I didn't pick it. Neat fit, though.

I'll leave it at that.

t.

···

On 11-Jun-06, at 12:55 PM, Nicholas Evans wrote:

--
Anton Bangratz - Key ID 363474D1 - http://tony.twincode.net/
fortune(6):
  Hegel was right when he said that we learn from history that man
  can never learn anything from history. -George Bernard Shaw

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

Timothy Hunter wrote:

···

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

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

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.

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

···

--
Posted via http://www.ruby-forum.com/\.

ReggW wrote:

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.

A compelling argument against using C++.

···

--
James Britt

"Take eloquence and wring its neck."
  - Paul Verlaine

wenas agusetiawan wrote:

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

Hear hear!

Machine code or bust.

···

--
James Britt

"Take eloquence and wring its neck."
  - Paul Verlaine

Matthew Smillie 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?

For introductory assignments, the results of the assignment are invariably already known, because otherwise how will the students know they're on the right track? So how could the results be the point of the exercise? The instructor knows them, the students know them, everyone knows them. What the students don't know is how to get from the input to the output, and it's *that* process that you're trying to teach, not as a recipe, but as a skill.

This is the same in most forms of introductory-level teaching; the precise nature of your opinions about feminist imagery in Margaret Atwood's work aren't the point of writing a paper for English 101. The point of writing that paper is to learn the process of writing any English paper: develop and describe a particular thesis.

As a trivial (and somewhat absurd) example, let's say the exercise is to write an array-sorting routine. In teaching terms, this has the practical value of getting them familiar with arrays and fundamental operations (setting, accessing, comparing), and demonstrates theoretical points about efficiency (bubble sort, anyone?), algorithms, and depending on exactly what the algorithm is, recursion or notions of combining small local operations to effect a global result. On the other hand, a student could write "arr.sort" and have accomplished the same task having learned nothing more than how the docs are organised.

There are two less-trivial examples that I've seen a few times that are worth mentioning in this context.

Some of the students in the course I taught had only ever programmed in Prolog before - and a couple of them were extremely proficient at it. They tended (in Java) to end up finding ways to make everything effectively global. They accomplished the task, more or less, but did they learn anything valuable about encapsulation or OO design? Not really.

Similarly, a few students have come in having done some shell scripting or website PHP or Perl hacking, and the fundamental mistake they made was to do everything statically (in Java, so as class methods). So, they had classes, which were pretty decent, but missed out objects and had to do some really odd fiddling to manage state at the class level. Again accomplishing the task, but missing out on some pretty fundamental aspects of object orientation.

So no, the point of a programming exercise is not simply for a student to produce the desired output, but rather to teach students something more fundamental about programming in a practical way. Philosophically, it's not just where you end up, it's how you get there.

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.

Well, isn't that equivalent to giving them a language in which the expression of conditionals is more restricted? What's the effective difference of the instructor saying "always write your conditionals this way" and the language requiring it, from the student's perspective?

In any case, conditionals are just one example, and the larger problem boils down to the fact that the students must learn, and learn on their own (in the sense that they might work together, but noone can copy understanding of their lab partners). Specifying the style or allowed syntax for an assignment specifically enough that noone gets side-tracked is a fruitless task: you end up just giving them pseudo-code and a set of formatting guidelines.

That's pretty obviously undesirable, for one thing, you want students to get side-tracked every so often. What you don't want them to do is get so caught up in the subtleties of the *syntax* that they miss the larger point of the assignment - not seeing the forest for the trees.

Think of it as similar to why we advise people not to optimise prematurely, because premature optimisation amounts to almost the same thing: a programmer becoming too focused on the specific implementation of one small piece of code, ignoring the larger task. For experienced people, this might be "how can I cache my search results?", but for beginning programmers, this very often is "what's the smallest number of lines I can use to write this conditional" or "that ternary operator looks clever, how can I use it to do this?".

I will admit, though, that it is a tricky argument, because the best students are the ones who experiment on their own and are smart enough to read their textbook or look up online docs, and discouraging them from this does them an enormous disservice. But equally, you want to make sure that you're not setting traps for them; it's just as much a disservice if they spend all their time working on a one-line #inject implementation of a method, and don't learn how inheritance works.

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

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.

You're assuming that they're completely understood and internalised the concept of 'all expressions return values', which I will guarantee that not all of them have. When you're learning programming, that is still something that you have to *think* about.

Again, a practical example: the 'expressions return values' thing is pretty simple at first glance, a = 3 + 2 seems pretty easy to understand. For some reason, though, the majority seem to consider variable assignment as some sort of a special case. Of course, it's what lets you do things like "a = b = c = 1" and "if (a = a + 5)". The latter example never fails to draw slightly confused looks from people the first time they see it.

So, it *is* extra work, but it's valuable extra work because it helps students internalise that particular concept. It makes it absolutely explicit to the student that methods return values. If they're reading code, it gives them an anchor for their analysis and understanding.

Again, though, 'return' is just an example of a more general idea: Ruby syntax is concise, which is great for when I'm using it. But that same property can make it a headache (literally) for beginners - there's just more that they have to actively think about and remember in order to grasp what's going on.

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.

Striking the balance between introducing concepts and introducing syntax is difficult, since they have a somewhat circular relation: this syntax expresses this concept, which is implemented using this syntax.

So, while "don't throw a lot of syntax at them before explaining basic principles" is correct advice, it's not very useful advice, since all it does is rephrase the problem. In fact, it's about the biggest problem in teaching programming, and it has no correct answer; some students will do better if you just give them a link to the language docs and turn them loose, some do better with formal definitions of the syntax, some need a simple, plain-english explanation, and some always need some hand-holding.

A more subtle point is that the instructor isn't teaching you Ruby, s/he's teaching you how to program. Ruby does have a lot going for it in this regard: first-order functions, object-orientation, and so on. But my point is that Ruby's concise nature is an argument against using it to teach general principles, because the syntax takes many of those general principles as already understood, and tucks them out of the way.

matthew smillie

···

On Jun 11, 2006, at 22:24, James Britt wrote:

Ed Borasky said: "I believe the goals are stated in the original post. The
first half of
the course, Programming I, is to teach programming concepts. The second
half, presumably by someone else, called Programming II, is in Java."

You rather missed my point, and the rest of your post goes on to show that
you implicitly answered my question in a particular way. (You're thinking
about how best to give early training to young people who intend to become
serious programmers, as has everyone else on this thread.) That's the
assumption I was questioning.

You're an old pro, Ed, and you have a lot of good insights on how to train
people who will be doing serious programming using the traditional
methodologies we all use every day. But CS pedagogy (at least at the
university level) has undergone at least two upheavals in the last dozen
years that I'm aware of. The Scheme revolution happened at places like MIT
and Stanford when people realized that of the two equivalent models for
understanding computation (Church-style and Turing-style), only the former
can be taught easily without a lot of distortion from the lanugages used. (I
have opinions about why that turns out to be true, but that's another
thread.) Several years after that, business leaders started complaining that
CS graduates had no real-world skills (only Scheme), and a lot of places
changed their programs to basically teach algorithm cookbooks in Java. (In
my opinion, equally useless, in fact worse, since these young people may
know how to write Java but they don't know how to think about computation.)

Now it's dawning on a lot of people that since programming itself may become
a relatively low-value economic activity (why is yet another thread but Ruby
ironically has something to do with it), some other kind of training may
need to supplement programming pedagogy. And that may be training in how
sophisticated information technology may be used to add value to business
processes and other environments. It would be forward-looking if nothing
else for high-schoolers to be exposed to some of this.

Nicholas Evans <OwlManAtt@OwlManAtt.com> writes:

I also like Ruby better than Scheme.

Again, just a matter of taste. :wink:

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.

Aah, so that's the reason. Okay. Of course, given you know Ruby, you
can teach Ruby better than Scheme. Fair point. (And it's probably
better to teach Ruby by a person that can program instead of teaching
Scheme by a person that can't program.)

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

IMHO, cond is overused. This is perfectly readable, no?

(define (do_something n)
  (if (< n 10)
    true
    false))

(Hint: Senseful indentation matters.)

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.

I was unaware that Scheme had OO. I don't really *know* Scheme, so I
guess I'm not being terribly fair.

It doesn't have OO out of the box, but it's powerful enough to build
your own OO.

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!

You're welcome.

···

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

Anton 'tony' Bangratz <tony@twincode.net> writes:

AFAIK, DrScheme or Smalltalk have a clear advantage there. Knowing only the
latter, I dare to simplify: the IDE is the VM is the IDE. Now, my personal
preference is still Ruby.

Funny you mention Smalltalk. I think it would make a great teaching
language too. It has an easy and logical, but well readable syntax, a
graphical environment and it's great for teaching OO, of course.

First reason: Because I can -- without having to specify anything -- leave the
choice of the most important tool, the editor, to the students whose interests
are deep enough for making that kind of choice, and show the other simple yet
powerful alternatives (my own choice doesn't count, as I personally prefer
vim, but wouldn't try to force anyone to make use of all the builtin goodness).

I could imagine these kids post endless stuff on their Livejournal or
MySpace and write that directly into the browser... do you really
think they care that much about editors? Both DrScheme and Squeak
provide convenient and appropriate ways of code editing. (Though I
have to admit that the main reason I don't use more Squeak is that I
can't easily edit it in Emacs.)

The second reason is the ultimate blackboard, the try-and-error playground
which is built in: irb. Readline support, even completion is available, and
the success for the most basic things is immediately visible, which is
invaluable for overall success and progress.

Is irb that much better than an evaluation window? Squeak is even
more "live" than Ruby.

···

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

benjohn@fysh.org wrote:

Jeremy Tregunna wrote:

If you can teach someone to program, learning a new language isn't
going to be a big problem. Your decision should be less about the
language and more about the concepts you need to be teaching. Scheme
is an excellent language for teaching people how to program. Sure,
most of them are unlikely to use scheme much if ever in day to day
operations on the job (if they choose to go down this path and stick
with it), but it's an excellent language to teach programming concepts.

I completely agree with the above.

Now that I think about it, I suppose that the language is not that important. I won't be teaching a bunch of people who are interested in programming as a hobby, nevermind professionally.

The Programming I course is part of a program at my school called the Academy of Information Technology. The purpose of the program is to expose students to lots of career possibilities in the IT field. That means we get lots of half-year courses. The full run of the academy lasts three years, sophmore to senior, and covers a quick run through computer history, programming, relational databases, systems support, networking, and a full year of Microsoft Office (woo).

I'll be lucky (luckier than a lucky stiff!) if I get one or two people who are actually interested in programming. So maybe it would be detrimental if I were to get 'too' geeky/in-depth. My target audience will probably use the concepts taught in simple Excel formulas.

I'm completely torn on the issue of Scheme or Ruby now. I've seen a major point on each side of the debate:

A. Scheme, if unelegant looking, does have simple, consistant syntax, allowing people to focus more on learning 'programming' as opposed to learning Scheme.

B. Ruby offers many ways to do things, syntax-wise. Only one way could be taught and stuck to, and those interested could explore on their own. All the same, it would be easy to get caught up in Ruby syntax instead of programming.

James Britt wrote:

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.

I suppose I have to agree with you. That said, we *are* children, and we do act like children (some a good deal more than others).

I think one of my school's biggest problems with all of its classes involving computers is that teachers ignore it when you screw around on MySpace or Miniclip all class. Students no longer take the class seriously, and are not there to learn, but to check their e-mail. Of course, a typical American teenager's (lack of?) desire to learn is a whole nother topic.

Keith Fahlgren wrote:

Now, if you're learning programming in Ruby, an IDE may not be as important, but it's probably useful to remove as many barriers to entry as possible--you want the kids to be learning the language, not :wq or CTRL-X CTRL-C.

This is my reluctance to open up the Windows command line. James, however, put that reluctance away by pointing out that programming is about understanding your world. I guess introducing people to such a beast does have a place in Programming I, even if its just to better farmiliarize people with their Windows environment.

All the same, a DrScheme-like frontend to irb would be a big convinience to everyone. Less typing == less errors == less confusion == less frustration-in-an-already-challenging-situation. IMHO.

Christian Neukirchen wrote:

Of course, that's a question of time. If you only have a half or a
full year, you need to stop digging deeper pretty soon; depending on
what you really want them to learn. Give foundations for figuring out
This has slightly confused me, but I'll admit that it's been a while since I've dealt with this sort of thing, so jump in with corrections as required.

  - A language has first-class functions when a function can be assigned to variable, passed to or returned from another function, and so on. In Ruby, a = lambda { |x| x + 1 } for example.

  - The distinction between Lisp-1 and Lisp-2 that the latter has a separate namespace for functions, in Ruby, for example, def a(x) x + 1; end can exist alongside a = lambda { |x| x + 1 } (and there's a corresponding hoop to jump through to call the lambda).

What I don't understand is how it follows that being in a different namespace implies that Lisp-2 doesn't have true first-class functions. The only reason I can think of is the circular one that "only Lisp-1 has true first-class functions", which gives it the distinct flavour of an age-old Lisp holy war (if that's the case, consider me uninterested).

Nothing holds less truth than the phrase 'there is always a better wizard than you'. I'll admit that I've never had any formal CS training, and until recently, my experiences have been limited to PHP4/MySQL/Oracle stuff. (I'm a self-taught sixteen year old with some obscene amount of time invested in fiddling with PHP, then had my education greatly sped up when I was recruited as a web app developer for a small ISP.)

No object stuff. Limited technical vocabulary. I'm not qualified to teach the class, but (all ego aside, really!) I am probably more qualified than one of our business teachers, who has no experience with programming. So I suppose I have some learning of my own to do before the '07 schoolyear. :slight_smile:

I am very grateful to you all for your inputs. I did not anticipate such an overwhelming response. Thanks!

···

on their own. Matthew Smillie wrote:

This is the second statement I want to support with all emphasis. The
/concepts/ are more important than any specific language skill at the end of
the day. There is no need to teach every possible way (as mentioned somewhere
else in this thread): the skillful will find the way, the less skillfull will
work with what has been given to them.

I am currently in finals week for two courses I am teaching using Ruby at the Art Institute of Phoenix and I can attest whole heartedly to this sentiment. With the caveat that I a have students that are either 50% programming / 50% art students or 100% art students and are taking a required course, my experience has been that the concepts are where people are getting hung up, not the syntax/language constructs. As a result I am changing my curriculum for next quarter to be MUCH heavier on non-computer related exercises that promote a healthy dose of critical thinking and problem solving abilities. I?m not sue exactly what kind of students you are going to get but I find that critical thinking is a skill that needs to be developed a bit before going anywhere near an IDE.

As for a Ruby vs Scheme I have also found a fair amount of people have dabbled at least a little in programming related topics. Perhaps it?s adding a Javascript do-dad to their website or (since these are artists) a simple Flash game. The more familiar syntax of Ruby was a big win there. It was especially rewarding to ask the students to ?write? a program by just calling out some pseudocode which I could baby sit on the whiteboard as we came to a solution. When it was all done I told them to type that into their editor and run it. The Ruby syntax and the problem I had chosen went together very well and it really was a case of executable pseudocode which I think helped with some of the fears about the ?strangeness? of programming.

Now I only have 11 weeks while you have half a year so obviously your course can be a bit more full that mine bit I find that I can get up to objects but not cover them in any particular depth. For our final projects we did a lot involving the File and Directory classes as many people wanted to write helper utilities to clean up files or rearrange them. This practical application seems to have gone over pretty well as the students can see how this skill can benefit them on a day to day basis. I?m not sure I could have gotten to the same point using something like Scheme (and yes, I did consider it for this course).

Hopefully this will be useful to you in some degree. I plan on putting up all my course material and posting a link once I have incorporated the changes from this quarter.

David Koontz

Nicholas Evans 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 Britt

"The greatest obstacle to discovery is not ignorance, but the illusion of knowledge."
  - D. Boorstin

ReggW wrote:

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

All right, I'm listening. How would an IDE help?

Matthew Smillie wrote:

...
As a trivial (and somewhat absurd) example, let's say the exercise is to write an array-sorting routine. In teaching terms, this has the practical value of getting them familiar with arrays and fundamental operations (setting, accessing, comparing), and demonstrates theoretical points about efficiency (bubble sort, anyone?), algorithms, and depending on exactly what the algorithm is, recursion or notions of combining small local operations to effect a global result. On the other hand, a student could write "arr.sort" and have accomplished the same task having learned nothing more than how the docs are organised.

I appreciate the detailed post. I've only done a limited amount of
teaching, so much of what I believe may be ill-founded; it's certainly
difficult for me to present it as little more than gut feeling and the
results of personal experience. (And my questions are not directed to you, but are the things that I was asking myself.)

If writing arr.sort would have satisfied the requirements of the
exercise, then a student may not quite understand why it is not the right answer. If the requirements are to demonstrate a knowledge of algorithm design and analysis, then (purely speculative voice speaking here, mind you) the exercise should be designed to enforce that, or at least make clear why simply using a built-in function is an insufficient solution.

And it may be that for teaching fundamental computer science concepts
that Ruby is a poor choice, precisely because it abstracts away so many
details. Or that exercises must be more carefully designed so that the features of the language do not force students into solutions they would never bother with in real life, nor allow for sloppy design. (I'm wondering if students should have to maintain and debug each others code. They'd get fed up fast.)

There are two less-trivial examples that I've seen a few times that are worth mentioning in this context.

Some of the students in the course I taught had only ever programmed in Prolog before - and a couple of them were extremely proficient at it. They tended (in Java) to end up finding ways to make everything effectively global. They accomplished the task, more or less, but did they learn anything valuable about encapsulation or OO design? Not really.

Why would they? I don't mean to sound trollish, but, all things being
equal, if they can write code that runs and produces the correct answer,
where is the failing? How do things get to that point? Are students
allowed to keep coding like that? What would motivate them to do
things differently?

I have a CS degree, and can safely say that while I learned all sorts of
CompSci things, I didn't really learn to program well until I coded
large projects, after graduation. Class assignments rarely had enough
of the real-world nastiness that make clear why certain design and
development practices are to be preferred. For the most part,
lessons were more focused on language syntax or dealing with the linker.
So, while teachers may have commented on poor procedure or function
design, it was not a key point.

It is very hard to come up with really good tutorial examples.
Gratuitous class definitions are likely to give the impression that OO
is all about more lines of code.

Without some clear understanding of what OOP is for, and when to
use it (or not), I think it pretty reasonable that people use globals and write long streams of procedural code. The code runs, and they'll never have to maintain it. It passes the unit tests, so to speak.

It may be difficult for some people to "get" OO, but that may be because
they are asked to apply it without a compelling reason.

(Perhaps exercises should always have multiple stages, with each next phase introducing some new requirement that is sure to make life hard for students who haven't applied some basic OO design. )

... So no, the point of a programming exercise is not simply for a student to produce the desired output, but rather to teach students something more fundamental about programming in a practical way. Philosophically, it's not just where you end up, it's how you get there.

Absolutely. Do the students know this? (I'm being rhetorical).
Because I can imagine telling a group of students to all go to the top
of the Sears Tower in Chicago, and then complaining that they took the
elevator, not the stairs.

... (much good stuff chopped out)

A more subtle point is that the instructor isn't teaching you Ruby, s/ he's teaching you how to program. Ruby does have a lot going for it in this regard: first-order functions, object-orientation, and so on. But my point is that Ruby's concise nature is an argument against using it to teach general principles, because the syntax takes many of those general principles as already understood, and tucks them out of the way.

It seems that, in what you've described, there are multiple problems at play: Teaching basic programming concepts; teaching the syntax and semantics of a particular language; undoing the harm of students who have already acquired poor techniques and misconceptions from previous classes or personal hacking.

If this is what the OP has to face, I'd argue for Scheme if for no other reason that students will not have the false impression that it is "just like" what they think they know about Java|PHP|Perl.

···

--
James Britt

"Take eloquence and wring its neck."
  - Paul Verlaine

I think that Ruby is an excellent vehicle for teaching programming. I have a
couple of suggestions:

1) Get a copy of "Learn To Program" by Chris Pine. It does precisely what
you want to do: teach programming using Ruby. You should easily be able to
build a curriculum from the material in this book. You can find it here:

   http://www.pragmaticprogrammer.com/titles/fr_ltp/index.html

2) If you use the One-Click Ruby Installer for Windows (
http://rubyinstaller.rubyforge.org/\), it includes the FreeRIDE IDE (
http://freeride.rubyforge.org/\).

Good luck!

Curt

···

On 6/11/06, Nicholas Evans <OwlManAtt@owlmanatt.com> 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.

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

Matthew Smillie <M.B.Smillie@sms.ed.ac.uk> writes:

Ruby does have a lot going for it in this regard: first-order
functions,

Did I miss something?

···

matthew smillie

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org