Slashdot Mirror


Anthropomorphism and Object Oriented Programming

An anonymous reader writes: We've all been warned about how anthropomorphizing animals and machines can lead us astray. But Edsger Dijkstra once cautioned (PDF) developers against thinking of their programs that way as well. "I think anthropomorphism is worst of all. I have now seen programs 'trying to do things,' 'wanting to do things,' 'believing things to be true,' 'knowing things' etc. Don't be so naive as to believe that this use of language is harmless. It invites the programmer to identify himself with the execution of the program and almost forces upon him the use of operational semantics." A new article fleshes out Dijkstra's statement, providing a good example of where an anthropomorphized analogy for Object Oriented Programming breaks down when you push it too far.

13 of 303 comments (clear)

  1. Summarizing by ofranja · · Score: 5, Funny

    Object oriented programming, the "crystal healing therapy" of computer science.

    --
    EOF
    1. Re:Summarizing by NoNonAlphaCharsHere · · Score: 5, Funny

      Don't anthromorphize your objects. They don't like that.

  2. Procedural vs OO by NoNonAlphaCharsHere · · Score: 5, Funny

    I used to have a procedural toaster which cooked the bread until it became toast. Then I upgraded to a much more elegant OO toaster, which simply sends a "toast yourself" message to the bread. Unfortunately, bagels don't have a self.toast() method, so i still have to have a backup procedural toaster to handle the older API.

    1. Re:Procedural vs OO by quenda · · Score: 4, Funny

      Hardware analogies are fraught with peril but ...
      the object-oriented toaster never burns bread, because the slices/bagels etc set their own cook time. You don't need to upgrade the toaster every time you get a new kind of bakery product to toast.

      And best of all, you never need to empty the crumb tray, because of the built-in garbage collection.

  3. Don't anthropomorphize your programs... by Chris+Mattern · · Score: 4, Funny

    ...they hate that.

  4. Toaster DRM by tonywestonuk · · Score: 4, Funny

    Oh FFS. Look on the bloody Bagel packet before you buy. If it doesn't say 'implements toastable' then don't buy em. Yeh , they may be a few bucks more, but thats your own fault for getting a toaster that is made by the same people who make the bagels.

    1. Re:Toaster DRM by tonywestonuk · · Score: 4, Funny

      What you can buy is an 'Toast Decorator' - its a Chinese import, probably not the most legal thing as they've cracked the DRM........ what you do is just slip your generic, non toastable bagels in this toasting bag, and then shove it in your toaster. It accepts the 'self.toast()' method, and does whats required to make sure your bagels are toasted to perfection every time. Result!

    2. Re:Toaster DRM by anchovy_chekov · · Score: 4, Funny

      You insensitive clod. I bought one of these recently, in an effort to reflow the solder on my failing Mac Book Pro. Now all I have is a dead laptop and a toaster that smells of Apple.

  5. Longstanding Precedent by nuckfuts · · Score: 4, Funny

    This has been going on since before object-oriented programming existed. In Unix, for example, processes have "parents", "children", and can be "killed".

  6. Car Analogy by PaddyM · · Score: 3, Funny

    Lets say you're a traveling auto salesman, and you would like to sell your cars to different stores around the state. You could either drive each car, one at a time, to each assigned destination and hitchhike back to your starting point (always with a towel). Or you could come up with an algorithm for taking all the cars, putting them into a truck, and finding the shortest path that visits each auto store, saving gas and giving you the street credibility to comment on the appropriateness of OOP vs procedural languages. Then, after having spent a more fulfilling life than most people by being so efficient, you can watch as people invoke your name, and come up with a poor analogy which doesn't really explain OOP vs procedural languages that shows up on Slashdot.

  7. Re:Degenerate by Hsien-Ko · · Score: 1, Funny

    Well I fucking disagree with Felicia.

  8. What? by matunos · · Score: 4, Funny

    An analogy that breaks down if you push it too far?

    Ridiculous! You cannot push analogies. They are not tangible things.

  9. Re:Degenerate by rwa2 · · Score: 2, Funny

    OOP doesn't want to be anthropomorphized