Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Whammo (2555)

  (email not shown publicly)


Journal of Whammo (2555)

Tuesday December 11, 2001
12:04 AM


[ #1588 ]

"There ain't no good guy
There ain't no bad guy
There's only you and me and
We just disagree"
-- Dave Mason

I don't like Object Oriented programming.

There. I said it. Can't stand it. Give me procedural code any day.

There's a lot of hubbub in Perl circles about Ruby. There's a lot of hubbub everywhere about Java.

Well, OO is where it's at.

So they say. Oh, sure, there's a lot of things that are often packaged with OO that I like. Method and operator overloading. Inheritence. Data encapsulation. (Although not strict encapsulation. It's painful to see so many programmers jumping through hoops to get around one of the very features they often tout.)

As a matter of fact, there's really only one thing that kills OO for me.

That you can't program in it?

Very funny. No. The syntax.

When I'm programming, I'm giving commands! Read in a string! Chop off the newline! Print that string out! None of this, "String, be read", "String, be chomped", or "String, be printed." (Or is that "Input, be read into the string", "Newline, be removed from the string", and "Output, be receptive to the contents given by string."?

A lot of people like the syntax. It's so clean. It's so pure.


Look down inside that object code. What do you see? Yep, good old procedural stuff. When it comes down to nuts and bolts, it's still action-centric.

Not if it's done right.

Where everything's an object? Oh, come on. You don't actually believe that, do you? Do you normally communicate that way? Do you normally think that way? "I, these two numbers, will add." Of course not. That's why you still see the very "procedurish" 'a = b + c' in OO code.

Except that '+' is probably an overloaded method of one of the classes.

I said I like overloading. But tell me this:

If you can overload an operator and still make it procedurish, why can't you do it with a regular method? You can still have all the good things normally associated with (but not necessarily limited to) traditional OO languages, but keep a more standard procedural syntax. Why isn't there a language that balances the two, instead of the Jeckyl and Hyde nature of object-centric syntax?

Oh, wait. There is.


Indirect object syntax.

Which no one likes.

Except, apparently, for me.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I think you *do* like object oriented code. You just don't like the syntax.

    Moreover, I think you might like it better if you thought in terms of message passing. You pass an object a message to frobnosticate, and it obeys.

    Besides, not everything should look OO, it's just a good design pattern for the underlying system. Read the internals section of the pickaxe book and you'll see what I mean - I'm willing to bet it would be impossible to explain Perl's internals in such a short section.

    But we should s