Jacob Fugal wrote:
> On 2/2/06, William James <w_a_x_man / yahoo.com> wrote:
> > Jacob Fugal wrote:
> > > On 2/2/06, William James <w_a_x_man / yahoo.com> wrote:
> > > > If you don't like golf, why watch it?
> > >
> > > Because the original poster was asking for advice on why it wasn't
> > > working, not for a golfing contest.
> >
> > The fact that his expectations were modest doesn't mean that
> > I shouldn't give him a bonus.  One never has to ask for a golfing
> > contest, since those who enjoy programming and who test their
> > code before they post are always willing to indulge in that pastime.
>
> Let me clarify.
>
>  * I don't mind you golfing on the list/newsgroup.
>  * I don't mind you golfing about this task.

What egregious arrogance!  Let me clarify.  What you mind
doesn't matter.

>
> What I do mind is threads that were not intended as golfing threads
> being hijacked into a golf contest.

I'm a wicked hijacker.  I know I am because Mr. Fugal told me so.

>                                 If I were the OP and posted a
> question, then later saw a new post in the thread stemming from that
> question, I'd expect useful input or discussion regarding my question.
> I am especially touchy about this when golfing replies are posted in
> response to a newbie question. While golf can be fun, we don't want
> the newbie to get the wrong idea that the techniques used in the golf
> are representative of how the code *should* be written.

If you didn't want to mislead the newbie, why did you say:
'String#chomp! is a "destructive" operation. This means that it acts in
place on its receiver and, in this case, returns nil.'

If you didn't want to mislead the newbie, why did you post this:

def chomper
    xx = gets.chomp
    until xx == "qq"
      puts "hit me with a squirell!"
      xx
    end
end

puts chomper

Even if there was a way for the loop to terminate, xx would not
be returned.  It has to be moved outside of the loop.
Extremely misleading.  Extremely confusing to a newbie.
(Of course, Mr. Fugal doesn't mind that, since whatever he does
is o.k. with him.)  And it was extremely arrogant to post untested
code.

Furthermore, it was extremely rude as well as incredibly arrogant
to assert falsely that my code wouldn't work correctly when
you had not condescended to test it.

Much better than the above code is:

def chomper
  puts "Hit me!"  while gets.chomp! != "qq"
  $_
end

It is superior in three ways.
1. It is correct.
2. It is clearer.
3. It is shorter.

Naturally, Mr. Fugal's arrogance compels him to dismiss
my version by using the term "golf", hoping that you will
assume that "golf" is a Bad Thing.

Newbies, don't be afraid of $_.  Matz didn't include it in Ruby
in order to tempt the unwary into becoming "evil golfers".
He included it because it is useful.  Of course, Mr. Fugal's
arrogance leads him to believe that his opinion outweighs
Matz's.


> PS. And regarding "those who enjoy programming and who test their code
> before they post are always willing to indulge in that pastime". I
> *usually* check the code I post, you were fortunate to catch me at a
> time when my mind was on other things and I was pressed for time.

Why would that make me fortunate?  Oh, I get it now!  Seeing a human
make an error is an everyday occurance, but witnessing a goof by a god
is special.