Title Image

Don Xml's Grok This

The home of Don Demsak
Welcome to Don Xml's Grok This Sign in | Help
in Search

This Blog

Syndication

Site Sponsors

DonXml's All Things Techie

Is Object Oriented Programming The Problem?

I recently told this story to M. David, who got a kick out of it and just had to blog some of it. 

One of my favorite parts of conferences is hanging out with my ‘net friends, and getting into some deep conversations about topics that make normal folks just wonder what planet we are from (I call them the “scaring the straights” discussions, which is a phrase borrowed from the great movie Stripes).  TechEd 2005 was no different then any of the previous events, just a little more memorable.  After one of the Birds Of A Feather nights, while walking from the convention center to the Peabody Hotel, to have dinner and/or drinks with Mark Fussell and a couple other Xml guys, Christoph and I got to talking about Object/Relational and Object/Xml Impedance Mismatch and all the problems we have with it.  The most obvious thing about Object/Relational and Object/Xml Impedance Mismatch is that they both are focused around getting things to or from Objects.  Christoph does a lot of work with Web Services, and it seemed to him that in a lot of cases, the objects were pretty extraneous items in the whole scheme of things (not all the time, but in a lot of the cases he was seeing).  I agreed with him to some degree, but extended his idea by stating that the problem isn’t with really with Object Oriented Programming, but with the fact that it seems like everything is trying to force OOP onto all programmers, and that is where I see the a problem. 

IMHO, the majority of programmers out there can not (and should not) be OO programmers.  This is from a guy who thinks DataSets are evil, which should shock some folks.  Well if the majority of coders shouldn’t use DataSets or OO, what should they be using?  My answer is Domain Specific Languages but not in the more traditional sense that Fowler describes.  I’m not looking to morph a general purpose language into a DSL, but use more XML based languages (but it doesn’t always have to be an XML based language, only when the language is predominately hierarchical).  We have tried many different paradigms to solve the steep learning curve that is the world of a developer.  We have had lots of success with procedural programming, (things like COBOL, BASIC, Java and C++), to create dlls, object models, APIs, components, but we have never attained the orders of magnitude increase in efficiencies that is require to take our world to the next level.  It seems as though developing computer systems is the thing preventing us from really entering the “computer age”.  It almost feels like the beginning of the Industrial Revolution, when the steam engine was the thing holding us back from the true potential of the Industrial Revolution.  Trying to teach the average programmer (aka the mort) to code in a OO style seems like a waste of resources, especially considering how easily (relatively) people learn the very DSL-like HTML (well DSL-like in the way I'm thinking about it).

It was at this point in the conversation that we where nearing the Peabody, and we decide to shelve the conversation and continue it over dinner and drinks with Mark.  We meet up with Mark, John Bristowe and a couple others that I can’t remember at this time, and decided to have dinner in one of the nicer restaurants in the Peabody (we had already hit the diner in the hotel a couple times previously).  We sit down for dinner, and Christoph and I are about to start up the conversation again, when someone comes up to our table and asks Mark if we mind if he joins us.  I look up, and had to do a double take.  No, it couldn’t be.  Yes, it was.  It was Anders Hejlsberg, father of C#, Delphi and Turbo Pascal.  I looked at Christoph, giving him the “you go first” look, and he return with the “no, you go first” look.  Now, I don’t mind talking about deep stuff like this, stuff that is really way over my head with my friends, but to try to talk about it with a guy who forgot more about programming languages than I’ll ever learn, well, I decided to take a pass.  Afterwards, we got to talk to Mark about the ideas, and why we didn’t bring it up, and he scolded us, and said Anders would have probably loved to talk about it.  With the whispers we are hearing about C# 3.0 (which will be announced at the PDC 05), I do kick myself when I think about it now. 

Side Note: The singer of the Van Halen cover band The Atomic Punks, Ralph Saenz once bumped into Edward Van Halen while in line at a LA Staples store, introduces himself, but doesn’t ask to jam with him.  I now know how Ralph felt. DOH!

So, like the title says, Is Object Oriented Programming the Problem, or am I off on some crazy tangent?  I’d like to hear what others have to say.
 

Published Monday, August 01, 2005 9:43 PM by donxml
Filed under: , , ,

Comments

John Hopper said:

Hey Don,

You're right. Man, you're right. I don't have a chance in hell of really understanding what you smart guys toss around like so many peanuts at the elephant cage. Heck, I probably don't even drink the right beer. But please dont make me learn a dummy language and use it every day. It's fun to try to be smart and act like I'm smart with people who don't know any better. (Isn't that what you were doing??) And it's really really boring to give up and just be average. Ah man, my stuff works most of the time, you know. And my boss thinks it's OO, and my girlfriend is really impressed. And I won't tell anyone you helped me. Can't I call myself an OO coder as long as I just talk with the straights? By the time I get it, you will have found something new anyway.

When I was a child my little sister used to want to play army with us. I said she could be a private, and since I was a seargent, I ordered her to guard a door. Then we went about playing army and she was happy and so were we.

Can't you just let me guard a door or something?
August 2, 2005 10:37 AM

Don Demsak said:

Actually, I see myself as more as the Ralph Saenz of the programming world (someone in a tribute band, and not in "real" band), and Anders as Eddie Van Halen.
August 2, 2005 10:42 AM

Phillip Haack said:

Manual Trackback
August 3, 2005 11:31 AM

Don Demsak said:

I love Phillip Haack's reply, but I've got to hold out hope that there is a solution.
August 3, 2005 11:33 AM

Chris A said:

Does it look like some of the C-omega XML support will make it to C# 3.0?? That would help.
I think Generics will also help to allow us to make more complex data structures containing our objects that will plug into standardized code. That will solve some of the cross mapping problems.
August 3, 2005 3:39 PM

Matt Warren said:

I think what c# is doing will somewhat opposite of your ideal. Maybe not. You'll have to decide after you see it.
August 4, 2005 9:30 PM

Cleo S said:

I'm not a big fan of XML. But when it comes to OO in general, I think the problem is exactly what you said:
"focused around getting things to or from Objects", but you didn't go far enough...

There are 3 parts to programming.

1. Data. (Usually done in objects)
2. Functionality. (Usually done in objects as well)
3. Interconnectivity. Or Moving/Processing data on a larger scale.

Now, with OO most languages get #1 and #2. But how do you get data from one object to the other. How do you get information from one process to another? From one computer to another? This is where most languages fail. It's called messaging and most languages just don't have any facilities for it. It's all done through #2 ie. functions. And functions are custom built... meaning nothing is generic.

Also, I hate what they did with streams in C++. It's a good idea that just wasn't well thought out. Because of their awkwardness and limitations, I just don't use them anymore, except as another operator (for say bitsets and the like), but then operator overloading is yet just another function.

Message processing is used everywhere, yet everyone is left to fend for themselves. A simple example is threading. How do I send data from one thread to another? Even with synch, such as in java, there's no standard or suggested use. I find this lack of foresight retarded. The problem is compounded with the fact that every OS does communications and semaphores differently, so it's difficult to support in a language if you want it used on multiple platforms.

I could go on, but I think this is rather long already. I have more ideas on this. Edit this as you will.
August 9, 2005 3:33 AM

Jeff Atwood said:

> it doesn’t always have to be an XML based language, only when the language is predominately hierarchical

This is interesting, because whenever I'm trying to justify the overhead of using XML for some development task, I ask almost exactly the same question: Is this data strongly hierarchical?

However, after a number of painful development experiences over the last 5 years, I've gravitated toward the idea that strict hierarchy kinda sucks as a concept. It doesn't reflect the way the world works very well. And possibly not at all.

If hierarchy is evil, and hierarchy is strongly associated with XML...

.. is XML then evil?

Google's War On Hierarchy:

http://www.microcontentnews.com/articles/deathofhierarchy.htm

Trees, Treeviews, and UI:

http://www.codinghorror.com/blog/archives/000246.html

August 10, 2005 2:56 AM

Troy said:

We make extensive use of DSL in our project. We currently have around four DSL's
in the current project:
- One for programming the business rules in scripting language.
- One for configuring the DAL using SQL statements and stored procedures
- One for managing the structure / relationships of modules in XML
- One for menu's, toolbars etc in XML
- We would like to have XAML for our presentation layer, but we're not there yet.

While many developers enjoy working with DSLs so they can quickly develop modules
without worrying about the details, some just want to write some real code and aren't to enthused at setting properties all day long.

I think DSL has worked great for us, but it's a challenge to allow developers to "break-in" at specific points to code something manually when the DSL doesn't support some deviation. At one point we were trying to cater for all the deviations, but that doesn't seem to work well in the long run, it just makes the DSL over-complicated.

I agree with your perception of OO, in my opinion Mort programmers and OO are like oil and water. OO is great, I can't imagine programming any other way, but it's not something than can be done well without a lot of good planning. I think contract-first development goes a long way to help good planning.

What I also find causes problems are events. One action on an object can cause a chain reaction of unintended consequences. In procedural languages, you only had to focus on the procedure that you were on, nothing else was going to happen while you were stepping through the code. With OO, just setting a property can cause a ripple effect. I think this is why many programmers still program
proceduraly in an object world, you don't have to think so hard - but it's much more difficult to maintain.
August 12, 2005 12:44 PM

Tom Minderson said:

I have yet to see any publicly-inspectable code from a real-world (or close to) project that shows objectively how OOP is "better". The existing claims are nebulous. It may all be a subjective preference such that it fits the way some people think but not others. Some suggest that OOP's big problem is that it does not make use of set theory for managing variations on a theme. If you want to take a bath in OOP criticism, here is a huge tub: www.geocities.com/tablizer/oopbad.htm
January 19, 2007 12:37 PM
Anonymous comments are disabled

About donxml

I’m an independent consultant, specializing in .Net solutions architecture, based out of New Jersey who also doubles as an evangelist for XML, Domain Driven Design, enterprise architecture and .Net. I do not work for Microsoft, the W3C or any other big company that you may know of (at least not yet). I’ve been an indie for over ten years, and although I’ve been tempted a couple times to take a job with companies like Microsoft, I’ve haven’t found something better than my current situation. I work mostly with the large pharmaceuticals that are based here in New Jersey, and usually find myself on long term contracts. Definitely not the prototypical indie consultant, but it lets me dedicate time to my non-income generating activities like the developer community stuff, plus financing open source projects like XPathmania and MVP-XML. If you would like to talk to me about doing some contract work, just contact me via the contact page. My rates vary widely, depending on lots of different variables, but mostly distance from Jersey, and type of work. Plus, I’ve been known to donate some of my code for various projects.
Powered by Community Server, by Telligent Systems