Newsgroup

Hello,
How can I subscribe to the comp.lang.ruby newsgroup?

Daniel.

Daniel Carrera wrote:

How can I subscribe to the comp.lang.ruby newsgroup?

Not sure what you’re asking.

It (comp.lang.ruby) is a publically available Usenet newsgroup, and so
if your internet service provider (ISP) provides a news server you
should be able to get to it through them. If your ISP doesn’t provide
newsgroup access, there are a number of free Usenet newsgroup providers
(do a Google search for “free Usenet”).

If you know that it’s available, and you’re asking about how to actually
go about reading the newsgroup, you’ll want to install some software
that allows you to do so. Under Windows, Outlook Express is probably the
easiest choice since it comes with the OS (although there are arguably
better choices for news reader software under Windows). Under Linux, I
currently use Mozilla although there are tons of other options.

Please follow up with more specific question(s) if this doesn’t help!

  1. You need not to…
    PragDave built a gateway between ruby-talk and comp.lang.ruby, so if
    you’re reading this mailing list you should be getting (almost) all the
    posts in c.l.r. (and the SPAM too :expressionless: )

  2. non-moderated newsgroups need no subscription, you’d only have to
    configure your newsreader. But again, you don’t want to do it anyway, as
    you’re already getting the whole picture.

···

On Tue, Dec 03, 2002 at 03:37:03AM +0900, Daniel Carrera wrote:

Hello,
How can I subscribe to the comp.lang.ruby newsgroup?


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Sigh. I like to think it’s just the Linux people who want to be on
the “leading edge” so bad they walk right off the precipice.
– Craig E. Groeschel

In addition, this mailing list is a mirror of the newsgroup, so there’s no
explicit need to read the newsgroup if you’re on the mailing list.

Chris

How can I subscribe to the comp.lang.ruby newsgroup?

Not sure what you’re asking.

Well, I’ve never used a newsgroup, so I didn’t really know what to ask.

But you did answer my question. I looked at Mozilla and set up an
account. I asks for a server name, and I’m sure that here I’d put in one
of the free usenet servers you talked about.

Thank you for your help. Most appreciated.

Daniel.

Tue, 3 Dec 2002 04:42:38 +0900: Mauricio Fernández (Mauricio Fernández
batsman.geo@yahoo.com):

  1. non-moderated newsgroups need no subscription, you’d only have to
    configure your newsreader. But again, you don’t want to do it anyway,
    as you’re already getting the whole picture.

To a point; However, there’s perfectly good reason to use usenet rather
than the mailing list. With such a high-traffic list as this, the usenet
form may be nicer (with usenet, you only download the mail headers
information on the first pass, from that you pick the ones you’d like to
read, and at that point, you’d download the mail bodies; it saves on
both bandwidth and time.)

···


< There is a light that shines on the frontier >
< And maybe someday, We’re gonna be there. >
< Rando Christensen / rando@babblica.net >

Ruby Book for People Who Aren’t (Yet) Programmers

In addition, this mailing list is a mirror of the newsgroup, so there’s no
explicit need to read the newsgroup if you’re on the mailing list.

Really? The reason why I wanted to look at the newsgroup was that I
thought I was missing out on neat discussions. I never got the post
‘Ruby Book for People Who Aren’t (Yet) Programmers’.

It looks interesting and I want to read it. Since I didn’t got it,
I figured that it was in the newsgroup.

Would someone be kind enough to forward me this post?

Thanks,
Daniel.

OTOH, when I see something I wat to read, I want to read it straight away, not
wait for it to be downloaded. I also like the fact that it’s on my machine and
I can search it (months) later.

Cheers,
Gavin

···

----- Original Message -----
From: “Rando Christensen” rando@babblica.net

Tue, 3 Dec 2002 04:42:38 +0900: Mauricio Fernández (Mauricio Fernández
batsman.geo@yahoo.com):

  1. non-moderated newsgroups need no subscription, you’d only have to
    configure your newsreader. But again, you don’t want to do it anyway,
    as you’re already getting the whole picture.

To a point; However, there’s perfectly good reason to use usenet rather
than the mailing list. With such a high-traffic list as this, the usenet
form may be nicer (with usenet, you only download the mail headers
information on the first pass, from that you pick the ones you’d like to
read, and at that point, you’d download the mail bodies; it saves on
both bandwidth and time.)

You might already have received it by now. Get used to receiving the
replies before the original posts in some cases, as the delivery delay
is different for each one.

···

On Tue, Dec 03, 2002 at 04:50:10AM +0900, Daniel Carrera wrote:

Ruby Book for People Who Aren’t (Yet) Programmers

In addition, this mailing list is a mirror of the newsgroup, so there’s no
explicit need to read the newsgroup if you’re on the mailing list.

Really? The reason why I wanted to look at the newsgroup was that I
thought I was missing out on neat discussions. I never got the post
‘Ruby Book for People Who Aren’t (Yet) Programmers’.

It looks interesting and I want to read it. Since I didn’t got it,
I figured that it was in the newsgroup.

Would someone be kind enough to forward me this post?


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

We are MicroSoft. You will be assimilated. Resistance is futile.
– Attributed to B.G., Gill Bates

From: “Rando Christensen” rando@babblica.net

To a point; However, there’s perfectly good reason to use usenet rather
than the mailing list. [SNIP]

OTOH, when I see something I wat to read, I want to read it straight away,
not wait for it to be downloaded.

Just like with usenet then.

                              I also like the fact that it's on my

machine and I can search it (months) later.

Just like with usenet then.

If your experience of usenet isn’t the same as above then your experience of
usenet isn’t the same as above. Your experience of usenet isn’t everyone’s
usenet.

···

----- Original Message -----


Dave Pearson
http://www.davep.org/

…and that’s why I’m using slrn+slrnpull. Usenet is a way better solution
than mailing lists for me, and the only reason I’m using mutt instead of
slrn to read and write to comp.lang.ruby/ruby-talk is that there’s no
such group like comp.lang.ruby on my news server.

···

On Tue, Dec 03, 2002 at 09:55:34AM +0900, Gavin Sinclair wrote:

  1. non-moderated newsgroups need no subscription, you’d only have to
    configure your newsreader. But again, you don’t want to do it anyway,
    as you’re already getting the whole picture.
    To a point; However, there’s perfectly good reason to use usenet rather
    than the mailing list. With such a high-traffic list as this, the usenet
    form may be nicer (with usenet, you only download the mail headers
    information on the first pass, from that you pick the ones you’d like to
    read, and at that point, you’d download the mail bodies; it saves on
    both bandwidth and time.)
    OTOH, when I see something I wat to read, I want to read it straight away, not
    wait for it to be downloaded. I also like the fact that it’s on my machine and
    I can search it (months) later.

    gminick (at) underground.org.pl http://gminick.linuxsecurity.pl/
    [ “Po prostu lubie poranna samotnosc, bo wtedy kawa smakuje najlepiej.” ]

You might already have received it by now. Get used to receiving the
replies before the original posts in some cases, as the delivery delay
is different for each one.

I still haven’t received it.
Would someone mind sending me a copy of the message
“Ruby Book for People Who Aren’t (Yet) Programmers”

Daniel.

That’s unusual - I am ML-only and I received it. Anyway, it’s reprinted below.

···

----- Original Message -----
From: “Daniel Carrera” dcarrera@math.umd.edu

You might already have received it by now. Get used to receiving the
replies before the original posts in some cases, as the delivery delay
is different for each one.

I still haven’t received it.
Would someone mind sending me a copy of the message
“Ruby Book for People Who Aren’t (Yet) Programmers”

Daniel.


Hello,

I heard a little while back that there might be a Ruby book in the works for
people who don’t (yet) program. Anyone know who is working on this?

I ask because I have taught several people to program using Ruby as the
language. Some were adults; some kids as young as 8. Not all of my
experiences were successful :(, though some certainly were.

In any case, I learned from each one and would like to share what I found to
work, and what I found not to work.

One thing I did find, though, was the Ruby is the perfect language for
learning to program! (I have tought people C before, too… it was as
excruciating as I remembered it being when I first learned it. Ugh! My
first 8 hours (and 20 lines) of C programming consisted almost entirely of
me staring at the screen, saying “So what the **** do I do now??” After a
while, C became second-nature to me, and I blocked all of that out, but that
first program was misery incarnate.)

Chris

I heard a little while back that there might be a Ruby book in the works for
people who don’t (yet) program. Anyone know who is working on this?

If anyone is working on this I would be very interested as well.

I am actually thinking of trying to make a tutorial for precisely this
purpose. I’m just getting started, so there’s nothing really there yet.
But you can look at what I here:

www.math.umd.edu/~dcarrera/ruby/index.html

I ask because I have taught several people to program using Ruby as the
language. Some were adults; some kids as young as 8. Not all of my
experiences were successful :(, though some certainly were.

In any case, I learned from each one and would like to share what I found to
work, and what I found not to work.

I’d love to hear from your experience. I’m not sure if I’ll go through
with the tutorial. I really don’t know how much work it’ll turn out to
be. But I’d love to learn whatever I can from you. I am interested in
using Ruby to teach people how to program.

One thing I did find, though, was the Ruby is the perfect language for
learning to program!

I feel precisely the same way (though I don’t have experience to back it
up). Ruby is a very clean, easy to understand programming language. It
allows you to introduce object orientation if and when you want. And when
you do, it’s easy to go down to the topics.

I love how you can focus on creating a program, instead of arm-wresling
with the language.

Daniel.

I heard a little while back that there might be a Ruby book in the works
for
people who don’t (yet) program. Anyone know who is working on this?

If anyone is working on this I would be very interested as well.

I am actually thinking of trying to make a tutorial for precisely this
purpose. I’m just getting started, so there’s nothing really there yet.
But you can look at what I here:

www.math.umd.edu/~dcarrera/ruby/index.html

I just had a quick look and I’m very impressed. Even if you just completed the
sections (the array and hash pages are actually non-existent at the moment) it
would be a great tutorial. As far as I know, there’s nothing out there quite
like it, and the time is definitely right for a Ruby tutorial.

Remeber, there’s no need to make it “complete” - it’s pitched at beginners and
there is already a perfect complete online book. So there’s no need to feel
like you need to do heaps of work to get this one done.

I’ll give greater feedback when I get some time (hopefully today).

Cheers,
Gavin

···

From: “Daniel Carrera” dcarrera@math.umd.edu

Impressive! I hope you do decide to go through with it (I’d be glad to
help, if you find it too time-consuming - I’m interested in the
‘teaching programming from scratch’ process, and Ruby is a fine
language to do it in).

martin

···

Daniel Carrera dcarrera@math.umd.edu wrote:

I am actually thinking of trying to make a tutorial for precisely this
purpose. I’m just getting started, so there’s nothing really there yet.
But you can look at what I here:

www.math.umd.edu/~dcarrera/ruby/index.html

Perhaps you should introduce IRB right at the beginning, so that people
can play with more immediate examples. (On the other hand, the
ubiquitous return value could be confusing - how hard would a beginner’s
mode that outputs something only when asked to be to hack up?).

One suggestion - have an ‘Objects’ section before ‘Variables’ - start
with defining an object (don’t introduce the term ‘object oriented
programming’, or classes - just make it seem like an object is the
natural unit of data storage), and then segue into variables.

Feel free to use as much or as little of the following as you wish:

<<EOF

What is an Object?

An object is a piece of data stored by Ruby. Objects have a /type/ (the
type of data stored in them) and a /value/ (the data itself). Some typical
objects are

Value Type

···

Daniel Carrera dcarrera@math.umd.edu wrote:

I am actually thinking of trying to make a tutorial for precisely this
purpose. I’m just getting started, so there’s nothing really there yet.
But you can look at what I here:

www.math.umd.edu/~dcarrera/ruby/index.html


5 Integer
3.14 Float
“Hello” String
[1,2,3] Array (an array is a collection of objects)

Ruby also provides a rich set of /methods/ and /operators/ to help in
working with its objects.

Methods:
A method is a function that acts on an object and returns another
object. An example is the ‘next’ method, which returns an integer that
is one greater than the given integer. Methods are called using the
notation /object.method/ - try the following example

puts 5 # → 5
puts 5.next # → 6

The set of methods a given object has depends on its type - for
instance, objects of type Float have no ‘next’ method

puts 2.3.next # → undefined method ‘next’ for 2.3:Float

which tells us that we tried to use a method (‘next’) on an object of
value 2.3 and type Float, for which there was no ‘next’ method.

Since the methods an object has depends on its type, the full name of a
method includes both the type name and the method name. The usual
convention in Ruby documentation is to write this in the form
Type#method, so that we can say Integer#next exists, but Float#next
doesn’t.

Here are some examples of Ruby’s built in methods for Strings:

puts “Hello World” # → Hello World
puts “Hello World”.capitalize # → HELLO WORLD
puts “Hello World”.reverse # → dlroW olleH
puts “Hello World”.length # → 11

As the last example indicates, the object returned by the method need
not be of the same type as the original object.

Some methods require /arguments/ - these are additional objects passed
to the method in parentheses. For instance, the method String#index
searches a string for another string, and returns the position where
that string is found. However, unlike, say, String#reverse, which just
reverses the original String object, String#index needs to know another
object - the String we want to find. Here’s how it’s used:

puts “Hello World”.index(“lo”) # → 3

We call the method String#index of the object “Hello World”, and pass it
the additional object “lo” as an argument.

!Note: Since Ruby starts counting from 0, it finds “lo” at position 3
rather than 4

Operators:

An operator is a special kind of method that acts on two objects, and is
called using a symbol rather than a name. An example is the operator
‘+’, which adds two numbers:

puts 3 + 4 # → 7

If we were to do this via a conventional method, it would look something
like

puts 3.add(4)

which would do the same thing, but less conveniently.

All the basic arithmetic operators work in Ruby. Try the following:

puts 1 + 2 # → 3
puts 7 - 2 # → 5
puts 1.5 * 6 # → 9.0
puts 5/3 # → 1

At this point, you may well wonder what is going on in the last example.
The answer is that, like methods, what an operator returns depends on
the types of its /operands/ (the two objects it operates on). The /
operator performs ‘integer division’ if both its operands are integers,
that is, it rounds down to the nearest integer. If you want floating
point division, at least one of the operands should be a float:

puts 5.0/3 # → 1.666666667

!Note: Each operator is actually several different methods, depending on
the type of its left hand operand. The two we just saw are, in full,
Integer#/ and Float#/. This is sometimes referred to as ‘operator
overloading’.

Thanks to overloading, we can use the arithmetic operators with objects
of other types too, For instance, we have String#+ and String#* as shown:

puts “Hello” + “World” # → HelloWorld
puts “foo” * 3 # → foofoofoo

And similarly for Arrays:

p [1,2,3] + [4,5] # → [1,2,3,4,5]
p [“a”, “b”] * 3 # → [“a”, “b”, “a”, “b”, “a”, “n”]

!Note: We have introduced the ‘p’ function - p ‘pretty prints’ complex
objects like Arrays. To see the difference between ‘puts’ and ‘p’, try
the following:
puts [1,2,3]
p [1,2,3]

1
2
3
[1,2,3]

EOF

Then move into the concept of variables, referring always to ‘object
type’ rather than ‘variable type’.

Having introduced variables lets us talk about += and friends, and the !
methods. Then, before moving into flow control, I’d devote a chapter to
a more detailed look at methods,formalising the concepts of a receiver,
arguments and a return value, and showing how methods can be chained
since the return value is just another object.

This would also be a nice place to speak about operator precedence and
parentheses for forcing precedence. Also, be more explicit about what
parallel assignment does, and why it’s a nice thing.

martin

Perhaps you should introduce IRB right at the beginning, so that people
can play with more immediate examples.

That’s a very good idea. I’ll do that.

One suggestion - have an ‘Objects’ section before ‘Variables’ - start
with defining an object (don’t introduce the term ‘object oriented
programming’, or classes - just make it seem like an object is the
natural unit of data storage), and then segue into variables.

I see your point. Ruby is a pure object-oriented language, so we might as
well use OO terminology. I sort of began doing that. For instance, I
began unsing the word ‘method’ right away instead of talking about
‘functions’ and then object orientation.

Now, a problem I have with this that I want to get the reader doing
something as soon as possible. It is important to engage the student.

How about this?:

I can rewrite the “Variables” chapter to introduce objects right away.
I’d change the title to “Objects”. Something like this (my comments are
in [brackets]):

<<EOH
Objects

What is an object?

An /object/ is the fundamental unit of data storage in Ruby.
Objects have a /type/ (the type of data stored in them) and a /value/
(the data itself). Some examples include:

Value Type

···
 5      Fixnum

3.14 Float
“Hello” String

What is a variable?

A /variable/ is a name that Ruby can associate with a particular
object. For example:

city = “Toronto”

Here Ruby associates a String object (with value “Toronto”) with
the name (variable) /city/.

Think of it as Ruby making two tables. One with objects and another
with names for them. Then think of Ruby attaching a rope between
/city/ and the object “Toronto”. Whenever Ruby encounters /city/, it
will follow the string and arrive at this object.

Printing variables [should I call this ‘printing objects’?]

[ Same as now ]

Object types

We are going to look at the three most important object types:
/Fixnum/ (integers), /Float/ (decimals), /String/ (strings).

[
The rest would be like what I have now, except I’d use ‘Fixnum’,
‘Float’ and ‘String’ whenever possible. I’d also mention the
‘.length’ method, as you suggested.
]

!Note: Notice that the methods available depend on the object
! type. Not all objects have the same methods.

The usual convention in Ruby documentation is to write this in the form
Type#method, so that we can say Integer#next exists, but Float#next
doesn’t.

User input and the /chomp/ method

[ Same as before. Use the term /String/ more. ]

Excercises

[ Same ]

EOH

What do you think of this?

You had several other good ideas. But I think I want to delay them for a
later chapter.

Daniel.

I am actually thinking of trying to make a tutorial for precisely this
purpose. I’m just getting started, so there’s nothing really there yet.
But you can look at what I here:

www.math.umd.edu/~dcarrera/ruby/index.html

Perhaps you should introduce IRB right at the beginning, so that people
can play with more immediate examples. (On the other hand, the
ubiquitous return value could be confusing - how hard would a beginner’s
mode that outputs something only when asked to be to hack up?).

One suggestion - have an ‘Objects’ section before ‘Variables’ - start
with defining an object (don’t introduce the term ‘object oriented
programming’, or classes - just make it seem like an object is the
natural unit of data storage), and then segue into variables.

Feel free to use as much or as little of the following as you wish:

<<EOF

What is an Object?

[snip]

puts 5.0/3 # → 1.666666667

!Note: Each operator is actually several different methods, depending on
the type of its left hand operand. The two we just saw are, in full,
Integer#/ and Float#/. This is sometimes referred to as ‘operator
overloading’.

Isn’t it rather just an example of polymorphism (dynamic dispatch based
on the type of the receiver)? Anyway I don’t think these terms need to be
introduced in a tutorial.

Thanks to overloading, we can use the arithmetic operators with objects
of other types too, For instance, we have String#+ and String#* as shown:

puts “Hello” + “World” # → HelloWorld
puts “foo” * 3 # → foofoofoo

And similarly for Arrays:

p [1,2,3] + [4,5] # → [1,2,3,4,5]
p [“a”, “b”] * 3 # → [“a”, “b”, “a”, “b”, “a”, “n”]

!Note: We have introduced the ‘p’ function - p ‘pretty prints’ complex
objects like Arrays. To see the difference between ‘puts’ and ‘p’, try
the following:
puts [1,2,3]
p [1,2,3]

[…]

···

On Tue, Dec 03, 2002 at 08:52:25PM +0900, Martin DeMello wrote:

Daniel Carrera dcarrera@math.umd.edu wrote:


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Sigh. I like to think it’s just the Linux people who want to be on
the “leading edge” so bad they walk right off the precipice.
– Craig E. Groeschel

Hi –

              Objects

What is an object?

An /object/ is the fundamental unit of data storage in Ruby.
Objects have a /type/ (the type of data stored in them) and a /value/
(the data itself). Some examples include:

I know you don’t want to throw everything at the learner at once,
but I wonder whether this description of objects might make it
a lot harder later to explain/grasp the idea of an object as an
entity that encapsulates behaviors as well as data – or even
without data.

Given the above description, even at the simplest level:

Object.new

you’d have to do a lot of backtracking and re-explaining to
deal with questions like, “What is the data stored in this object?
What type of data is it? What is the value of the data?”
All of which would be completely reasonable questions, based on
the data-storage-unit model.

!Note: Notice that the methods available depend on the object
! type. Not all objects have the same methods.

I might put it the other way around – an object’s “type” can only
be inferred from its behavior. Again, I’m not trying to minimize
the difficulty of explaining this to non-programmers, just thinking
that there could be a certain amount of “But you said…” on the
part of the readers. (They might also want to know why the
#type method was deprecated somewhere in 1.7.x :slight_smile:

David Black

···

On Wed, 4 Dec 2002, Daniel Carrera wrote: