Larry Wall's comments on Ruby

Denys Usynin observes:

>I think this whole Least Surprise Principle is a load of bullshit that 
>is invoked far too often for no good reason. It has a fancy name, but I 
>translate it to myself as "when matz made Ruby he made sure the way it 
>worked made sense to him". Excuse me, isn't it how all languages are(or 
>should be) made?

Probably, but they are not. I take the PLS to be a measure of
internal consistency. C++, for example, does not have this
level of consistency – it is riddled with special exceptions to
rules and many “dark corners” where it isn’t at all clear what
the expected behavior should be.

The published C++ FAQ book is about 4" thick, after all, so I
submit that that language is actually FULL of surprises :slight_smile:

/\ndy

Andrew Hunt wrote:

Denys Usynin observes:

I think this whole Least Surprise Principle is a load of bullshit that
is invoked far too often for no good reason. It has a fancy name, but I
translate it to myself as “when matz made Ruby he made sure the way it
worked made sense to him”. Excuse me, isn’t it how all languages are(or
should be) made?

Probably, but they are not. I take the PLS to be a measure of
internal consistency. C++, for example, does not have this
level of consistency – it is riddled with special exceptions to
rules and many “dark corners” where it isn’t at all clear what
the expected behavior should be.

The published C++ FAQ book is about 4" thick, after all, so I
submit that that language is actually FULL of surprises :slight_smile:

/\ndy

yeah and as I said, depending on your background , Ruby is just as full
of surprises as C++ is.

My guess is Ruby won’t surpise you too much only if you have Perl/Python
background. That’s it.

I am probably the only person in the world who never used perl/python
:slight_smile: When I first needed a scripting language I just learned Ruby
instead. I love the language but I can by no means say it was natural
and not surprising to me. Quite the opposite, I had to adapt
to the way Ruby’s logic works and get the feel for it.

The great Principle is an empty sound. Larry Wall should have never
mentioned it.

yeah and as I said, depending on your background , Ruby is just as full
of surprises as C++ is.

The question is, once you’ve mastered Ruby’s basic worldview do you still
keep being surprised. Some languages are never surprising once you’ve
mastered their basics. Others continually surprise with their baroque
twists and turns and special cases. POLS suggests that the designer is
consciously focusing on a design where new concepts fall naturally out of
old ones. C++, by contrast, optimizes for performance. Perl optimizes for
"expressiveness" and in succinctness.

I am probably the only person in the world who never used perl/python
:slight_smile: When I first needed a scripting language I just learned Ruby
instead. I love the language but I can by no means say it was natural
and not surprising to me. Quite the opposite, I had to adapt
to the way Ruby’s logic works and get the feel for it.

Of course. But do you have to KEEP adapting to quirky behaviours that
don’t fit properly into the logical model you’ve adapted to? In C++, most
of us do. “X implies Y except when Z which occurs if and only if Q.” Like:
“use the delete operator. Except for deleting arrays. There is a special
operator for that. And don’t use delete on objects that were malloc’d.”

For more examples:

http://new-brunswick.net/workshop/c++/faq/strange-inheritance.html

Paul Prescod

···

On Sat, 7 Sep 2002, Denys Usynin wrote:

The published C++ FAQ book is about 4" thick, after all, so I
submit that that language is actually FULL of surprises :slight_smile:

/\ndy

yeah and as I said, depending on your background , Ruby is just as full
of surprises as C++ is.

Wow, I couldn’t disagree more. Thinking about C++ templates alone makes
my skin crawl.

My guess is Ruby won’t surpise you too much only if you have Perl/Python
background. That’s it.

Coming from a perl background, I guess I can’t answer this :->

I am probably the only person in the world who never used perl/python
:slight_smile: When I first needed a scripting language I just learned Ruby
instead. I love the language but I can by no means say it was natural
and not surprising to me. Quite the opposite, I had to adapt
to the way Ruby’s logic works and get the feel for it.

The great Principle is an empty sound. Larry Wall should have never
mentioned it.

I think it’s a fantastic principle when taken in context: The principle
of least suprise as seen by Matz. I look at what his vision produced and
am stunned by it’s simplicity and power. As a sysadmin, the thing I
liked most about perl was the ability to get to the OS while being able
to easily use higher level abstractions bafflingly (still) absent from
C such as hashes, arrays, and powerful regexp capabilities.

Ruby has taken that concept that much further by providing an intuitive
OO framework that can achieve the same results, only in less code. The
fact that I can do this:

ruby -e 'p File.stat("foo").mtime.to_i' 

without having to write it in C, or remember where mtime comes in the
array returned by perl’s stat is awesome. And guess what? The whole language
works that way!

After years of wishing C had libraries with higher level abstractions,
and fumbling around with perl’s not-so-great OO implementation, ruby
is a breath of fresh air, and although I’ve been suprised a couple of
times, for the most part, when I’m not sure how Ruby works in one
area, and I make a guess, it turns out I’m right.

You may be right about the perl (python, C, C++, etc…) folks finding
ruby to hold true to POLS. It’s possibly because it’s what we’ve always
wanted but have never had, and we’re just damn happy about it :->

···

On Sat, 7 Sep 2002 05:20:22 +0900 “Denys Usynin” usynin@hep.upenn.edu wrote:


Jim Hranicky, Senior SysAdmin UF/CISE Department |
E314D CSE Building Phone (352) 392-1499 |
jfh@cise.ufl.edu http://www.cise.ufl.edu/~jfh |


“Given a choice between a complex, difficult-to-understand, disconcerting
explanation and a simplistic, comforting one, many prefer simplistic
comfort if it’s remotely plausible, especially if it involves blaming
someone else for their problems.”
– Bob Lewis, Infoworld

My $0.02…

%% On Sat, 7 Sep 2002 05:20:22 +0900

···

%% “Denys Usynin” usynin@hep.upenn.edu wrote:
%%
%% > > The published C++ FAQ book is about 4" thick, after all, so I
%% > > submit that that language is actually FULL of surprises :slight_smile:
%% > >
%% > > /\ndy
%% > >
%% >
%% > yeah and as I said, depending on your background , Ruby is
%% just as full
%% > of surprises as C++ is.
%%
%% Wow, I couldn’t disagree more. Thinking about C++ templates alone makes
%% my skin crawl.

Well, I happen to like C++ and especially C++ templates for precisely the
same reason I love Ruby: they make metaprogramming easy, in an otherwise
hopelessly static language, no less. Templates in C++ are very powerful, and
C++ syntax really isn’t scary once you understand pointers and know how to
use them and manage your own memory without blowing your foot off. Template
syntax looks dangerous and even cabalistic until you know how to use
templates for good design (Alexandrescu’s “Modern C++ Design” is a work of
sheer genius, for instance). Once you do get into them, you can’t program
in C++ without them.

Ruby’s dynamic OO model provides another, simpler way to define high level
abstractions in the aid of better program design, and is infinitely easier
to refactor - which is a huge plus over compiled C++. I also like Ruby
because, when I decide I need to, I can always extend Ruby in C++. So I get
the best of both worlds, and can jaunt back and forth between them as the
muse singeth.

%%
%% > My guess is Ruby won’t surpise you too much only if you have
%% Perl/Python
%% > background. That’s it.
%%
%% Coming from a perl background, I guess I can’t answer this :->

Hmmm. You come from a Perl background and C++ template syntax makes your
skin crawl… my $OK, $I_believe_you = shift( @_ ); ### :wink:

WRT Larry Wall’s comments, they make perfect sense when you understand that
he’s got his own language to promote, and a new version soon, at that. My
only comment is that Perl’s retrofit of OO syntax is probably as ugly as
anybody could have possibly imagined, and I think he did it that way because
he really wanted it to look funky so that the people who “got it” and could
use Perl OO productively would look superhuman smart, like him. Ruby’s OO
syntax, by contrast, is the definition of elegance and readability in a
development environment (scripting) that really benefits from both (not that
they aren’t beneficial in all programming environments, just that
scripting is pointless if at the very least the syntax isn’t much cleaner
and noise-free than is possible in statically typed, compiled languages,
like C++ - which continue to have their place in the world). Strictly
speaking, Ruby’s OOP is much closer to true OOP (elusive concept that it
is!) than anything Perl has offered so far. And his whole notion that
objects are too hard for beginners to grasp is the exact opposite of
reality - its concepts like “scalars” and “fundamental data types” that
throw off inexperienced programmers. Humans think in terms of objects or
"things", and in particular we visualize reality in terms of objects, not in
terms of the size of bytes of data that a computer can use.

As sort of an aside, I do think that exposure solely to object oriented
programming is a Bad Thing for the serious programmer, however: At some
point he or she must look squarely at the ghost in the machine, turn on the
light, and scare it away. There are other paradigms and they too can be
good. But the casual programmer, like the casual citizen, can live a
perfectly happy, productive life without direct knowledge of how the world
really works, under the surface of things… That’s actually the whole point
of civilized society - to make primitive survivalism technically
unnecessary - and the point of high-level languages as well: one should be
able to get a lot of work-for-pay done in a high level language like Ruby
without necessarily having to know all the gory details of the
implementation of dynamic typing, garbage collection, etc. Knowing these
things of course is good: but not necessary for life.

Sincerely,

Bob Calco