23

I want to ask you to provide me with some articles (maybe books), which you possibly have found very convincing criticising the OOP methodology.

I have read some in the WWW on this topic and I didn't really find a 'definitive demotivator'.

It's not much about my personal attitude to the OOP, but I really would like to have something constructive, rigorous foundation for any kind of discussion and just abstract thinking.


You can post some original research too, but please be very constructive (as my personal request).

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Bubba88
  • 1,910
  • 20
  • 44
  • 1
    SICP's section on 'modularity and state' currently is the top of my search. – Bubba88 Mar 09 '10 at 14:00
  • Uh, forgot to make it community wiki. So please take part:) – Bubba88 Mar 09 '10 at 14:01
  • Don't know if this is any help but a general critism I have come across is that purely OOP programming languages define objects for modules of the program that aren't realy object (ie they're processes or interface functions or something that could be better defined in a procedural way). – user965369 Nov 08 '11 at 11:25

11 Answers11

20

Which version of OOP? Alan Kay's original vision? The bastardized modern form of it that misses the point entirely and thus encumbers us with bizarre access control, member variables, etc? Inheritance-centric? Prototype-based? Compositional OOP?

Each form of OOP has its strengths and its weaknesses; its advocates and its detractors; its domains of utility and its domains of uselessness. There's nothing magical about OOP that makes it the Killer Paradigm and there's nothing infernal about it that makes it the Killer (of Programmers) Paradigm.

I can't really point you to any books or articles that killed my interest in OOP as a Silver Bullet (as opposed to one of many techniques I can use to keep my projects survivable). I can point to the funniest critique of a specific brand of OOP, however: Steve Yegge's classic "Execution in the Kingdom of Nouns".

JUST MY correct OPINION
  • 35,674
  • 17
  • 77
  • 99
  • Sir, don't you mind if I say that the link you gave me really counts as an answer? :) – Bubba88 Mar 09 '10 at 14:15
  • About your counter-question, I can say that I had experience in Java-like OOP, as well as some Prototype-based OOP. Are they really all not the same in the core? – Bubba88 Mar 09 '10 at 14:17
  • 1
    But it's only an answer to a specific brand of OOP of dozens. ;) – JUST MY correct OPINION Mar 09 '10 at 14:18
  • Much to learn for me... again... ((( – Bubba88 Mar 09 '10 at 14:19
  • 2
    Countering your counter of my counter-question (my brain hurts!): they are not. Alan Kay's original vision of OOP was independent software agents who communicated with each other via messages. There was no "public this, private that, protected the other" because EVERYTHING you did outside of your own class was a message call including accessing "member variables", etc. Inheritance was a minor implementation detail. In many ways languages like Erlang are more Kay-style OOP than modern OOP languages are. – JUST MY correct OPINION Mar 09 '10 at 14:20
  • Anyway, I've got your point about that diversity. I'll try to learn about all this, but still don't want to close the question. – Bubba88 Mar 09 '10 at 14:20
  • `Alan Kay's original vision of OOP was independent software agents who communicated with each other via messages.` -- Oh, that was a strike!.. Is that like actors model of parallelism? – Bubba88 Mar 09 '10 at 14:22
  • It's related, but not identical. Kay's brand of OOP incorporates much of the actor model but isn't quite as militant about it as, say, Erlang is. – JUST MY correct OPINION Mar 09 '10 at 14:33
  • 3
    As I understand it, the core of Kay's concept is that objects hold data internally and communicate via messages. Accessable fields and methods with specific signatures are *implementation details* of how to implement the handling of such messages - very convenient to handle most cases, but elevating these implementation details to core abstractions weakens the concept. – Michael Borgwardt Mar 09 '10 at 14:47
  • Aha, that was partially the point of Mr. Richter's. BTW could you explain the 'methods with specific signatures' phrase? – Bubba88 Mar 09 '10 at 14:49
  • 4
    @Bubba88: Carl Hewitt, who invented the Actor Model, based it on Smalltalk-71. Alan Kay, who invented Smalltalk-71 based it on PLANNER, which in turn was *also* invented by Carl Hewitt. The designers of Erlang didn't actually know about the Actor Model (Joe Armstrong only learned about it many years later, when he was writing his thesis about the design of Erlang), they based the design of Erlang on Prolog, which in turn is based on - surprise - Carl Hewitt's PLANNER. So, your hunch is right: the similarities are very profound and deep and certainly not coincidence. – Jörg W Mittag Mar 10 '10 at 01:49
  • 5
    @Bubba88: The designers of Erlang *also* based their design on the requirements of the telco industry: resiliency, dependability, no single point of failure, evolvability. Incidentally, those are *also* the attributes of an evolutionary successful organism, and guess what: Alan Kay actually has a degree in microbiology and based the design of Smalltalk on the way cells communicate with each other and form complex organisms from very simple structures. Again, no surprise there. – Jörg W Mittag Mar 10 '10 at 01:54
  • @Jörg W Mittag: Great info, I do think now that design approaches that provide modularity (like OOP does) have strong correspondence with those of parallelism (Actors, etc.). – Bubba88 Mar 10 '10 at 05:54
  • @Bubba88: Even in a single thread, Actor-like design gives a lot of benefits in terms of isolation, composability, etc. – kyoryu Mar 14 '10 at 09:03
12

Rick Hickey's Are We There Yet ? - A Deconstruction of Object Oriented Time was an eye opener for me. It's the most logical OO criticism I have come across.

missingfaktor
  • 90,905
  • 62
  • 285
  • 365
9

If you want a criticism of OO programming, here's what I'd recommend:

  1. Learn Smalltalk
  2. Learn Erlang
  3. Learn Scheme

Once you've done that, you will have plenty of criticism of the common interpretation of OO programming.

(Hint: OO was in many ways intended to more closely resemble the Actor model of computation, but the common interpretation of it is effectively a modification of the procedural/structured model)

kyoryu
  • 12,848
  • 2
  • 29
  • 33
4

Problem is - most people don't really know Object-Oriented Programming, so many designs SUCK.

Read the works of Scott Ambler, including his (now pretty old) Building Object Applications That Work. This has been eye-opening for quite a lot of people.

einpoklum
  • 118,144
  • 57
  • 340
  • 684
TomTom
  • 61,059
  • 10
  • 88
  • 148
3

Maybe not quite what you were looking for but have a look at the Jan/Feb issue of IEEE Software magazine: Object-Oriented Analysis: Is It Just Theory?. The basic conclusion is that OOA does not provide a good cost/benefit ratio so is poorly utilized.

Given that OOA is not effectively utililzed or supported in the "real world", I suspect that for larger development projects the overall system architecture, deployed object model and class hiearchy end up being sub-optimal and poorly understood (implemented) by various parts of the development team. A second article in the same journal: Four Trends Leading to Java Runtime Bloat point to some common OOP issues that detract from deploying high-volume Java (OOP) systems. The observations made in this article probably apply to most highly architected OOP applications.

Do not take this as OO bashing, it just reflects that as software practictioners we have quite a bit of work to do toward developing better person-to-person communication mechanisms to convey highly complex and abstracted process models.

NealB
  • 16,670
  • 2
  • 39
  • 60
2

When you define a process in natural language. You use sentences where you define the subject who will do an action on one or more objects.

The only fix point is the action, the predicate of the sentence.

I don't think assigning actions to objects is a good idea. There is only one verb, but can be multiple nouns.

In OOP you can write a file in at least 3 ways:

file.write(data);

or

data.writeToFile(file);

or

OperatingSystem.write(file, data);

Which object should implement the method? You need to think about this too. While in the procedural way, you probably write

write(file, data);

And the only thing you need to think is the order of the operands which is usally does not matter.

(Well file and data may not be the best example but you probably see the point)

Calmarius
  • 18,570
  • 18
  • 110
  • 157
  • +1. This is a very valid point. Which argument should "take a responsibility" used to be a big question when I am programming in an "OO" way. – missingfaktor Jul 27 '12 at 00:21
2

http://cat-v.org has a great page on Object Oriented Programming.

Most of the page consists of humorous but not terribly informative quotes. However, at the bottom of the page are a number of links to articles challenging OOP. They are:

If you are interested in alternatives to Object-Oriented Programming:

  • cat-v.org. From their 'about' page: Cat-v.org hosts a series of sites dedicated to diverse subjects that share an idiosyncratic intellectual perspective, questioning orthodoxy and fomenting elitism and high standards in topics from software design to politics, passing by art and journalism and anything else interesting.

  • Structure and Interpretation of Computer Programs. Specifically teaches functional programming. Available free online here, for sale here. I cannot recommend this highly enough. It is absolutely revolutionary. It will change the way you think.

  • Any and all writings/videos/lectures by Rob Pike and Steve Yegge. Of particular interest is Yegge's Whirlwind Languages Tour.

rob05c
  • 1,223
  • 1
  • 9
  • 18
  • I know this is terribly late, but I am interested in dispelling the myth of OOP as the ultimate and only way to program, so here's my 2¢. Also, I saw your comment about the SICP :). I included it anyway for completeness. – rob05c Jun 09 '13 at 04:50
2

You should really see Mr. B. Jacobs's:

OOP Myths Debunked

(also known as OOP Oversold.)

einpoklum
  • 118,144
  • 57
  • 340
  • 684
Sarfraz
  • 377,238
  • 77
  • 533
  • 578
  • Uh, I actually saw it before:) – Bubba88 Mar 09 '10 at 14:06
  • 2
    Wow, is it just me, or is that article rather heavily biased? – Andy E Mar 09 '10 at 14:12
  • 6
    I'm sorry, but I can't take a programming opinion site seriously when it is STILL hosted in Geocities. – Justin Niessner Mar 09 '10 at 14:13
  • 1
    What a very strange article - it's occasionally clownish ("Why OOP Reminds me of Communism"), and spends a bit too much time shadowboxing (does anyone think "OOP makes programming more visual"? Whatever that might mean), but it's also smart at times - the author is quite good about the hazards of inheritance for example. – Jeff Sternal Mar 09 '10 at 14:51
  • It's an odd site, but I actually agree with quite a bit of what's on there, provided you're talking about the "typical" interpretation of OO programming, vs. something more Actor-based. – kyoryu Mar 14 '10 at 08:57
  • 1
    He has a few good points that he beats into the ground with hyperbolic rhetoric. There are good (but far from decisive) arguments buried in there somewhere, but the Signal/Noise is far too low for most of it to be helpful. Too many straw men, too much hyperbole. – Dave Sims Nov 09 '10 at 01:44
1

I'd recommend learning a different programming paradigm or reading pro arguments for specific paradigms (http://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf). Besides OOP, I think the most widely used is the functional paradigm (search f.e. "Why functional programming matters"), but also have a look at the other ones. When you start looking at programming from a different perspective, the flaws of OOP start to appear automatically.

Simple exercise: define the objects IPerson, CMale and CFemale and implement the methods "sex" and "reproduce".

Gerold Meisinger
  • 4,500
  • 5
  • 26
  • 33
0

hows about steve yegge's execution in the kingdom of the noun for java style OO

jk.
  • 13,817
  • 5
  • 37
  • 50
-1

The Gideon Bible of object-oriented design patterns, aptly named Design Patterns. One of the best software design books I've ever read.

Marc W
  • 19,083
  • 4
  • 59
  • 71
  • Thx.. but I've asked about criticism :) – Bubba88 Mar 09 '10 at 14:28
  • 4
    When you read the design patterns and see how badly they get abused, that becomes criticism. :D That and the "Flyweight" as implemented in the edition I read confuses the Hell out of me seeing as the "lightweight" replacement object takes more resources (execution and memory both!) than what it was replacing! – JUST MY correct OPINION Mar 09 '10 at 14:40
  • 1
    It's hard to understand the GoF book without knowing some Smalltalk. Example: In Smalltalk, "true" is not a value. It is an object. Specifically, it is a Singleton instance of an object (I believe of type Boolean). It could also arguably be considered a Flyweight. So, `val := true` does not equate to `val = true;` in something like C# or Java - it's closer to `val = True.Instance;`. – kyoryu Mar 14 '10 at 08:48