Defending Ruby's OOP

Hi,

I’ve got someone here saying that Ruby (and other languages) can’t be
100% object-oriented because if and unless and so on (keywords) are no
objects.

How can I defend the claim that Ruby is 100% OOP?

I’ve got someone here saying that Ruby (and other languages) can’t be
100% object-oriented because if and unless and so on (keywords) are no
objects.

How can I defend the claim that Ruby is 100% OOP?

Righteously! Ye must purge yon heretics with whips and scorpions!

(Alternatively, why bother?)


Giles B.

I’m running a time management experiment: I’m only checking e-mail
twice per day, at 11am and 5pm. If you need to get in touch quicker
than that, call me on my cell.

Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org

Tell him to find a more substantial argument. That’s the lamest
complaint I
think I’ve ever heard about Ruby or dynamic languages in general.

Or better yet, tell him to design a language that has “if” “unless” etc
as
objects and see where that goes. What does having if/unless as objects
even
mean?

Jason

In message [email protected], Lucas
Holland writes:

I’ve got someone here saying that Ruby (and other languages) can’t be
100% object-oriented because if and unless and so on (keywords) are no
objects.

How can I defend the claim that Ruby is 100% OOP?

Argue with smarter people.

-s

In message
[email protected], “Jason
Roelofs” write
s:

Or better yet, tell him to design a language that has “if” “unless” etc as
objects and see where that goes. What does having if/unless as objects even
mean?

Doesn’t Tcl essentially do that?

If he really wants a language in which everything is an object, give him
a lollipop. (With apologies to Alan Perlis.)

-s

I’ve got someone here saying that Ruby (and other languages) can’t be
100% object-oriented because if and unless and so on (keywords) are no
objects.

How can I defend the claim that Ruby is 100% OOP?

You don’t need to defend yourself. Tell your friend he hasn’t understood
OOP
yet.
OO does not mean you need to programming everything with method calls
but
containing certain aspects in objects. It’s about software design and
not
control logic.

Kind regards
Nicolai

On May 10, 2007, at 3:26 PM, Lucas H. wrote:

How can I defend the claim that Ruby is 100% OOP?

Just redefine the meaning of 100%, that should work.
If not, redefine the meaning of OOP.

Really, it seems like a silly argument. Better to
simply understand what Ruby is or isn’t and the same
for other languages. I doubt that there is some
mathematically-true total ordering on programming
languages relative to OOPness (or any other criteria
for that matter).

Gary W.

Tell him to find a more substantial argument. That’s the lamest complaint I
think I’ve ever heard about Ruby or dynamic languages in general.

Or better yet, tell him to design a language that has “if” “unless” etc as
objects and see where that goes. What does having if/unless as objects even
mean?

It’s like saying the car is inferior to the horse because you can’t
feed the car oats.

Smalltalk is the purest OOP language there is and it doesn’t have
if or unless at all. You know how you can bypass control structures in
Ruby by using blocks and closures instead? In Smalltalk, that’s the
only way to do control structures at all. “If” and “unless” don’t even
exist in Smalltalk. “If” and “unless” are not fundamental in the first
place. They’re a conscious design feature. It sounds like the person
you’re arguing with is a Smalltalk stalwart and/or an argumentative
type making a silly, meaningless point which is only useful for the
sake of arguing.

Seriously, what kind of object would an If object be? What is the
essence of If-ness? I think if anybody could answer that question they
would instantly achieve enlightment and then their head would explode.


Giles B.

I’m running a time management experiment: I’m only checking e-mail
twice per day, at 11am and 5pm. If you need to get in touch quicker
than that, call me on my cell.

Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org

On May 10, 2007, at 3:39 PM, Jason R. wrote:

Or better yet, tell him to design a language that has “if” “unless”
etc as
objects and see where that goes. What does having if/unless as
objects even
mean?

In Smalltalk, if-then-else is a message and messages are objects…

If Ruby is 100% OOP, then what is Smalltalk?

Gary W.

Well, as others have said, it’s a stupid thing to argue about.

I think getting into that kind of argument at all is a bad idea.

You’re only defending a language’s design decisions when engaged in
ideological arguments. That kind of argument is bad for the community,
because it encourages picking sides, and bad for the language itself,
insofar as it influences design decisions. Design decisions are not
about taking a side ideologically. They’re about building something
useful.

Don’t even bother defending Ruby in any context, except against the
charge that it is not useful for some purpose, and then only if it
really is useful for that purpose.


Giles B.

I’m running a time management experiment: I’m only checking e-mail
twice per day, at 11am and 5pm. If you need to get in touch quicker
than that, call me on my cell.

Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org

From: Lucas H. [email protected]

I’ve got someone here saying that Ruby (and other languages) can’t be
100% object-oriented because if and unless and so on (keywords) are no
objects.

How can I defend the claim that Ruby is 100% OOP?

Well, as others have said, it’s a stupid thing to argue about.

But to answer your actual question, your friend is correct. for, case,
do, else, if, etc. are reserved words, not objects. Check your pickaxe
book, page 329.

-Dan Debertin
[email protected]

On 5/10/07, Giles B. [email protected] wrote:

Tell him to find a more substantial argument. That’s the lamest complaint I
think I’ve ever heard about Ruby or dynamic languages in general.

Or better yet, tell him to design a language that has “if” “unless” etc as
objects and see where that goes. What does having if/unless as objects even
mean?

It’s like saying the car is inferior to the horse because you can’t
feed the car oats.

I’m patiently waiting for the Oatsmobile.

On 5/10/07, Gregory B. [email protected] wrote:

I’m patiently waiting for the Oatsmobile.

And once you get one, you can declare yourself to be Oatman! I’m not
sure what superpowers that brings, besides being ‘regular’.

Gregory B. wrote:

It’s like saying the car is inferior to the horse because you can’t
feed the car oats.

I’m patiently waiting for the Oatsmobile.

I certanly dig my Toyoata.

the_if = if.new
the_then = then.new
then_end = end.new
the_else = else.new

the_if(1==2) the_then

the_else()
the_end

Yeah… I can’t make sense of it either.

On 5/10/07, Bill G. [email protected] wrote:

I’m patiently waiting for the Oatsmobile.

And once you get one, you can declare yourself to be Oatman! I’m not
sure what superpowers that brings, besides being ‘regular’.

well, a car fueled by oats would probably be carbon neutral… Oatman
would indeed be as least as eco-friendly as captain planet!

Giles B. wrote:

Seriously, what kind of object would an If object be? What is the
essence of If-ness? I think if anybody could answer that question they
would instantly achieve enlightment and then their head would explode.

That, my friends, is exactly how LISP programmers are created.

Gary W. wrote, On 5/10/2007 2:47 PM:

for other languages. I doubt that there is some
mathematically-true total ordering on programming
languages relative to OOPness (or any other criteria
for that matter).

And more importantly, what value would that bring?

On 5/10/07, Gregory B. [email protected] wrote:

On 5/10/07, Bill G. [email protected] wrote:

I’m patiently waiting for the Oatsmobile.

And once you get one, you can declare yourself to be Oatman! I’m not
sure what superpowers that brings, besides being ‘regular’.

well, a car fueled by oats would probably be carbon neutral… Oatman
would indeed be as least as eco-friendly as captain planet!

True! You could retire by selling off your carbon credits. Having
thought about it a bit, being regular is one of those rare super
powers that actually improves with age :wink:

From: Jason R. [mailto:[email protected]] :

Or better yet, tell him to design a language that has “if”

“unless” etc as objects and see where that goes. What does having

if/unless as objects even mean?

Maybe they mean a boolean class. I myself would like a boolean class in
ruby. Sometimes, i feel if-else constructs too restrictive,… maybe i
hate grammar rules… (maybe because i find english weird language??)

anyway, can we chain booleans like this?

(x<2).iftrue{“got it!”}.capitalize.each{|c| puts c}
=>G
o
t

i
t
!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs