Ruby Black Belt

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

James Edward Gray II

ยทยทยท

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

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

Dmitry Buzdin wrote:

First of all want to thank all of You who posted comments here. Special
thanks to James Edward Gray II for pointing at the misstakes,
incompleteness and obscure language!

When I have posted at Ruby group I have expected far more "blunt"
relpies, believe me :wink:

Now allow me to try to 'defend' myself a bit :slight_smile:

What we are talking here about is a bit different, than traditional
certification. The main purpose is learning. You pass the exam and see
that You don't know some answers. After the exam it is possible to see
the explanation and to learn (multiple-line comments is realy a good
example :slight_smile: ) As I have mentioned before, everyone will be allowed to
add new questions and the best of them will be chosen by approval
process. No single no-expert person (like me) is going to create a set
of questions and call it a certification. I will be posting mine and
humbly waiting for other Ruby specialists to rate or comment it. And of
course public mailing list and practice ARE better ways to learn :slight_smile:

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

Dmitry

Hello all,

I am just learning Ruby, new to the mailing list/Ruby world so plz no bashing (especially because I am partially on Dmitry's side ;-).
Currently i am a professional Java/J2EE coder, for the last 5 years.
I have picked up Python about 2 years ago, and fell in love with it immediately. I have found much more productive, effective, quick and mainly fun way of developing SW.
However, some weeks ago gave Ruby a try (I did know about Ruby for years, but i said Python is essentially just the same with different syntactic sugar, so why waste time to learn the same thing twice) - but now, to say the least i am really happy that i did sacrifice some time to read the pickAxe. Just now i am thinking about switching to Ruby from Python.

Why i am writing this? Because i remember having exactly the same debate on the python-tutor list. Somebody asked for some kind of python certificate, and got crushed by several guys in matter of minutes. What was even worse there, they did not even explain him what they do not really like about such a certificate.

Believe me, I can absolutely understand your points. I do not like to work in Java at all, it is obscure, not suited for creative thinking, byrocratic, overcomplicated (With my pythoninc friend who dislikes java too, we designed once a tutorial for absolute beginners: You had to install HelloWorldFramework where you only had to implement IHelloWorld interface to get started to write your first 'Hello World' app :wink: .

Unfortunately at my current company we are doing something big and it is not possible for us to switch to python/ruby, and as i am interested in the solution we are developing, i have to stick with Java, despite my disgust. Of course i do not like it's certificate approach, which values lexical knowledge of idiotic obscure language details over natural talent/creativity (which is hard to measure anyway).

But still, I can understand Dmitry's point as well. I believe (hope) he is looking for a different facet of a 'certificate' (probably the word 'certificate' is flawed right away) than a test which certifies you are a good/bad ruby programmer. I can summarize this feature in one URL:

I also solved the python challege up to level 20 or something when it 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 harder. The catch was, that even the non-programmers rushed to learn to program - because there was no other way around to get to the next level and because you wanted to get to the next level badly (it was kinda addictive). When the next level came up, it was immediately clear that you are missing info on this or that technique/module/feature of the language.

I know that the ruby-quiz is around, and i think it is a great idea - i hope i will manage to find some time to play around with it. However, 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.

peter

Jeppe Jakobsen 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 Britt

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

Dmitry Buzdin 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 Britt

"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

Thanks for the lesson Guy. Insightful as always.

James Edward Gray II

ยทยทยท

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

> Robert Dober 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?

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%

ts wrote:

"J" == James Edward Gray <james@grayproductions.net> writes:

> Robert Dober 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?

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%

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

ยทยทยท

--
James Britt

"A principle or axiom is of no value without the rules for applying it."
   - Len Bullard

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

ยทยทยท

On 3/29/06, ts <decoux@moulon.inra.fr> wrote:

> Robert Dober 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?

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

--
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'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, Dmitry Buzdin <buzdin@gmail.com> wrote:

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

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,

ยทยทยท

--
Alex Combas
http://noodlejunkie.com/

... Right now, there are
only two languages where it's usually safe to assume that someone who
knows "language" is also a good developer (Ruby and Python) ...

Wow! That's a big claim! Can you support that at all? What do you mean by
it?

Cheers,
Dave

Thanks Steven!

I have checked and corrected everything.

As to the purpose of the exams - it will be definetly not for the
splitting Ruby people by certified and uncertified. Like I said it is
for educational purposes and for fun :slight_smile:

I do not think anybody implied you would, sorry if it came over like this.
But believe me, someone else would.
BTW I encourage you doing this, because if you feel it is a good thing to
do, do so.
Some people prefer not to participate in this, that is all. Personal choices
we have to take and to respect.
On the other hand I would love to talk you out of it :wink:

The Ruby has not so many documentation (especialy for libs) and

sometimes You just don't know that there is a more attractive and DRY
way to do things. Taking exams is a way to compare your knowledge to
the knowledge of other people who created and approved the questions
and a different way to learn. I can at least say that it works for me
when I have taken Java exams.

If it worked for you it will work for others, so if such an exam turns out
harmful eventually (I think it will, but I might be wrong), at least there
will be benefits.
It does not work for me though.

At the beginning Ruby exams will be mixed with all

the Java stuff.

That will make Java look a clumsy language!!! (one can object the term
"language" if one wants)
Maybe that will serve the Ruby community after all.

But if there will be interest shown, it will be posible

to divide all Ruby exams from Java and create a separate assesment
platform.

Dmitry

Just to be clear, I am still against it!

But if it is eventually done I will adjust my judgement.
Personally I would love it becomes much more "educational" than
"certification".

Cheers
Robert

ยทยทยท

On 3/31/06, Dmitry Buzdin <buzdin@gmail.com> wrote:

--
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

Srinivas Jonnalagadda schrieb:

Enumerable#select always returns an array. On a hash too, it returns
an array of arrays of key-value pairs.

Right.

The issue with this approach is that 'select' calls cannot be chained.
It is now mandatory to know whether the receiver is the original hash
or is the result of at least one 'select'.

It works for me:

   h = { 0 => 0, 1 => 2, 2 => 3, 4 => 4 }

   h.select { |k,v| k % 2 == 0 }.select { |k,v| v % 2 == 0 }

   # => [[0, 0], [4, 4]]

Can you show us your problem?

Regards,
Pit

Srinivas Jonnalagadda wrote:

Dear all,

Enumerable#select always returns an array. On a hash too, it returns
an array of arrays of key-value pairs.

The issue with this approach is that 'select' calls cannot be chained.
It is now mandatory to know whether the receiver is the original hash
or is the result of at least one 'select'.

Thus, for 'select'ing a second (or subsequent) time, the semantics of
the block themselves have to change.

Else, the result of the first selection has to be manually converted
to a hash (may be using something like hsh =
Hash[select_result.flatten]).

Is there some reason why when a filter is applied to a hash, we get an
object of a different type?

I've stumbled on the same issue yesterday and was a bit miffed, mostly because I couldn't have Hash#select! , while I can do Hash#reject!
A simple reversal of logic did the trick, but the question remains.
Cheers,
V.-

ยทยทยท

--
http://www.braveworld.net/riva

____________________________________________________________________
http://www.freemail.gr - รƒยครƒยนรƒยฑรƒยฅรƒยœรƒยญ รƒยตรƒยฐรƒยงรƒยฑรƒยฅรƒยณรƒยŸรƒยก รƒยงรƒยซรƒยฅรƒยชรƒยดรƒยฑรƒยฏรƒยญรƒยฉรƒยชรƒยฏรƒยฝ รƒยดรƒยกรƒยทรƒยตรƒยครƒยฑรƒยฏรƒยฌรƒยฅรƒยŸรƒยฏรƒยต.
http://www.freemail.gr - free email service for the Greek-speaking.

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

http://www.pythonchallenge.com/

I also solved the python challege up to level 20 or something when it 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 harder. The catch was, that even the non-programmers rushed to learn to program - because there was no other way around to get to the next level and because you wanted to get to the next level badly (it was kinda addictive). When the next level came up, it was immediately clear that you are missing info on this or that technique/module/feature of the language.

I know that the ruby-quiz is around, and i think it is a great idea - i hope i will manage to find some time to play around with it. However, 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.

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

ยทยทยท

From: "Peter Szinek" <peter@rt.sk>

Peter Szinek 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

ยทยทยท

--
Posted via http://www.ruby-forum.com/\.

James Edward Gray II <james@grayproductions.net> writes:

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:

ยทยทยท

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

James Edward Gray II

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

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

ยทยทยท

2006/3/29, James Edward Gray II <james@grayproductions.net>:

On Mar 29, 2006, at 12:31 AM, Jeppe Jakobsen 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:

James Edward Gray II

--
"winners never quit, quitters never win"

Alex Combas wrote:

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.

...

*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.

If you (or anyone else) are as passionate about this as your post suggests, then I encourage you to just go and do it. Make a site, however simple, just get it going, invite people to join in, and see where it goes.

People can go round and round arguing the merits of something, but a working site trumps speculation.

ยทยทยท

--
James Britt

"Programs must be written for people to read, and only incidentally
  for machines to execute."
   - H. Abelson and G. Sussman
   (in "The Structure and Interpretation of Computer Programs)

Alex Combas wrote:

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..

Well, this post was exactly about my issue in this thread, just Alex expressed much more better. I have been describing *exactly* the same thing. http://www.pythonchallenge.com/ has the great advantage that it goes gradually from 'how much is 2^38' till really advanced issues, and to go on you were forced to study the techniques needed in a funny and addictive way.

Btw, what would You (the whole list) think about porting www.pythonchallenge.com to Ruby? (E.g. we could name it... huh... let me think... maybe rubychallenge.com? :wink: By the 'porting' i mean several different possible levels:

1) (e.g. one-to-one: this you can do actually as-it-is, up to a certain level the stuff is solvable even in Java - however, the difference would be that the solutions (there is a wiki for solutions) and the discussion
would be in Ruby rathen than in Python. This is the quickest, but definitely not the best solution.

2) Using the same style, create a different site with different riddles;
This would be the ultimate solution, but it takes time of course. Time is the only negative factor here, all the other ones are positive ( Ruby style, thus geared towards ruby constructs like blocks, metaprogramming etc..., much improvements (i have also some ideas :wink: etc). The idea we need is:

-) it gets harder gradually, thus you have to learn techniques from n00b to pro
-) you have to solve level n to go to n+1
-) some really cool riddles
-) good solutions, discussions etc.
-) +improvements - we could introduce even more goodies!

There are some possible levels of porting inbetween 1) and 2). Of course the best would be the everything-from-scratch extreme if somebody would have time for this (e.g. i would be happy to participate myself, but to do this alone would be too time consuming for me due to other tasks. So if somebody would like to start with this, LMK). python challange also started of much mire simpler, just a few riddles, then they were added gradually as people were flooding the authors with 'give me more' :wink:

BTW. pythonchallallange.com was also inspired by notpron (www.deathball.net/notpron - titled ' - The Hardest Riddle Available on the Internet') so actually it would not be a 'franchise steal'.

If somebody is sceptic about this kind of stuff, he has to try pythonchallange to see how addictive it is - it really stirred up the python list, everybody was looking for answers in different techniques (wrt the task he solved ATM), i remember myself to even neglecting normal work to swish through XML-RPC, HTTP and cookies related python stuff just to get past a certain level :wink:

What do you think?

peter