[BLOG] A different perspective on Ruby.

J

James Britt

ES said:
This has perhaps been aired here already, if so, apologies.

Someone did not like Ruby; I find it refreshing to read
these takes as well since the actually bring up some
(fairly) valid points, this one moreso than usual.

http://www.ericw.org/rants/showrant.psp?rant=ruby

First, an OT question: Is there a Firefox extension that lets me
*quickly* disable/enable page colors? I know I can do this via the Web
dev tool bar stuff, but it's too many clicks, and sites with white text
on a dark background (hip as that may be) are so painful to look at I
get retina burn before I can finish all that clicking.

About the log entry. I have a rule of thumb. If someone is using the
words "shit" or "****" three or four times on page, they quickly lose
all credibility. (Certain words should be treated like global
variables: saved for special cases and for specific effect.)

I like reading critiques (or criticism, even) of Ruby, but most of what
was mentioned there were straw man arguments. Certainly POLS is a known
subjective aspect and an easy target. I expect everyone reading
ruby-talk could assemble a list of cases where Ruby violates their own
sense of POLS.


James Britt

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
 
M

Martin DeMello

James Britt said:
First, an OT question: Is there a Firefox extension that lets me
*quickly* disable/enable page colors? I know I can do this via the Web
dev tool bar stuff, but it's too many clicks, and sites with white text
on a dark background (hip as that may be) are so painful to look at I
get retina burn before I can finish all that clicking.

I use a bookmarklet in my bookmarks toolbar for this.

http://www.squarefree.com/bookmarklets/zap.html

martin
 
L

Luc Heinrich

Someone did not like Ruby; I find it refreshing to read
these takes as well since the actually bring up some
(fairly) valid points, this one moreso than usual.

Some valid points ? I think this guy does not know what he's talking
about, or simply did not read the documentation correctly, or is
simply blinded by something he should unlearn first, or simply likes
making straw man arguments for the sake of it, or simply likes to
rant (that I can understand, I like it too :) ).

And calling the language creator(s) "fucktard(s)" really doesn't help
making a point, really.
 
D

Dennis Roberts

He is 18 and just out of high school and thinks he knows everything.=20
I think everyone goes through that phase.
 
G

gabriele renzi

Martin DeMello ha scritto:
I use a bookmarklet in my bookmarks toolbar for this.

for *just a second* I've been thinking you used a toolbar to collect
places where ruby-talk shows that POLS relates to Matz' least surprise.
How lovely.
 
A

Andrew Walrond

This has perhaps been aired here already, if so, apologies.

Someone did not like Ruby; I find it refreshing to read
these takes as well since the actually bring up some
(fairly) valid points, this one moreso than usual.

http://www.ericw.org/rants/showrant.psp?rant=ruby

Despite the fucking swearing, he did come up with a list of almost everything
that has confused or annoyed me since I started using ruby.

What he neglected to mention is that Ruby is without doubt the closest attempt
yet at a perfect scripting language. Sure, it has some wrinkles, but I have
high hopes of those being sorted in the next iteration, whether by Matz or by
somebody else standing on his (and other giants) shoulders.

Despite the colourful language, an insightful critique and worth a quick
browse.

Andrew Walrond

PS The lack of documentation regarding method thrown exceptions is perhaps my
favourite criticism. Not at all core, but frustrating as hell when writing
OO /exception driven programs.
 
G

gabriele renzi

Luc Heinrich ha scritto:
Some valid points ? I think this guy does not know what he's talking
about, or simply did not read the documentation correctly, or is simply
blinded by something he should unlearn first, or simply likes making
straw man arguments for the sake of it, or simply likes to rant (that I
can understand, I like it too :) ).

I think this is a bad written rant, but I agree that I'd like implicit
namespace creation a-la python and that it's refreshing to see some ruby
critiques.
 
A

Austin Ziegler

This has perhaps been aired here already, if so, apologies.
=20
Someone did not like Ruby; I find it refreshing to read
these takes as well since the actually bring up some
(fairly) valid points, this one moreso than usual.
=20
http://www.ericw.org/rants/showrant.psp?rant=3Druby

I haven't seen it, and I see very little valid on that page.

-austin
--=20
Austin Ziegler * (e-mail address removed)
* Alternate: (e-mail address removed)
 
B

Brian Schröder

ES wrote:
=20
=20
"It's 5.abs for absolute value, but Math.sqrt(5) for square root."
=20
Good point. That bugs me too. abs is a *function*, not logically a
method.
=20

Why not 5.sqrt instead. Better to ask the object to do something, that
to do something with the object. That allows to use duck typing and
special casing to be done in the "special cased" object. I prefer
"string".length a lot over length(string)

regards,

Brian
Gavin
=20
=20


--=20
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/
 
M

Martin DeMello

"It's 5.abs for absolute value, but Math.sqrt(5) for square root."

Good point. That bugs me too. abs is a *function*, not logically a
method.

I'd say conceptually abs belongs with floor, ceil, round and truncate.

martin
 
C

Cameron McBride

=20
Why not 5.sqrt instead. Better to ask the object to do something, that
to do something with the object.=20

I would also agree. This did make me ponder when I initially found
it. If they have to be in a module, wouldn't it make sense to have it
be default includeable?

Cameron
 
J

Jim Freeze

"It's 5.abs for absolute value, but Math.sqrt(5) for square root."

Good point. That bugs me too. abs is a *function*, not logically a
method.

My take is that there are a few methods that apply to floats
and ints and bignums. These (like floor, ceil, abs) are commonly
known, accepted and used functions and it makes sense to make
them methods.

However, my f(x) is likely to be different than your f(x). In
fact, there are an infinite number f(x)'s in the world and
an infinite number of function names. If Ruby included them
into numeric, then I would feel like I was in Java swing. :)

Also, since 9/4 = 2, I'm not so sure that 5.sqrt wouldn't
be 2 or 0, depending upon how you slice it.
A few other good points, too. Shame about the presentation.

Nothing that hasn't been said before, but in a much more acceptable
way that promotes good discussion and real action.

Nothing new here people... move along, move along.
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: A different perspective on Ruby."

|"It's 5.abs for absolute value, but Math.sqrt(5) for square root."
|
|Good point. That bugs me too. abs is a *function*, not logically a
|method.

The definition of abs is not questionable; it returns self, negated
when self is negative, for all numeric value. On the other hand,
natural sqrt() may return float or integer, or something else. That's
the reason for sqrt() being a function in Math module. Note that the
name "Math" means math.h (collection of float value functions) in
Unix, not mathematics in general.

Besides that, he doesn't understand what POLS means. Since someone
will surprise for any arbitrary choice, it is impossible to satisfy
"least surprise" in his sense. The truth is two folds: a) when there
are two or more choices in the language design decision, I take the
one that makes _me_ surprise least. b) as a result, you will have
less surprise in Ruby than other languages, once you have accustomed
to it.

But I'm tired of explaining POLS again and again. I haven't even used
it first. I hope no one will use the term "POLS" any more to sell
Ruby. It's free after all.

matz.
 
J

Jay Levitt

Besides that, he doesn't understand what POLS means. Since someone
will surprise for any arbitrary choice, it is impossible to satisfy
"least surprise" in his sense. The truth is two folds: a) when there
are two or more choices in the language design decision, I take the
one that makes _me_ surprise least. b) as a result, you will have
less surprise in Ruby than other languages, once you have accustomed
to it.

Nicely put. I suggest we start referring to the POMLS - Principle of
Matz's Least Surprise. That way, if anyone ever debates it, you can pop
in and say "I wasn't surprised at all," thus authoritatively refuting
the argument!
 
E

ES

Le 26/5/2005 said:
First, an OT question: Is there a Firefox extension that lets me
*quickly* disable/enable page colors? I know I can do this via the Web
dev tool bar stuff, but it's too many clicks, and sites with white text
on a dark background (hip as that may be) are so painful to look at I
get retina burn before I can finish all that clicking.

About the log entry. I have a rule of thumb. If someone is using the
words "shit" or "****" three or four times on page, they quickly lose
all credibility. (Certain words should be treated like global
variables: saved for special cases and for specific effect.)

Ah, yes. I forgot to append a disclaimer about the language.
I like reading critiques (or criticism, even) of Ruby, but most of what
was mentioned there were straw man arguments. Certainly POLS is a known
subjective aspect and an easy target. I expect everyone reading
ruby-talk could assemble a list of cases where Ruby violates their own
sense of POLS.

Sometimes it is good to know what the other people think is surprising;
not because it violates some imaginary principle but because it might
actually be a good idea to re-evaluate a given aspect to make it more
obvious.
James Britt

E
 
J

Jim Freeze

* Jay Levitt said:
Nicely put. I suggest we start referring to the POMLS - Principle of
Matz's Least Surprise. That way, if anyone ever debates it, you can pop
in and say "I wasn't surprised at all," thus authoritatively refuting
the argument!

I think if you read Matz' post carefully, you will see that he
is not the originator of POLS. So, I don't think he wants any
POLS attached to himself, even POMLS. This would be a repeat of
what happed with POLS.

Besides, if we drop the POLS thing, then we can spare the poor
misguided, uninformed (slack jawed, lazy eyed) individuals who
write long articles trying to sound intelligent and authoritate
on a subject that they know nothing about from making fools of
themselves.
 
G

Glenn Parker

Brian said:
Why not 5.sqrt instead.

Hmmm, prefix, postfix, or infix? Functional or object-oriented?
These are bottomless questions.

One justification for sqrt(5) would be that "sqrt", works on more than
one class of objects (Fixnum, Bignum, Rational, etc). So does "abs" for
that matter, and I'm not crazy about 5.abs. As a method, sqrt would
have to be defined in every applicable class, either with new code or as
an included module. This spreads the definition out, which complicates
maintainence.

Another reason is that the prefix style, sqrt(5), is somewhat closer to
the typical mathematical notation. I can't think of any unary
mathematical operations that are naturally postfix, unless you count
C++'s post-decrement and post-increment.

This is all just criticism of library design, which is very much a
matter of style and taste. The "standard" library could stand some
attention to smooth out these style bumps, possibly by allowing either
prefix or postfix styles whenever possible. Then questions of style
would be forwarded to the programmer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top