I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…
I encountered a symbol I don’t understand, may be simply I didn’t read
the manual careful enough – sorry.
@@var={ } ??
I knew that [ ] is for array, but what is { }?
There are a lot such cryptic things, some I know some I don’t, such as
%w, << === < ! ~ $_ …
I do hope there are a quick reference of these horrible things. :-p
I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…
I’m expecting anyone would be in favor of various improvements
to our online documentation. Perhaps if you begin such a
document…?
I encountered a symbol I don’t understand, may be simply I didn’t read
the manual careful enough – sorry.
@@var={ } ??
I knew that is for array, but what is { }?
The print version of Programming Ruby has a truly impressive and
useful index. In it, you’ll find:
{…}
hash literal 11, 206
in pattern 61, 209
see also Block
I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…
I thought there was something like that around (a concordance to the
online pickaxe) but I can’t seem to pinpoint it (assuming it actually
exists in the first place). Anyway, you might also be interested in
the rubydoc book project: http://www.rubydoc.org/book. It’s an
ongoing, online, collaborative Ruby book.
If you do start a new documentation project, I’d encourage you not to
use a name that makes it sound like Ruby is somehow mystifying or
cryptic in the first place. Ruby is actually unusually clear and
transparent in its syntax. Of course there are things whose meaning
isn’t clear until you learn them specifically – but that’s true in
any programming language, and it would be misleading to give the
impression that learning Ruby equates to demystifying it.
This might actually be a lot easier to do from a newcomer’s
perspective. Why don’t you start a wiki page at rubygarden.org, with the
things that mystify you? The list can fill in the answers, and it’d be a
valuable resource for other newcomers.
I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…
I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…
This might actually be a lot easier to do from a newcomer’s
perspective. Why don’t you start a wiki page at rubygarden.org, with the
things that mystify you? The list can fill in the answers, and it’d be a
valuable resource for other newcomers.
martin
That would be good fodder for the FAQ as well. A question “What on earth do
the following symbols mean…?” would be a good catch-all.
My feeling toward C++, and ruby, and any other language is that when you
learn it more, it becomes more cryptic. Ruby is in deed very impressive,
powerful, and easy to read. If I write my own program in ruby, I may not
use anything like symbol in years, but when I try to read other’s
program, I will see it, and then I will try painfully to find out what
does that mean, and miserablly failed.
In fact, after some suggestion here, I read chap 18 “the ruby
programming language” again, and found explanation of most cryptic
historic symbols borrowed from perl. But it is still hard to lookup in
an emergency. In the document it follows a printed format referring to
page 202, for example. But HTML help file don’t have page at all.
Hence, what I suggested is a proper index of every sytactic elements in
the help file. Bill suggested that the printed version already have that.
Why not the online version?
I suggest if some one can initiate a documentation project for ruby? I
would call it The Ruby Cipher Book, or Ruby Demystified. In this
document, all ruby symobs, prefixes suffixes are explained, with
reference to the chapter in the online manual…
I thought there was something like that around (a concordance to the
online pickaxe) but I can’t seem to pinpoint it (assuming it actually
exists in the first place). Anyway, you might also be interested in
the rubydoc book project: http://www.rubydoc.org/book. It’s an
ongoing, online, collaborative Ruby book.
If you do start a new documentation project, I’d encourage you not to
use a name that makes it sound like Ruby is somehow mystifying or
cryptic in the first place. Ruby is actually unusually clear and
transparent in its syntax. Of course there are things whose meaning
isn’t clear until you learn them specifically – but that’s true in
any programming language, and it would be misleading to give the
impression that learning Ruby equates to demystifying it.
This might actually be a lot easier to do from a newcomer’s
perspective. Why don’t you start a wiki page at rubygarden.org, with the
things that mystify you? The list can fill in the answers, and it’d be a
valuable resource for other newcomers.
I would like to post a serie of questions, and we can make it complete
collaboratively. But I am sorry that I don’t know what is wiki at all. I
read the rubygarden,org page, I found that if I post question there, it
will be similar to rubytalk archive, which is not very easy to index,
and search. Any suggestion?
[On funny symbols]
That would be good fodder for the FAQ as well. A question “What on earth do
the following symbols mean…?” would be a good catch-all.
Gavin
That said, sooner or later, if somebody wants to become any good at Ruby, they
have to read some book, and then they will understand all the symbols anyway.
So why not make it sooner?
That said, I still find “class << self” very mystifying.
My feeling toward C++, and ruby, and any other language is that when you
learn it more, it becomes more cryptic. Ruby is in deed very impressive,
powerful, and easy to read. If I write my own program in ruby, I may not
use anything like symbol in years, but when I try to read other’s
program, I will see it, and then I will try painfully to find out what
does that mean, and miserablly failed.
I think that as you become more familiar with the learning resources
available, you’ll start finding answers more quickly. No one has
tried to mystify or conceal any of this
In fact, after some suggestion here, I read chap 18 “the ruby
programming language” again, and found explanation of most cryptic
historic symbols borrowed from perl. But it is still hard to lookup in
an emergency. In the document it follows a printed format referring to
page 202, for example. But HTML help file don’t have page at all.
That’s because it’s an online version of a printed book, and the page
numbers aren’t included. Not that they couldn’t be… but hey, this
was a pioneering effort in the area of putting an in-print trade book
on the Web for free, so there are a few things to work out
Hence, what I suggested is a proper index of every sytactic elements in
the help file. Bill suggested that the printed version already have that.
Why not the online version?
That’s fine – I was only suggesting not unnecessarily labeling Ruby
as “cryptic” or “mystifying”.
My feeling toward C++, and ruby, and any other language is that when you
learn it more, it becomes more cryptic. Ruby is in deed very impressive,
powerful, and easy to read. If I write my own program in ruby, I may not
use anything like symbol in years, but when I try to read other’s
program, I will see it, and then I will try painfully to find out what
does that mean, and miserablly failed.
You won’t program Ruby for long without using
class Example
attr_reader :foo, bar
…
end
module Blah
…
module_method :quux
end
So symbols are just part of Ruby growing pains. I never had any problem with
them. I happily understood them in attr_reader without knowing exactly what
they were. When the time came for me to delve into them, I had online PickAxe
and dead-tree “Ruby in a Nutshell”. Everyone who’s serious about programming
Ruby should have at least one book. Online documentation can’t do everything.
This might actually be a lot easier to do from a newcomer’s
perspective. Why don’t you start a wiki page at rubygarden.org, with the
things that mystify you? The list can fill in the answers, and it’d be a
valuable resource for other newcomers.
I would like to post a serie of questions, and we can make it complete
collaboratively. But I am sorry that I don’t know what is wiki at all. I
read the rubygarden,org page, I found that if I post question there, it
will be similar to rubytalk archive, which is not very easy to index,
and search. Any suggestion?
That would be good fodder for the FAQ as well. A question “What on earth
do
the following symbols mean…?” would be a good catch-all.
I don’t like this kind of index :). A question can only address one
symbol, what I prefer, from a new user perspective is something like
following:
I respectfully disagree. We can’t have a separate question for each symbol -
it would result in blowout.
I’ve posted a proposed FAQ entry for feedback, containing your suggestions
(except class names, which are far from cryptic) and several more. See what
you think.
So symbols are just part of Ruby growing pains. I never had any problem with
In deed, we follow nearly the same route, before I knew there’s a class
called symbol, there are no growing pains at all!
I thought attr_reader is a special notation, I never realised that it is
a method. and :name after attr_reader is just a special syntax, and
:name is indeed same as name, but the “:” is required by the attr_reader
notation.
After I learned that attr_reader is a method, and :name is a symbol, and
:name is not linked to name, my classical word collapsed, and I entered
a new world of modern ruby… Just like transition to the world of
Newton to Einstein…
The following analogy might help: think of a string as a frame in which
several blocks of movable type are set, and a symbol as a single block
of metal, engraved with a complete word, and given a serial number which
is stored in a large list of serial numbers indexed by name, so you can
find it quickly.
After I learned that attr_reader is a method, and :name is a symbol, and
:name is not linked to name, my classical word collapsed, and I entered
a new world of modern ruby… Just like transition to the world of
Newton to Einstein…
----- Original Message -----
From: “Shannon Fang” xrfang@hotmail.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Sunday, December 01, 2002 8:23 AM
Subject: Re: Cipher book for ruby
I thought attr_reader is a special notation, I never realised that it is
a method. and :name after attr_reader is just a special syntax, and
:name is indeed same as name, but the “:” is required by the attr_reader
notation.
After I learned that attr_reader is a method, and :name is a symbol, and
:name is not linked to name, my classical word collapsed, and I entered
a new world of modern ruby… Just like transition to the world of
Newton to Einstein…