Java’s biggest problem? It’s too noun-oriented
In Javaland, by King Java’s royal decree, Verbs are owned by Nouns. But they’re not mere pets; no, Verbs in Javaland perform all the chores and manual labor in the entire kingdom. They are, in effect, the kingdom’s slaves, or at very least the serfs and indentured servants. The residents of Javaland are quite content with this situation, and are indeed scarcely aware that things could be any different.
Verbs in Javaland are responsible for all the work, but as they are held in contempt by all, no Verb is ever permitted to wander about freely. If a Verb is to be seen in public at all, it must be escorted at all times by a Noun.
Of course “escort”, being a Verb itself, is hardly allowed to run around naked; one must procure a VerbEscorter to facilitate the escorting. But what about “procure” and “facilitate?” As it happens, Facilitators and Procurers are both rather important Nouns whose job is is the chaperonement of the lowly Verbs “facilitate” and “procure”, via Facilitation and Procurement, respectively.
Steve Yegge has an excellent post about Java and its reliance on Nouns at the expense of Verbs. In other words, because you can’t pass around functions or methods, you have to create a lot of extraneous classes (nouns) to express actions. As he shows, this is counterintuitive to people’s natural means of expression and thus hampers readability and conciseness. I could not agree with his thesis more.
It is truly entertaining, especially if you are a Java developer. Even if you’re not a Java developer, it is very accessible and explains the drawbacks of being so firmly wedded to Objects at the expense of methods.
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.
This is the second article I’ve found of Steve Yegge’s that I absolutely love; he’s rapidly becoming one of my favorite authors.