I say leave out the ‘then’. The less is on the page, the easier it is to
understand. Taken to the extreme of making it look like english, you could
tell them if statements look like:
if cond then#do#the#following
…
else#do#something#else
…
end
My vote is for keeping it simple. if statements are already pretty englishy
and intuitive. And I would only show them the multi-line if statement,
because with it they don’t need the single-line version to do what they
want.
Also, I would leave out ‘unless’. It’s just another thing for them to
remember. A nuby never wants to hear: “Well, you already know how to do X,
but here are two more ways to do X.” If you’re going to be teaching them
something, have it always be something new.
After your tutorial, they can go read the pickaxe or something if they want
to know a few more ways to do X.
Moreover, if children see ‘if … then’ as a natural mapping of English
to Ruby, they’ll probably try other constructions and be disappointed
when they don’t work: “Why it is like English in one case and so strange
in the other?” IMHO it’s good to have them realize from the beginning
that Ruby is not a natural language, that you cannot express things
any way you like, and that there’s some things that have to be learned
first.
···
On Sun, Dec 08, 2002 at 07:30:56AM +0900, Chris Pine wrote:
I say leave out the ‘then’. The less is on the page, the easier it is to
understand. Taken to the extreme of making it look like english, you could
tell them if statements look like:
if cond then#do#the#following
…
else#do#something#else
…
end
My vote is for keeping it simple. if statements are already pretty englishy
and intuitive. And I would only show them the multi-line if statement,
because with it they don’t need the single-line version to do what they
want.
Also, I would leave out ‘unless’. It’s just another thing for them to
remember. A nuby never wants to hear: “Well, you already know how to do X,
but here are two more ways to do X.” If you’re going to be teaching them
something, have it always be something new.
After your tutorial, they can go read the pickaxe or something if they want
to know a few more ways to do X.
Moreover, if children see ‘if … then’ as a natural mapping of English
to Ruby, they’ll probably try other constructions and be disappointed
when they don’t work: “Why it is like English in one case and so strange
in the other?” IMHO it’s good to have them realize from the beginning
that Ruby is not a natural language, that you cannot express things
any way you like, and that there’s some things that have to be learned
first.
Good point. My little brother had similar struggles while learning how to
program.