Trust Your Geekflex

Blog Forum Gallery
« New Engine, New Design · The Cure for Information Overload »

The Perils of Noun-Oriented Thinking

Posted by Skrud at Thursday, March 30th 2006 at 9:26am

Over at Stevey’s Blog Rants, there’s a great article entitled Execution in the Kingdom of Nouns. Stevey eloquently describes the problems inherent in the Java programming language’s emphasis on Object-Oriented Programming to the EXTREEEEME. There’s a lot of truth is the stories he tells of the problems in Javaland, and insightful comparisons to other Programming Language Kingdoms.

Java itself does force you to place things in objects, when maybe, an “object” is not always the best place for that thing. And while a Java program clearly reveals it’s architecture, it doesn’t do a very good job of revealing it’s intentions. I for one prefer intention-revealing code to anything else. I like being able to glance at a code fragment and say “I know what this does” – without having to look up a class reference API document.

Given all the Java programming I’ve been doing in one of our projects this semester, Stevey’s rant sure made me feel a bit better about being bitter. :)

Tags: , , , 2 comments

Comments

  1. wilhelmtell said:

    Nice article. I only partially agree with it, though. I understand the guy knows “a little” about Java, and he does know that methods di exist in Java – only they must be owned by an object. But sometimes he says “there are no verbs in Java”, and this is false and misleading. I don’t know why he says that.

    I agree with the idea that not everything is an object in the world we know, but I think that more than often an action is performed by an object and not by the global namespace. TakeOutGarbage(john) makes no sense for me, because it implies that a garbage is to be taken out ON John, or that a garbage is going to be taken out USING John. This is not reflective of a real TakeOutGarbage action in the real world. This, on the other hand makes much more sense for me:

    Person person("John");
    person.TakeOutGarbage();

    But an evolving creature, on the other hand, could make sense in the global namespace:

    Monkey monkey;
    Evolve(monkey);

    Although I personally like organization and order, and so I’d write it as

    God g;
    Monkey monkey;
    g.Evolve(monkey);

    Or, alternatively, create a namespace for actions of God. C++ is great because it allows me to chose my style. I agree with the article that it might be a dangerous programming language if you don’t pay attention, but if you’re ready to learn then I think you’ll learn more about computers and programming with C++ than with any other programming language.

  2. mico said:

    You miss the point. He does say there are verbs, but they are not allowed to exist on their own – any method must be owned by a class.

    From the article:

    Object Oriented Programming puts the Nouns first and foremost. Why would you go to such lengths to put one part of speech on a pedestal? Why should one kind of concept take precedence over another? It’s not as if OOP has suddenly made verbs less important in the way we actually think. It’s a strangely skewed perspective. As my friend Jacob Gabrielson once put it, advocating Object-Oriented Programming is like advocating Pants-Oriented Clothing.

    Or:

    Python, Ruby, JavaScript, Perl, and of course all Functional languages allow you to declare and pass around functions as distinct entities without wrapping them in a class.

    Do you fall on the Creationism side of the line? You should get that checked out…

Leave a Response