Ruby Black Belt

On Mar 28, 2006, at 3:52 PM, James Edward G. II wrote:

Understand that basic commands like puts and exit are actualy
Kernel class methods.

They are actually Kernel instance methods.

Robert D. was kind enough to point out that RDoc may have led me
astray here. You can call Kernel methods like class methods and they
do not show up in the list of instance_methods(). They are mixed
into Object though, right? Can someone clue me in here?

James Edward G. II

P.S. See how hard it is to get a test right? :wink: We now know I’m
not smart enough to write one…

“J” == James Edward G. [email protected] writes:

J> Robert D. was kind enough to point out that RDoc may have led me
J> astray here. You can call Kernel methods like class methods and they
J> do not show up in the list of instance_methods(). They are mixed
J> into Object though, right? Can someone clue me in here?

a global function is a Kernel module function : this mean that it’s a
private method (this is why #instance_methods don’t display it) and a
public singleton method

moulon% ruby -e ‘module M def f() end; module_function :f end; p
M.instance_methods’
[]
moulon%

moulon% ruby -e ‘module M def f() end; module_function :f end; p
M.private_instance_methods’
[“f”]
moulon%

moulon% ruby -e ‘module M def f() end; module_function :f end; p
M.singleton_methods’
[“f”]
moulon%

Guy Decoux

Jeppe J. wrote:

Yeah I could do that, but this is my first language and I can still only
answer basic questions.

Ah, but that gives you a certain advantage. You can explain to other
newcomers those things that at first seemed odd or confusing.

People who’ve been using a language for a while tend to forget those
things.


James B.

http://web2.0validator.com - We’re the Dot in Web 2.0
http://refreshingcities.org - Design, technology, usability
http://yourelevatorpitch.com - Finding Business Focus
http://www.jamesbritt.com - Playing with Better Toys

On Mar 29, 2006, at 8:50 AM, ts wrote:

and a
moulon%

moulon% ruby -e ‘module M def f() end; module_function :f end; p
M.singleton_methods’
[“f”]
moulon%

Thanks for the lesson Guy. Insightful as always.

James Edward G. II

Dmitry B. wrote:

And tell me one more thing - why some of You afraid of Ruby becoming
popular?

Wow, good troll.

:slight_smile:

Pretty sure no one here ever expressed concern over Ruby’s popularity.


James B.

“In physics the truth is rarely perfectly clear, and that is certainly
universally the case in human affairs. Hence, what is not surrounded
by
uncertainty cannot be the truth.”

  • R. Feynman

On 3/29/06, ts [email protected] wrote:

public singleton method

moulon% ruby -e ‘module M def f() end; module_function :f end; p
M.singleton_methods’
[“f”]
moulon%

Guy Decoux

I knew I was wrong all the time, ty for showing me

here we go :wink:
irb(main):015:0> Kernel.private_instance_methods
=> [“gets”, “catch”, “String”, “`”, “sleep”, “getc”, “warn”, “gsub!”,
“iterator?”, “sprintf”, “remove_instance_variable”, “Integer”, “split”,
“putc”, “abort”, “chop”, “lambda”, “initialize_copy”, “srand”, “p”,
“local_variables”, “singleton_method_removed”, “printf”, “caller”,
“require”, “sub”, “eval”, “set_trace_func”, “callcc”, “binding”,
“readline”,
“throw”, “Array”, “chop!”, “syscall”, “raise”, “autoload?”, “format”,
“trace_var”, “exit!”, “block_given?”, “trap”, “Float”, “at_exit”,
“puts”,
“loop”, “sub!”, “chomp”, “system”, “singleton_method_undefined”,
“method_missing”, “scan”, “select”, “rand”, “exit”, “print”, “fork”,
“gsub”,
“exec”, “autoload”, “singleton_method_added”, “global_variables”,
“readlines”, “proc”, “fail”, “chomp!”, “open”, “untrace_var”, “test”,
“load”]

irb(main):016:0> Kernel.private_instance_methods.include?(“puts”)
=> true

Cheers
Robert


Deux choses sont infinies : l’univers et la bêtise humaine ; en ce qui
concerne l’univers, je n’en ai pas acquis la certitude absolue.

  • Albert Einstein

ts wrote:

public singleton method
[“f”]
moulon%

http://www.ruby-doc.org/core/classes/Module.html#M000725


James B.

“A principle or axiom is of no value without the rules for applying it.”

  • Len Bullard

I am learning Ruby as my first language, and have spent about one week
on it so far. So far, I like the language a lot.

Right now, I’m working my way through Pick-axe, and some other books to
learn about the syntax and features of the language. In my case, having
some kind of quiz/test would be helpful, as it would force me to test
my knowledge, and would make me aware of holes in my Ruby knowledge
which I would need to address. I like the idea of working up to
different levels mentioned in Peter’s posting about Python, and can see
how it would be helpful to a lot of new fans of Ruby.

I can understand how some people are worried about the word
certification, fearing that it would create some kind of hierarchy of
insiders, with everyone else being outsiders. Maybe this is because of
the nature of the word “certification”.

However, if we can have exams/quizzes or whatever else you want to call
them to help newbies like me to learn Ruby, that would be a really
welcome move.

Paul

From: “Peter S.” [email protected]

addictive). When the next level came up, it was immediately clear that
well - and not the Java style experience-with-obscurity-is-knowledge
style crap.

Interesting. I was looking for an interactive Python
interpreter on the web page. I did the first couple using
IRB. I did like the humor… (“Have you ever heard of jvon
files??”)

For Ruby, have you seen http://tryruby.hobix.com/ ?

I think tryruby is awesome. I’ve given the link to people who
were interested in ruby but not only had never tried it, they
had very little programming experience. The feedback has been
positive (apart from the session timing out when they took a
short break. :slight_smile:

Anyway, so the python challenge got me wondering what an
advanced-skill version of tryruby would be like . . . .

Regards,

Bill

Hi –

On Thu, 30 Mar 2006, [email protected] wrote:

I can understand how some people are worried about the word
certification, fearing that it would create some kind of hierarchy of
insiders, with everyone else being outsiders. Maybe this is because of
the nature of the word “certification”.

I share that fear. I’d hate to see people brand themselves as
outsiders by getting Ruby “certification” :slight_smile:

David


David A. Black ([email protected])
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

“Ruby for Rails” chapters now available
from Manning Early Access Program! Ruby for Rails

On 3/29/06, Dmitry B. [email protected] wrote:

And tell me one more thing - why some of You afraid of Ruby becoming
popular?

I’m not afraid of it becoming popular in general. Am I afraid of it
becoming popular like Walmart? You bet ya. I don’t want ruby to be
low prices always… at the expense of it’s community. To the extent
that it gets popular, I should hope that it does so on it’s own merit,
which it is already doing.

Ruby can be appreciated and competent rubyists can be found without
some sort of organization telling me what a good Rubyist is or what I
should know to be considered competent.

On 3/29/06, Pistos C. [email protected] wrote:

Certainly, if there were a site that advertised itself with “Want to get
better at Ruby and have fun doing it? Visit http://…” I would click
in an instant. :slight_smile:

rubyquiz.com

Peter S. wrote:

got too time consuming. To sum it up: to get to the next level you
needed to apply some python technique/module (like regexps, loading a
web page, IO, gfx, GUI, etc) and it was gradually getting harder and

what was different in the case of the python challenge: it was
hierarchical, and in a very natural yet funny way it somehow certified
your skills in python/programming (i.e. if you got yourself to level X,
you had some experience with regexps, IO, web, UI, …). I think this is
the kind of certificate which would be interesting to see in Ruby as
well - and not the Java style experience-with-obscurity-is-knowledge
style crap.

I tentatively agree with the others about official certification, but
this idea of some sort of online interface that covers all (or many) of
the features, tools, libs, etc. of Ruby in an interactive, educational
fashion sounds appealing.

Certainly, if there were a site that advertised itself with “Want to get
better at Ruby and have fun doing it? Visit http://…” I would click
in an instant. :slight_smile:

Perhaps all Dmitry needs is a name change (of the idea, not him). I
think the rough concept is worth brainstorming around and sculpting.

Pistos

Gregory B. wrote:

Certainly, if there were a site that advertised itself with “Want to get
better at Ruby and have fun doing it? Visit http://…” I would click
in an instant. :slight_smile:

rubyquiz.com

Yes yes… but I meant BESIDES that. :wink:

Pistos

James Edward G. II [email protected] writes:

On Mar 29, 2006, at 12:31 AM, Jeppe J. wrote:

Yeah I could do that, but this is my first language and I can still
only
answer basic questions.

We all started there my friend. How do you think we got better? :wink:

From endless hours on #ruby-lang, of course. :wink:

Benjohn B. [email protected] writes:

:slight_smile: But I’ve got to say, I’m not sure why I have an irrational dislike
of the idea of Ruby certification. Maybe a simple one would be having
a gem up on rubyforge :slight_smile: And your “score” could be the number of
downloads it gets :slight_smile: So I’m a zero and a zero so far…

good != popular

good != publishes code

That said, definitely look at Ruby code of the people you want to hire.

I think the community could come up with something better and more
interesting
than an online test but I do not think that “something” should be
rubyquiz.com, sorry James.

rubyquiz.com is a really great source for gaining practical knowledge
if you already know
enough about programming and ruby in order to participate.

The problem with rubyquiz is that there is no continuity, it starts off
at
a very high level, newbies have to search around looking for a simple
starting
exercise, probably picking the wrong one, getting frustrated, giving
up, and then I look
for a new exercise to try… and I get frustrated again …err… I mean
“newbies” get
frustrated again… ahem… anyway…

rubyquiz also isnt very “fun” in itself …oh sure, if you find the act
of programming itself
to be “fun” then ruby quiz is lots of fun, but then so is every other
act of programming.

rubyquiz is only cool for two reasons: firstly because the problems
are well thought out, secondly because rubyists solutions are often
enlightening.

For that matter I think the name rubyquiz is misleading, it should be
rubyproblemsolving.com
and its meta tag should include “advanced”.

The difference being that a quiz usually has a defined solution which
must follow a defined path
and the challenge is to find that path in order to reach that
solution. But of course rubyquiz.com is
very loose about how one can solve the problems and in my opinion this
is a bad way to learn
because often newbies, if they manage to solve the problem at all,
will have done so by poor means
and will have probably learned bad habits along the way as a result.
The given solutions
to the problems at rubyquiz are often themselves high level, just like
the problems themselves,
and so are equally difficult for newbies to learn from.

I’m not saying that you will not learn by hacking away at those great
exercises, what I’m saying is that if you are a newb you will most
likely teach yourself many bad habits along the way by trying to cut
your teeth on such complicated exercises IF you have not first gained
a solid foundation in programming.

What we need (and I want) is something to fill the gap between a
persons introductory book(s) on ruby (pickaxe, poignant,pine) and the
exercises at rubyquiz.com.

The books are necessary, you cant even begin until you have read one
or two of them, but to go from that to rubyquiz is quite a leap and
many I think are falling through the crack.

We need some sort of linear rubygame that will enforce good habits and
basic compsci techniques so newbs can gain that solid ground in simple
problem solving and have the tools to then go and tackle serious
problems like those found at rubyquiz.

Fewf sorry for all the oral spew…
James dont take this as criticism for rubyquiz, I love what you’re
doing for the community over there.
I just dont think that its the “next step” to learning ruby that many
claim it to be.

Best regards,

Practice, reading and more practice, I guess? :slight_smile:

2006/3/29, James Edward G. II [email protected]:

I really join those who think certification is a bad idea!
And even if it were a good idea, which I doubt, do you think a
certification
could really mean you know what you are doing?
Nahh, look at all that certificates one can get (buy?). Cisco, RedHat,
Java,
Micros**t, you name it, it is all about Business and
few about Knowledge.

Please be aware that I do not at least doubt the best intentions of the
poster, but I am afraid there would be no good end to this :frowning:

I strongly feel that it has nothing to do within the spirit of Open
Source.

And if you follow the Ruby-Quiz I hardly can imagine that one could
learn
more anywhere else.

It is also a marvellous opportunity for bright people to make themselves
known, that is why I never participate!

Cheers
Robert


Deux choses sont infinies : l’univers et la bêtise humaine ; en ce qui
concerne l’univers, je n’en ai pas acquis la certitude absolue.

  • Albert Einstein

I just played with the Try Ruby site for 15 minutes, and like it very
much. For new programmers, it’s an excellent combination with the
Pick-axe book. I’m sure that a version for more advanced programmers
would be very welcome, and would help in the propagation of Ruby.

A RubyOnRails version of the online tutorial would be really neat!

Can you imagine building your own web app with an online tutorial…

Paul