Printing why's (poignant) guide to ruby

R

Richard Dale

I'd like to try ruby on non-programmers teaching them using why's amazing
guide, to see how it works as a beginner's language. I showed some ruby
code to my 45 year old lodger who has never used a computer or seen a
computer program. He said "it looks like English, I thought computer
programming was maths". And he is especially impressed with the cartoon
foxes in Chapter 3, they have got to be the killer feature..

But it would be great to be able to print the guide out as a PDF. Is there a
version with markup available, so it can translated to a PDF to make it
easier to print?

-- Richard
 
N

Navindra Umanee

Richard Dale said:
I'd like to try ruby on non-programmers teaching them using why's amazing
guide, to see how it works as a beginner's language. I showed some ruby
code to my 45 year old lodger who has never used a computer or seen a
computer program. He said "it looks like English, I thought computer
programming was maths". And he is especially impressed with the cartoon
foxes in Chapter 3, they have got to be the killer feature..

Oh you think Ruby might be suitable for a total beginner?

I have the same problem. My dad wants to learn programming. I
thought maybe Python or even Visual Basic (or one of the KDE
implementations) might be more suitable. He's going to be pretty much
learning on his own, so a suitable book and references must be
available. With something like Visual Basic, he'll probably be able
to get immediate and more gratifying results as well, which should
help keep up the motivation.

I've seen some interesting beginner books for Python that make it a
strong contender as well. One thing that might be a problem at first
is the whitespace issue...

Somehow I'm not sure that Ruby would fit the bill here but I'm
interested in hearing of other's experiences/opinions. I never
considered/read why's guide before but I'll have to take a look now.

Cheers,
Navin.
 
J

Joao Pedrosa

Hi,

Oh you think Ruby might be suitable for a total beginner?

I have the same problem. My dad wants to learn programming. I
thought maybe Python or even Visual Basic (or one of the KDE
implementations) might be more suitable. He's going to be pretty much
learning on his own, so a suitable book and references must be
available. With something like Visual Basic, he'll probably be able
to get immediate and more gratifying results as well, which should
help keep up the motivation.

I've seen some interesting beginner books for Python that make it a
strong contender as well. One thing that might be a problem at first
is the whitespace issue...

Somehow I'm not sure that Ruby would fit the bill here but I'm
interested in hearing of other's experiences/opinions. I never
considered/read why's guide before but I'll have to take a look now.

Visual Basic too needs some thinking to put together a program. I
would say that the event-based programming of tools like VB is hard
enough to understand to make them suitable to total beginners, unless
they are kids who are not afraid of trying out things. :)

I think that the development of non-gui apps is generally easier to
get a grasp of. The one execution path of such apps should help a
beginner understand what programming is all about (you wish :p).

Anyways, there are some materials on the net that you could use. Of
course that you will need to help him setup everything.

I would go with Ruby. :)

Regards,
Joao
 
C

Caio Tiago Oliveira

Alexander Kellett, 13/2/2005 19:17:
i'm really puzzled by this.
why python? or even worse. vb??!!


I think Ruby easier to learn than Python for a beginer.
Python may be easier for someone migrating from C.
Both languages are quite easy for the beginners, and people who have
never programed can do interesting things in the first or second day.
 
A

Anders Engström

Oh you think Ruby might be suitable for a total beginner?

I think Ruby would be a great language for a 'total' beginner. First -
the syntax and "wording" makes look and feel very natural IMO. Second -
all you need is a text editor and Ruby itself - no confusing steps where
you have to "make", "compile" or "build" anything. Just "run" your
program (this is of course true for all scripting languages). Third -
there is no need to introduce object oriented concepts such as classes
and objects before the user is ready for them. Compare the standard
Hello World example in Ruby with one in java:

Ruby:

(hello.rb)
puts "Hello World"

$> ruby hello.rb

Java:

(Hello.java)
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World");
}
}

$>javac Hello.java
$>java Hello

The java example prints out the same stuff as the Ruby example, but the
novice user would think: "What is a class?", "What is 'public'?", "What
is 'static'?", "What about that 'args' stuff?", "Where did that
Hello.class file come from, and why do I run 'java Hello' and not 'java
Hello.class'?" etc.

//Anders
 
M

Michael Walter

The Ruby user would think "Who puts?" :)

Michael

Oh you think Ruby might be suitable for a total beginner?

I think Ruby would be a great language for a 'total' beginner. First -
the syntax and "wording" makes look and feel very natural IMO. Second -
all you need is a text editor and Ruby itself - no confusing steps where
you have to "make", "compile" or "build" anything. Just "run" your
program (this is of course true for all scripting languages). Third -
there is no need to introduce object oriented concepts such as classes
and objects before the user is ready for them. Compare the standard
Hello World example in Ruby with one in java:

Ruby:

(hello.rb)
puts "Hello World"

$> ruby hello.rb

Java:

(Hello.java)
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World");
}
}

$>javac Hello.java
$>java Hello

The java example prints out the same stuff as the Ruby example, but the
novice user would think: "What is a class?", "What is 'public'?", "What
is 'static'?", "What about that 'args' stuff?", "Where did that
Hello.class file come from, and why do I run 'java Hello' and not 'java
Hello.class'?" etc.

//Anders
--
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Anders Engström (e-mail address removed)
. http://www.gnejs.net PGP-Key: ED010E7F
. [Your mind is like an umbrella. It doesn't work unless you open it.]
 
T

Timothy Hunter

i'm really puzzled by this.
why python? or even worse. vb??!!

Alex

I agree that Ruby would make a good "first" language, but I have to
admit that _why's book probably won't be the best guide for your Dad.
It's a great book, don't get me wrong, but it's way too, ah,
avant-guarde for Dad-type people. Unless your dad is an IPod-dancing
Halo II champion that likes to party all night, that is. :)
 
N

Navindra Umanee

Alexander Kellett said:
i'm really puzzled by this.
why python? or even worse. vb??!!

How is a total beginner going to learn Ruby? By reading Pickaxe? I'm
not talking about a CS student here. My dad lives half-way around the
world from me.

Besides, Python is a more restricted and syntactically uniform
language. Ruby is more flexible and expressive, but IMHO to really
understand the code you have to know more CS concepts and have a
deeper understanding of the syntax than some people like to admit.

Even though in Ruby you can abuse the syntax or treat it glibly --
which makes it look like a nice thing for experienced programmers -- I
think it is better to understand what you are doing first. Python
forces you to understand these issues.

I prefer Ruby but I think Python will be easier for a beginner to
grasp at the beginning, and it has less hurdles as well
documentation/book-wise -- I even saw one of the beginner books
describe how to implement a neat graphical game in a few steps.

And yeah, VB has wizards and stuff on top of plenty of documentation.
Like I said, quicker gratification can be a good thing. Someone used
to fancy windows and GUI stuff probably isn't going to be happy stuck
at the command-line level. Joao makes a good point, of course.

Cheers,
Navin.
 
R

Richard Dale

Alexander said:
i'm really puzzled by this.
why python? or even worse. vb??!!
Why do you think they are easier to learn than ruby? I'd just like to try
teaching non-programmers programming and find out what it is they don't
know. Or if they don't know much can they get started and learn
incremently?

From Alan Kay's recent interview:

http://acmqueue.org/modules.php?name=Content&pa=showpage&pid=273

"Basically what happened is this vehicle became more and more a programmer’s
vehicle and less and less a children’s vehicle—the version that got put
out, Smalltalk ’80, I don’t think it was ever programmed by a child. I
don’t think it could have been programmed by a child because it had lost
some of its amenities, even as it gained pragmatic power."

I don't think Why's is the first in the line of 'cartoon computer science
books'. I have 'Think about [TLC] Logo - A Graphic Look at Computing with
Ideas' by John R. Allen, Ruth E. Davis and John F. Johnson. It has great
cartoons, and is written by serious people (I believe why is very serious
too - that's why he's so funny).

People don't seem to want teach computer programming to children anymore (or
45 year old beginners)..

-- Richard
 
A

Anders Engström

"Hello, world!".display

Ok, that's probably more intuitive :) But not if you want to achieve the
same effect as 'puts'. Then you'd have to change it to:

"Hello World!\n".display

That '\n' is pretty confusing for a newbie.

//Anders
 
C

Caio Tiago Oliveira

Navindra Umanee, 13/2/2005 20:19:
How is a total beginner going to learn Ruby? By reading Pickaxe? I'm
not talking about a CS student here. My dad lives half-way around the
world from me.

Besides, Python is a more restricted and syntactically uniform
language. Ruby is more flexible and expressive, but IMHO to really
understand the code you have to know more CS concepts and have a
deeper understanding of the syntax than some people like to admit.

Even though in Ruby you can abuse the syntax or treat it glibly --
which makes it look like a nice thing for experienced programmers -- I
think it is better to understand what you are doing first. Python
forces you to understand these issues.

I prefer Ruby but I think Python will be easier for a beginner to
grasp at the beginning, and it has less hurdles as well
documentation/book-wise -- I even saw one of the beginner books
describe how to implement a neat graphical game in a few steps.

And yeah, VB has wizards and stuff on top of plenty of documentation.
Like I said, quicker gratification can be a good thing. Someone used
to fancy windows and GUI stuff probably isn't going to be happy stuck
at the command-line level. Joao makes a good point, of course.



Someone posted this code here:
def fib:
a, b = 1, 1
while true:
yield a
a, b = b, a+b

It fails. Ask why! Because are missing '()' after 'fib'.
Ruby is more prolixe. It's bad to refactoring tools, but is easier for
the ones who can't remember the names of everything.
Isn't a good thing you got errors because is missing a space, or because
you couldn't choose a number so great
(try
j = 0
for i in range(1000000000):
j = j + 1

).
 
C

Caio Tiago Oliveira

Anders Engström, 13/2/2005 21:03:
Ok, that's probably more intuitive :) But not if you want to achieve the
same effect as 'puts'. Then you'd have to change it to:

"Hello World!\n".display

That '\n' is pretty confusing for a newbie.

"Hello world!
I'm here.
".display


Without "\n"!
 
J

James Britt

Anders said:
That '\n' is pretty confusing for a newbie.

How do you know that?

I'd be interested in any good sources that detail the sort of things
different types of newbies find troublesome or confusing.

Offhand, I don't quite see that "\n" would be such a problem given a
reasonably succinct explanation. My own experience with teaching
programming newbies suggests that most of them are comfortable with
fairly straight-forward edicts (e.g., "That's just how you tell the
computer to start writing to a new line").

It's the more abstract stuff (e.g., blocks, high-order functions, even
the notion of a variable) that spooks them.

James
 
W

William James

Caio said:
Anders Engström, 13/2/2005 21:03:

"Hello world!
I'm here.
".display


Without "\n"!

Nice. I didn't know that. Ruby certainly has a lot of bells and
whistles.
 
S

Shalev NessAiver

--Apple-Mail-1--951252625
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=ISO-8859-1;
format=flowed

I agree. I've just started teaching someone C++ and he had no problem=20
with \n. This is the first time he's ever looked at a language but,=20
even so, it's not like he's a dumb person. Often times it seems we=20
(programmers) underestimate the ability of non-programmers to learn=20
programming. We tell ourselves that the only reason it looks simple to=20=

us is because we're so used to it when, really, a lot of it is pretty=20
simple. The parts that we find a bit difficult - that's what we should=20=

focus on. (That last statement may be a little to limiting, it's just=20=

a thought).

-Shalev

How do you know that?

I'd be interested in any good sources that detail the sort of things=20=
different types of newbies find troublesome or confusing.

Offhand, I don't quite see that "\n" would be such a problem given a=20=
reasonably succinct explanation. My own experience with teaching=20
programming newbies suggests that most of them are comfortable with=20
fairly straight-forward edicts (e.g., "That's just how you tell the=20
computer to start writing to a new line").

It's the more abstract stuff (e.g., blocks, high-order functions, even=20=
the notion of a variable) that spooks them.

James

--Apple-Mail-1--951252625--
 
M

Matthew Margolis

James said:
How do you know that?

I'd be interested in any good sources that detail the sort of things
different types of newbies find troublesome or confusing.

Offhand, I don't quite see that "\n" would be such a problem given a
reasonably succinct explanation. My own experience with teaching
programming newbies suggests that most of them are comfortable with
fairly straight-forward edicts (e.g., "That's just how you tell the
computer to start writing to a new line").

It's the more abstract stuff (e.g., blocks, high-order functions, even
the notion of a variable) that spooks them.

James
I have to agree with James. I taught several young children the basics
of ruby over the summer and they had no problem with the concept of a
newline. They know what the return key does on a keyboard, just tell
them that it is like that.
Ruby is a great first language. If someone has no programming
experience then it would be ideal if they had a mentor they could talk
to for the basics and OO stuff but I see no reason why someone couldn't
learn ruby and programming from a combination of
http://pine.fm/LearnToProgram/ , Programming Ruby and,
http://poignantguide.net/ruby/.

-Matthew Margolis
 
N

Navindra Umanee

def fib:
Um yeah the whole program is syntactically wrong. Fortunately Python
tells you there's an error on practically every single line.

Whoops. Okay the whole program is not syntactically wrong... I cut
and paste the code into the interpreter instead of trying it from a
file, so it rejected everything since it couldn't get past the first
line.

I also got confused seeing "yield" there. Hmm, I didn't know Python
supported that.

Later,
Navin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top