watch this  

the official mrchucho blog

OOP Considered Harmful

Posted 2005 Jan 20

This opinion piece at DevX is riddled with the strangest proclamations—disguised as dissertation on the utter failure of OOP. Here are some choice quotes:

object-oriented programming (OOP) offers benefits only in a specialized context—namely, group programming.

That’s the strangest (and most inaccurate) claim against OOP that I have ever read. I use OOP successfully in almost all of my projects… from the largest web app to the smallest Python-powered AIM bot!

With the possible exception of GUI components, I’ve never heard of an OOP success story that on close inspection demonstrated OOP’s efficiency.

What about frameworks like Cocoa? I would point to this immediately and enthusiastically as a successful OOP implementation (and not just the GUI portions)! A well-designed OOP framework is both efficient and powerful. Because of things like polymorphism and dynamic binding, I can use Cocoa classes as building blocks - rather than re-inventing the wheel. With encapsulation - which seems to be author’s biggest fear—I can focus on my application and leave the “plumbing” to the framework.

Further, most programming is done by individuals. Hiding code from oneself just seems weird.

Listen: you are not secreting it away… you are encapsulating an implementation detail that, once implemented, does not necessitate constant re-examination. Clearly, the author comes from the “I want to see every detail” camp—talk about inefficient!

A frequent argument for OOP is it helps with code reusability, but one can reuse code without OOP—often by simply copying and pasting.

I have to give him this one: he has discovered the fabled 100% Reusability! Seriously, even junior programmers know the answer to this one! Say it with me: “Now you have to change it in many places instead of one.”

Encapsulation, too, is a noble goal in theory: you’ve reached the Platonic ideal for a particular programming job, so you seal it off from any further modification.

Yes, but there is more: encapsulation allows code to be segmented. So, when modifications do occur, they can be limited to the encapsulated space—rather than effecting the user’s of said code. Encapsulation isn’t the end, it’s the means.

I think this piece suffers from a case of throwing the baby out with the bathwater. OOP is a powerful paradigm, but certainly one that is easy to abuse. And, unfortunately, more often than not, it is. But, I think we all know: With great power, there must also come great responsibility.

OOP, if properly implemented and not over-applied, can lead to a startling succinctness. Certainly more lucid than the reams of comments and duplicated code that tend to accompany procedural programs. In fact, I would argue that OOP more accurately models Natural Language than procedural programs.

The true thrust, in my opinion, of this article does not appear until the end: a rant against C++. It’s a shame that he seems to have con-fused the two. One would think that the rising popularity of languages like Ruby, Python and others would have caught the author’s attention—but they are strangely absent.

The author seems also to have neglected the notion that OOP and simplicity are not mutally exclusive. Again, it is difficult to perceive the author’s ulterior motive. Likewise, he doesn’t seem to present a plausible alternative—except, perhaps, for the implicit hark back to the Glory Days of Procedural Programming.

Update: seems I’m not the only who is shaking his head at Mr. Mansfield.

comments (1)

TMN Tournament of Books

Posted 2005 Jan 20

The Morning News is holding the First Annual Tournament of Books with an NCAA-style bracket.

This is such a good idea. It’s hard to find meaningful insight on contemporary fiction—recommendations on Amazon tend to be skewed either toward fans of the genre and author or by people thoroughly displeased with their purchase. I have found that TMN has spot-on suggestions!

Unsurprisingly, I see that Phillip Roth’s Plot Against America is on list. I have yet to read this book, but amongst the sea of praise, I found the following two articles quite thought-provoking:

Now, if I could just finish The Confusion, I could start making some progress on my ever-growing To Read stack!

comments (0)

Content Use

Posted 2005 Jan 19

Not sure what I think about this. Basically, it’s a consideration of blog content ownership, who can re-publish it and how.

Services that are trying to make certain websites more accessible are getting slammed by bloggers who are accusing these services of “stealing” content or (my personal favorite) leading to the “loss of potential revenue.”

While I’m certainly not concerned about any “loss of potential revenue”, I am curious about how this interacts with my CC license—which is Attribution, Non-commerical.

comments (0)

Bloglines

Posted 2005 Jan 19

I think I can characterize myself as a “Late Discoverer, Early Adopter”—because I’m just now discovering Bloglines. As I added more and more feeds to my RSS reader, I was becoming increasingly frustrated with synchronization across computers. It’s a pain, frankly, to have to repeatedly sort through which posts are new, old or updated.

Bloglines is great. I have yet to find anything about the interface that I don’t like. I can even mark an item as Unread—unlike Newsfire. For which, by the way, I recently downloaded the update. It’s a shame there are still a couple of usability issues (for me) because it’s the finest looking RSS reader out there.

Anyway, I’m still playing with Bloglines. I’ve already developed a Bloglines AIM notification bot using Twisted. I know there’s already a notification bot… but it’s in Java! You can never have too many bots. I’ll post it once I’ve done mulit-user testing.

The Bloglines API is open, excellent and could be part of the next Killer App. In particular, I’m hoping NetNewsWire gets synchronization working as promised!

comments (1)

Delicious Library

Posted 2005 Jan 15

WIRED has a really entertaining story about the creators of Delicious Library. Their “office” is the local coffee house. I’m très jealous…

A few other good stories about software development have been making the rounds lately . Namely the Audion story and the Graphing Calculator story. If you are interested in something in book form, I recommend Soul of a New Machine by Tracy Kidder.

comments (0)

CocoaTextile supports Markdown

Posted 2005 Jan 14

Don’t forget: CocoaTextile supports Markdown. Currently, I’m implementing a Toolbar and CSS support.

comments (0)

Civil War Shorthand

Posted 2005 Jan 14

Civil War Shorthand at McSweeney’s.

comments (0)

Free Marathon

Posted 2005 Jan 14

There has been a bit of a stir (most likely because it’s free and anything free is Good News) lately regarding the release of the classic Bungie trilogy, Marathon.

Free download? Bah! I still have my originals! I remeber the days when the computers on my home network were named Durandal, Tycho, and Leela…

To really enjoy Marathon, you’ll need this Required Marathon Resource.

comments (0)

Where will you store your session?

Posted 2005 Jan 14

Jeremy comments on the Silicon Beat article, but poses the question, “where will you store your data”? Data is the easy part, what about my session? That’s what I want to know. Unless I’m using a web app (or other server-side app), I have no good way to transport my session or my state. I want to have the same five Firefox tabs open with the same history wherever I am. I want the same editing buffers open, etc. Heck, for now, I’d just settle for having the RSS posts I’ve read, marked Read in whatever reader I’m using at the moment! (Ed. I think attention.xml might help with that)

Imagine this like hibernating your desktop, then awakening someplace else. Wasn’t this the promise of the Internet? Or at least, Java. Ha ha.

comments (0)

Firefox Technorati Search Plugin

Posted 2005 Jan 14

The very helpful Technorati Mozilla/Firefox search plugin does not seem to be in the mycroft database, so here it is!

comments (0)
atom rss