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.

303 comments

  1. Strawman by Anonymous Coward · · Score: 5, Insightful

    Dijkstra spends time building an analogy, then explains how it's flawed, and uses that to argue against 'anthropomorphizing'.

    That's nice, and I certainly agree that the analogy can only go so far, but he was the one to build that analogy in the first place. This is not a valid argument against anthropomorphizing at all.
    I do agree with the conclusion that anthropomorphising is not a reason to call OOP better than procedural.
    ---
    "I don't know how many of you have ever met Dijkstra, but you probably know that arrogance in computer science is measured in nano-Dijkstras"

    1. Re:Strawman by FoxMcElroy · · Score: 2

      You seem to think Dijkstra wrote the article. He was just the one who made the first quote. The article was written by Loup Vaillant.

    2. Re:Strawman by FoxMcElroy · · Score: 0

      Oh, wait, I see there's a PDF there too. Sorry, I might have made an incorrect conclusion but I'm not really feeling like reading that PDF with its handwriting or font is not appealing to me at the moment.

    3. Re:Strawman by Anonymous Coward · · Score: 0

      He (not Dijkstra, as others have noted) claims that it's an anthropomorphized example he's been given as a justification of object-oriented programming.

      [Citation needed]

      I mean, how hard would it have been to include a link or book reference? And if he doesn't remember where he saw it, how can we trust that he's remembering it correctly?

    4. Re:Strawman by Anonymous Coward · · Score: 0

      With procedural programming you're probably anthropomorphizing the machine a program runs on...

      With distributed programming we can simply anthropomorphize the hive itself, having different relations between different regions of the mind.

      As a cyberneticist I think it is ridiculous not to anthropomorphize any given collection of information flow, because when one does so we often learn new things about ourselves. The problem with anthropomorphism is not that one makes assumptions about logic systems, but that we make assumptions about ourselves; If you allow yourself to redefine what it is to be oneself, the problems with anthropomorphism disappear.

    5. Re:Strawman by Anonymous Coward · · Score: 0

      Thanks for this. Having read the article, I thought I must have lot my mind.

    6. Re:Strawman by mykro76 · · Score: 1

      And even with the luxury of choosing his own strawman, he still only manages to conclude that it's a tie between the two approaches.

  2. 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. Re:Summarizing by cold+fjord · · Score: 2

      Some of them do. Not all of them fit your template.

      --
      much of left-wing thought is a kind of playing with fire by people who don't even know that fire is hot - George Orwell
    3. Re:Summarizing by Anonymous Coward · · Score: 0

      But C++-chan is so hot!

    4. Re:Summarizing by gtall · · Score: 2

      Nah, OOP is fine in the right places, the crystal healing therapy is agile programming.

    5. Re:Summarizing by smittyoneeach · · Score: 1

      I think there is merit to Agile's overarching observation that "people don't scale".

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    6. Re:Summarizing by davester666 · · Score: 1

      Obviously, if they don't all fit your template, then you are using templates wrong.

      --
      Sleep your way to a whiter smile...date a dentist!
    7. Re:Summarizing by Anonymous Coward · · Score: 0

      Its a symptom of the OOPatriarchy

    8. Re:Summarizing by Half-pint+HAL · · Score: 1

      "people don't scale".

      Your friendly neighbourhood dermatologist might have proof that you're wrong on that....

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    9. Re:Summarizing by smittyoneeach · · Score: 2

      Nice, but seriously. Programming is about creativity. Managing large wads of people, e.g. the military, is about crushing creativity.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    10. Re:Summarizing by Half-pint+HAL · · Score: 1

      Agreed, and the paradox hits that if you have to tell all the guys under your command exactly what to do, you're essentially writing the program yourself anyway....

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    11. Re:Summarizing by beastofburdon · · Score: 1

      You're on the right track, but the military is about crushing hope, individuality, creativity, independent thought, and most importantly all sense of morality.

    12. Re:Summarizing by smittyoneeach · · Score: 1

      I'm actually retired from the military, and you're just off the mark, boss.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    13. Re:Summarizing by fustakrakich · · Score: 1

      I doubt he was talking about low ranking small fries. Be assured that a moral person won't get very far in any of this business.

      --
      “He’s not deformed, he’s just drunk!”
    14. Re:Summarizing by beastofburdon · · Score: 1

      I was in the U.S. Navy, I'm assuming you mean that there was an additional part of your humanity the military tried to crush in your branch, or it was a complete success in your case.

    15. Re:Summarizing by cwsumner · · Score: 1

      I think you are actually talking about bureaucracy, which the military has as much as other organizations. Bureaucracy kills people, in the military or outside it.

      The military must have creativity, because the high command can't be at the site of the action. The people there must be creative and do what needs to be done, or it all falls apart. And if the leaders get killed, then the people left must be even -more- creative. But military people must work as part of a team, or people really get killed.

      If you don't like being part of a team and always coordinating what you do with others, then maybe you should not be working in software, either. 8-)

    16. Re:Summarizing by beastofburdon · · Score: 1

      Bureaucracy is one of the military's most powerful tools it uses against its own people.

      Creativity however, is one of the things our military hates the most. Everything has a set procedure, and deviating from that procedure in the slightest will bring the brunt of the higher ups directly upon you. You are also not allowed to suggest changes to that procedure, no matter how stupid it is.

      There is no creativity, only memorizing countless procedures you will follow like a robot.

    17. Re:Summarizing by smittyoneeach · · Score: 1

      I've always been Christian first. Yes, that wound up precluding a full active duty career. But it was more bureaucracy in general than anything military-specific that drove me forth. Also, I was an overly-righteous, angry young creep. Took a while to grow up.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    18. Re:Summarizing by cwsumner · · Score: 1

      ... Creativity however, is one of the things our military hates the most. Everything has a set procedure, and deviating from that procedure in the slightest will bring the brunt of the higher ups directly upon you. You are also not allowed to suggest changes to that procedure, no matter how stupid it is. ...

      To "give the devil his due", The problem you saw was because they get thousands of suggestions that are just as stupid, and do not take into account that thousands of people have to use them if they change. So to get a change done it is necessary to "go though channels", which means having it checked against hundreds of other things that it can break. You can't just "do your own thing" or people could die.

      It is possible to get things changed, I have done it. First, your idea has to really be better and not just for you. Second you have to document it so others can check it out. Third it has to be enough better to justify all the time to check it out.

      And remember, sometimes it really is better to do things the hard way. Programming will teach you that, too. 8-)

  3. 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.

    2. Re:Procedural vs OO by Anonymous Coward · · Score: 0

      But with a procedural toaster you would have get involved with the operational semantics of the toaster. With fully anthropomorphized, object oriented toaster you would never have to be a part of the solution. On the negative side, the toaster might toast You! for its breakfast.

    3. Re:Procedural vs OO by NoNonAlphaCharsHere · · Score: 2

      By the same token, now you have to implement pie.toast() and cake.toast() and lots of other useless and irrelevant methods, even though you're never ever going to use them, simply because they extend the isBakeable() interface.

    4. Re:Procedural vs OO by AchilleTalon · · Score: 1

      Improper subclassing. bagel::toast() should be inherited from bread::toast() and you haven't to rewrite the whole thing, only let it know to toast on side.

      --
      Achille Talon
      Hop!
    5. Re:Procedural vs OO by drkvogel · · Score: 1

      Haha, but if you'd done it properly in OO, you would have a Toastable superclass that has a default toast() method that can be overridden for different types of toastable things if required. E.g. Bagel : public Toastable might use the default Toastable::toast(), but PopTart : public Toastable might have its own PopTart::toast() method. If you have a toastable object that there is not a specialised class for - fine, it's a Toastable and uses Toastable::toast(). In a trivial example like this, it might seem overkill, but scale up just a bit and it quickly becomes very useful.

    6. Re:Procedural vs OO by kjots · · Score: 5, Insightful

      By the same token, now you have to implement pie.toast() and cake.toast() and lots of other useless and irrelevant methods, even though you're never ever going to use them, simply because they extend the isBakeable() interface.

      Unnecessary, since the IsBakeable interface provides a default implementation of the toast() method that throws an exception if you attempt to toast something that is not toastable.

      The real issue is why the IsBakeable interface has a toast() method in the first place...

    7. Re:Procedural vs OO by cold+fjord · · Score: 1

      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.

      Man does that bring back some memories..... Borland used to make some truly awesome toasters, what ever happened to them?

      --
      much of left-wing thought is a kind of playing with fire by people who don't even know that fire is hot - George Orwell
    8. Re:Procedural vs OO by serviscope_minor · · Score: 1

      And best of all, you never need to empty the crumb tray

      Ha! I never empty the crumb tray anyway.

      BRB fire alarm has gone off again.

      --
      SJW n. One who posts facts.
    9. Re:Procedural vs OO by Anonymous Coward · · Score: 0

      Inheritance is to be wary of in depth. The primary value of OO is in encapsulation. Inheritance and polymorphism tend to give diminishing returns beyond the basic notion of an object as a group of related data and methods. You can spend a great deal of time tweaking your hierarchies and not getting much done in your business logic for marginal return later on maintenance.

    10. Re:Procedural vs OO by Anonymous Coward · · Score: 0

      Improper subclassing. bagel::toast() should be inherited from bread::toast() and you haven't to rewrite the whole thing, only let it know to toast on side.

      I don't know what you mean...

      chris_lukehart

    11. Re:Procedural vs OO by Smallpond · · Score: 1

      You mean the oven timer? The smoke alarm is how I tell when my food is ready.

    12. Re:Procedural vs OO by hoggoth · · Score: 1

      My toaster is functional. I insert a slice of bread and the toaster creates a duplicate slice of bread that is toasted. It returns the duplicate, but never touches the original. It is very safe. I can insert anything in the toaster without worrying about toasting an inappropriate object. But boy is it inefficient...

      --
      - For the complete works of Shakespeare: cat /dev/random (may take some time)
  4. Re:anthropormphism sounds like a chick thing... by Anonymous Coward · · Score: 0

    anthropormphism sounds like a chick thing

    If there were true, FurCons would be glorious.

  5. Programming languages are not really "language"! by Anonymous Coward · · Score: 1

    I get it that the author wants to make a point about abstraction (which is what it's really about, not just anthrom... whatever). However, I think he theorizes too much (CS) and misses the practical aspect of programming (reaching an end goal imperfectly).

    In the end, every programming language is just coded instructions making the computer or robot or whatever, do whatever heck you want it to do. Sometimes procedural is the best fit. Sometimes OOP is nice (yes, you can call it abuse, but if it fits the problem space, it can be very satisfying, quick and easy to keep tabs on). Sometimes a framework fits neatly and saves man-hours and number of developers (hello ActiveRecord!). Sometimes even functional or logic (Prolog) can be a better fit (never had a use for it myself but for those masochistic enough I'm sure it's VERY satisfying).

    Summary: Use the best tool that fit your needs. Don't forget: The tool is just a tool. A map is not the terrain itself. Etc.

    Btw, some of us have created "living" data structures that we can't anticipate what will do next (chaotic systems). Sometimes we even call them "games". Welcome to 2000!

    Btw, in reality procedural and object oriented are just two different views and controls on the exact same datastructures and process-flows. If you really would like to, you could even say it's all machine code in the end too. Obviously though, it does not make sense to constrict yourself to just one tool or perspective out of sheer idealism. Nor is it very productive to attempt for perfection for something that will from experience age pretty quickly.

  6. Ya, Sure. by wisnoskij · · Score: 5, Insightful

    Ya, sure. It is so much better to use the phrase: "The program contains a variable that stores your name", instead of: "The program knows your name". English, ect. all was not designed to work that way. Unless you want to take a week to describe a single program, it really helps to anthropomorphise it.

    --
    Troll is not a replacement for I disagree.
    1. Re:Ya, Sure. by N1AK · · Score: 2

      Yeah the blanket dislike for anthropomorphizing surprised me as well. The example of how discussing program behavior/structure as though it is an example of the issues this causes is useful and informative; refusing to use words like 'know', 'tries' etc when discussing programs outright, rather than keeping in mind that they can be potentially misleading abstractions, seems like throwing the baby out with the bath water.

    2. Re:Ya, Sure. by by+(1706743) · · Score: 1

      Unless you want to take a week to describe a single program, it really helps to anthropomorphise it.

      Especially when it's that cute little Clippy!

    3. Re:Ya, Sure. by sandytaru · · Score: 3, Informative

      I think there is a layer there at which point it's useful, and one at which it's not. It's fine to anthropomorphize a program when explaining to an end user why it's broken, e.g. "The program doesn't know to check for the start date of a new lease when the old one expires, it just thinks it should activate it regardless." (Actual problem we're having to fix right now.) But of course the developer shouldn't think that the program is confused; it's doing exactly what we asked of it in a nightly stored procedure, and not bothering to check start dates because it wasn't programmed to do that in the first place!

      --
      Occasionally living proof of the Ballmer peak.
    4. Re:Ya, Sure. by dissy · · Score: 1

      The last time I anthropomorphized a program it got quite angry at me.

      Mrs Compiler wouldn't let me sleep in C: for a week, and even then she wouldn't let me declare unsigned variable types for the rest of the month!

    5. Re:Ya, Sure. by phantomfive · · Score: 1

      Say, "the program contains your name." Or "the program has your name." Problem solved.

      --
      "First they came for the slanderers and i said nothing."
    6. Re:Ya, Sure. by AmiMoJo · · Score: 1

      "The program stores your name." Simple and precise.

      I agree thought, FTA is dumb. It is accurate to say that a program tries to do something when it makes some call that may fail, or when it uses a try...catch to attempt something that may fail. "Want" may be a bit of a stretch, but it's a shorthand way of describing behaviour like needing a file to be in a certain location or trying a particular operation first before taking some alternate action.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    7. Re: Ya, Sure. by ShieldW0lf · · Score: 1

      "The program doesn't know to check for the start date of a new lease when the old one expires, it just thinks it should activate it regardless."

      What's wrong with "The program wasn't designed to check for the start date of a new lease when the old one expires, it just activates it regardless."

      More accurate, less words, and no shifting responsibility for the situation to a "naughty program" in a manipulative subconscious effort to evade responsibility for what you built.

      --
      -1 Uncomfortable Truth
    8. Re: Ya, Sure. by Anonymous Coward · · Score: 2, Insightful

      Atheism suffers from this too... There are so many standard phrases for swearing/exclamations that invoke some deity construct that atheists are forced to continue using them as they are too entrenched in our cultures to replace. "Damn you!" Is too perfect to replace with "my anger is so vivid that I want the universe to arrange something very bad to happen to you. Err, except I don't believe the universe is sentient of course, ummm, errrr, I think I'll shut up now"

    9. Re:Ya, Sure. by Anonymous Coward · · Score: 0

      Personally I use 'know' as 'potentially has access to the information.' This is useful when working with third party code.

    10. Re:Ya, Sure. by Oligonicella · · Score: 2

      Or someone hearing "the program knows your name" can simply recognize it's meaning instead of tossing a hissy.

    11. Re:Ya, Sure. by mbone · · Score: 1

      He doesn't like assignments either. As he says, the variable "x itself doesn't change. Ever. The value it holds is just replaced by another." So he would probably want you to say "the program contains a variable whose value stores your name"

    12. Re:Ya, Sure. by Sardaukar86 · · Score: 1

      refusing to use words like 'know', 'tries' etc when discussing programs outright, rather than keeping in mind that they can be potentially misleading abstractions, seems like throwing the baby out with the bath water.

      Indeed. If the alternative to the 'most unclean' anthropomorphisation is strict enumeration then naturally tries becomes tests for, knows becomes stores.

      Voilà! We now have a schoolyard argument over semantics. What did that gain us exactly?

      --
      ..Mullah or Pope, Preacher or Poet, who was it wrote: "Give any one species too much rope and they'll fuck it up"?
    13. Re:Ya, Sure. by Imrik · · Score: 1

      Neither of those means quite the same thing as "the program knows your name." The first could be a reference to attribution, the second could be a reference to the program's name.

    14. Re:Ya, Sure. by phantomfive · · Score: 1

      the second could be a reference to the program's name.

      You mean "the program has your name"? There is no way that could be a reference to the program's name.

      --
      "First they came for the slanderers and i said nothing."
    15. Re:Ya, Sure. by The+Rizz · · Score: 1

      This program is named "phantomfive". The program has your name.

    16. Re:Ya, Sure. by a_n_d_e_r_s · · Score: 1

      I programmed a litte executable and called it phantomfive.

      The program has your name.

      --
      Just saying it like it are.
    17. Re:Ya, Sure. by phantomfive · · Score: 1

      That was so nice of you.

      --
      "First they came for the slanderers and i said nothing."
    18. Re:Ya, Sure. by Anonymous Coward · · Score: 0

      Cognitive load.

      Note Edsger D. Dijkstra was equally pissed that there exist languages based on directed acyclic graphs where one can write 'programs' using a row column based 'IDE' And worse these tools are used by uneducated bookkeepers and accountants to write terrible programs for which no proof exists.

      So the deal is, if you can frame a problem in such away that it can be reasoned about anthropomorphically, then cognitive burden is reduced dramatically. It becomes very easy to write and very easy to document.

    19. Re:Ya, Sure. by Anonymous Coward · · Score: 0

      "Unless you want to take a week to describe a single program" You've never had to write requirements, have you?

    20. Re:Ya, Sure. by smallfries · · Score: 1

      The program knows your name.
      The program stores your name.

      Anthropomorphification is not much terser. However it is wrong - the intentional form implies many things that are not true. The non-intentional form indicates that the program works with a copy of the information. The difference between the two is where most bugs live.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    21. Re:Ya, Sure. by serviscope_minor · · Score: 1

      Yeah the blanket dislike for anthropomorphizing surprised me as well.

      TFS seems to extend that to animals which is nuts. Animals do actually feel emptions and they do have desires etc even if not as complex as our own.

      --
      SJW n. One who posts facts.
    22. Re:Ya, Sure. by reve_etrange · · Score: 1

      It is accurate to say that a program tries to do something

      The key is intentionality. Programs are intentional systems, and their "aboutness" is reflected in variable names ("speed", "name"), language constructs (try-catch) and, most importantly, however the algorithm achieves a specific end.

      IMHO, we can go a long way in using the "intentional stance" without venturing into potentially misleading anthropomorphizations.

      --
      .: Semper Absurda :.
    23. Re:Ya, Sure. by Hognoxious · · Score: 1

      Yeah, I used to know a pedant like that. I was in a meeting with him talking about a message passing system. When I said it should get suspicious if the status hadn't moved after X minutes he went off on a rant about how software can't be suspicious and called me an idiot.

      I made a point from then on of saying things in as long-winded a way as possible. Instead of "it didn't like that" I'd say "my preliminary hypothesis is that the input, that's to say the parameters entered, seems to violate some assumption that the designer or designers made about ..."

      He did eventually get the message.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    24. Re: Ya, Sure. by znrt · · Score: 1

      As for damn, it's from the Latin damnare to condemn, not exactly requiring a deity.

      damnation noun \dam-n-shn\
      : the state of being in hell as punishment after death
      http://www.merriam-webster.com...

      pro-tip: not that it is the only latin word with arbitrary new meanings in english. go figure, some weird antropomorphization going on.

    25. Re: Ya, Sure. by ultranova · · Score: 1

      What's wrong with "The program wasn't designed to check for the start date of a new lease when the old one expires, it just activates it regardless."

      It's inaccurate, and implies this is someone's fault, which might be untrue - for example if the scenario was impossible by the time the feature was added - and can easily be interpreted as an attack. "The program doesn't check" is both correct and unlikely to generate drama.

      More accurate, less words, and no shifting responsibility for the situation to a "naughty program" in a manipulative subconscious effort to evade responsibility for what you built.

      Every choice of words is "manipulative" in that it frames the context. "The program doesn't know" implies it's the program that's at fault, "the program wasn't deisgned" implies it was the programmer, and "the program doesn't" implies this is an unfortunate situation that's no one's fault. Of these, the last seems like being most conductive to getting the problem fixed and avoiding perverse incentives (for example, to not report bugs you found to protect yourself or your friends).

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    26. Re: Ya, Sure. by Anonymous Coward · · Score: 0

      We just use "Dam you".

      As in "May you get buried under the concrete during construction of the next hydro plant".

      Nobody notices the difference.

  7. Every analogy fails. by jpellino · · Score: 1

    Like all, this one works up to a point. Learning something new without analogies is probably going to be very slow. It's not like this is the downfall of programming, but it's passing-interesting as a note.

    --
    "Win treats sysadmins better than users. Mac treats users better than sysadmins. Linux treats everyone like sysadmins."
  8. My code by Tupper · · Score: 2

    My code wants to be antropomorhized!

    1. Re:My code by Tupper · · Score: 1

      As you probably guessed, I write spell checkers.

    2. Re:My code by NoNonAlphaCharsHere · · Score: 2

      I right spill chuckers two!

  9. If it can be overdone must never be done all? by Anonymous Coward · · Score: 0

    If something breaks down when you push it too far, then don't push it too far.

  10. Encapsulation by mrflash818 · · Score: 4, Insightful

    For me, I prefer OO programming (c++/java) to functional programming (C-lang), just due to encapsulation. I like having an object, with methods for its attributes, public/private methods, and such. Then having the objects interact in my program. It kinda makes sense to how I think.

    However, I also think that if a team or individual programmer can release software that serves a useful purpose, and is maintainable, then those are the only things that matter. Which language, functional or object-oriented 'way' that was used to get there? Seems less important.

    --
    Uh, Linux geek since 1999.
    1. Re:Encapsulation by Anonymous Coward · · Score: 1

      I don't think functional programming means what you think it means....

    2. Re:Encapsulation by Anonymous Coward · · Score: 0

      If you think C is a "functional programming language" you need to go back to school. C is a procedural imperative language. Haskell is a functional language.

    3. Re:Encapsulation by K.+S.+Kyosuke · · Score: 1

      Yeah, and we were taught in the 1980s that procedural languages are those that describe procedures for solving problems. I.e., anything non-goal-oriented like SQL or rudimentary Prolog. Most OO language really fall under that category, too.

      --
      Ezekiel 23:20
    4. Re:Encapsulation by beelsebob · · Score: 2

      Nor does encapsulation mean what he thinks it mans. The idea that you can't do encapsulation unless you have OOP is completely flawed.

    5. Re:Encapsulation by dkf · · Score: 1

      Most OO language really fall under that category, too.

      That's because most OO languages are also procedural programming languages (for historical reasons). OO is principally about how to organise data and the operations on it, which is orthogonal to whether the operations are sequences of commands or composite functions to be applied.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    6. Re:Encapsulation by Anonymous Coward · · Score: 0

      Nor does encapsulation mean what he thinks it mans. The idea that you can't do encapsulation unless you have OOP is completely flawed.

      This has always bugged me about OOP. We already had these techniques and good programmers used them. They just had different names. When OOP became cool, it didn't make bad programmers into good ones. They make too many shallow object or sets of objects that work together in overly complex ways. The goal of OOP was to make encapsulation easier, but the hard part was never the language, but being smart enough to draw the boundaries in the right places.

    7. Re:Encapsulation by TheSunborn · · Score: 3, Insightful

      What the oop languages did, was to add explicit language support for all the features and idioms which software developers did anyway.

      This make development and maintenance much more easy.
       

    8. Re:Encapsulation by beelsebob · · Score: 1

      The problem is that it only added explicit language support for one of the many different ways we abstracted things, and did so at the cost of all of the others.

      It stopped people thinking about how best to solve the problem, and made them just solve it by (as the author says) anthropomorphising everything.

    9. Re:Encapsulation by angel'o'sphere · · Score: 1

      Keep in mind that C is mot a functional programming language, using C/Pascal/Fortran like languages is called 'procedural' not 'functional' and that is part of the world of 'imperative' languages (in contrast of declarative)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    10. Re:Encapsulation by angel'o'sphere · · Score: 1

      No they are not procedural, if at all they are like C++ and are called multi paradigm.
      E.g. Java, Smalltalk or C# is not procedural at all (or Simula) for that matter.

      You are mixing up 'imperative' languages (that is actually what the parent meant) with 'declarative' languages.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    11. Re:Encapsulation by Anonymous Coward · · Score: 0

      You do know that in procedural languages you can call other modules?

    12. Re:Encapsulation by dkf · · Score: 1

      No they are not procedural, if at all they are like C++ and are called multi paradigm.

      That's largely a crock of shit and C++ programmers are just kidding themselves. The only two paradigms that C++ really implements are OO (for structural organisation) and imperative (for operation description). It's not functional in any meaningful way (it's possible to pretend, but it feels very strange if you do) and declarative programming is rather different. The only declarative language that most programmers normally encounter is SQL.

      My point was that there's no real reason why OO can't be used with functional programming, or declarative programming. It just tends to be paired up with imperative programming for historical reasons.

      You are mixing up 'imperative' languages (that is actually what the parent meant) with 'declarative' languages.

      I forgot the term. Oh well.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    13. Re:Encapsulation by nuonguy · · Score: 1

      This deserves to upvoted 100 times. Since the changes went into effect I haven't had mod points at all. I had mod point almost every day before the changes went into effect.

      The programmer who's only ever coded in Java or only in C++ might be a bit like the "man of one book". All the claimed benefits of OOP (enapsulation, data hiding, etc) were around as practices long before Java styled OOP became so popular.

      The parent might be well served by http://en.wikipedia.org/wiki/O... .

    14. Re:Encapsulation by istartedi · · Score: 2

      It sounds like you might be somebody who learned to program someplace other than a CS degree, or who got a CS degree and forgot some academic stuff that you haven't used in your day-to-day work.

      You've run afoul of the "functional" doesn't mean "uses function calls a lot" problem and some chest-pounders here are slamming you for that. As an EE who only had a few undergrad CS courses, I've had similar problems. Somewhere out there is a USENET thread in which I'm assuming that "side effects" are "bad side effects" as opposed to manageable outcomes of calling non-pure functions. Thus, I can empathize with you.

      Chances are you're a fine programmer who just never studied functional programming. Forget the pedants, and google Lisp, Haskell, "pure function", "functional programming", etc. I'll wager you won't want to write programs in those languages but will find it interesting. You'll also be less likely to bring pedants out of the wood work once you're familiar with the terminology.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    15. Re:Encapsulation by angel'o'sphere · · Score: 1

      C++ is mot functional and no one claimed it, but you can be semi functional by using functor objects (classes that implement operator() ).
      C++ supports theese paradigms: oo, procedural and generic programmig (and template metaprogramming). Template metaprogramming actually is a subset of functional programming, but expressed at compiletime so to only limited use.

      Well other declarative languages are Prolog and Miranda and to a small degree Erlang, but allas: they are all multiparadigm and not purely declarative. E.g. you can easy program procedural/imperative style in Prolog. I quick glance on wikipedia showed no 'pure declarative' languages except SQL ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    16. Re:Encapsulation by Anonymous Coward · · Score: 0

      +5 Insightful for "C-lang" being "functional"?

    17. Re:Encapsulation by anchovy_chekov · · Score: 1

      I like what you did there. Person made a error but you didn't make him / her look like a fool. Wish I had mod points I could spend here.

  11. Crap article by gnasher719 · · Score: 1

    Something that Dijkstra wrote in 1983, and a crap article that gives some examples of bad programming to show a bad point.

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

    ...they hate that.

    1. Re:Don't anthropomorphize your programs... by jeffb+(2.718) · · Score: 1

      Perhaps the problem is that too many people in this thread are trying to anthropomorphize Edsger Dijkstra.

  13. Missing the point by pushing-robot · · Score: 5, Insightful

    OO isn't about anthropomorphism, it's about isolation and providing a clear API. If this was a large scale project with fifty people working on code that could move students, I don't want them implementing fifty different versions of move_student that will break whenever the Student or Classroom model changes.

    I know it's trendy to hate on things that have been around a while, and OO indeed isn't the answer to everything, but it's still a useful way of keeping a complex program from getting out of control.

    --
    How can I believe you when you tell me what I don't want to hear?
    1. Re:Missing the point by phantomfive · · Score: 4, Insightful

      OO isn't about anthropomorphism, it's about isolation and providing a clear API.

      Believe it or not, isolation and 'providing a clear API' existed before OOP, so you can't say that's it. In general, object oriented programming means that the functions go with the data.

      --
      "First they came for the slanderers and i said nothing."
    2. Re:Missing the point by Anonymous Coward · · Score: 0

      unfortunately the sad truth is that most large scale OO projects have almost no data encapsulation and leak internals such as references to mutable lists and arrays to all call sites.

    3. Re:Missing the point by K.+S.+Kyosuke · · Score: 1

      OO isn't about anthropomorphism

      Originally, it was actually about cellulomorphism. Programs were supposed to look like systems of communicating biological units, i.e. cells.

      --
      Ezekiel 23:20
    4. Re:Missing the point by Anonymous Coward · · Score: 0

      Basically what this guy said.

      I've read TFA and I'm not sure what the point of it is, exactly. It likes to show an example of "anthropomorphism gone wrong" but in the end admits there is nothing wrong at all: "... Both examples are sequential and neither is harder to parallelise than the other ..." and "It is not simpler. Just organised in a more systematic way. ..."

      OOP is a way to model and build your programs, not a magic wand. If you can't organise your programs properly, then you're in trouble, because OOP certainly won't do it for you. The same is true for procedurally coded programs, by the way. OOP should be a help in creating a sound architecture, but the burden is ultimately still on the programmer.

    5. Re:Missing the point by Tom · · Score: 1

      it's about isolation and providing a clear API.

      Which did not exist before the invention of OOP... oh, wait...

      I don't want them implementing fifty different versions of move_student

      If only someone had thought of a way to define shared functions. He could call it a collection, or an archive, or a library, no that's crazy...

      but it's still a useful way of keeping a complex program from getting out of control.

      Being organized and professional is a useful way of keeping a complex program under control. With the right approach, it almost doesn't matter which language or paradigm you use. And with the wrong approach - ditto.

      --
      Assorted stuff I do sometimes: Lemuria.org
    6. Re:Missing the point by lokedhs · · Score: 1
      Except in good object orientation systems, functions does not go with the data. That's a limitation introduced by Simula 67, which started a trend that survives till today, with Java, Ruby and all the other single-dispatch languages.

      Far too many programmers these days seems to believe that object orientation is equivalent to the limited form available in languages like Java and C++. They would be helped by learning a language that has multiple dispatch before commenting on that object orientation is.

    7. Re:Missing the point by Anonymous Coward · · Score: 0

      I'll take "What are libraries" for 1000, alex!

    8. Re:Missing the point by pushing-robot · · Score: 2

      There's a big difference between allowing something and requiring it. I think OO was the natural evolution of concepts like interfaces and namespacing, but what sets it apart is that it insists (so far as it can) the developer encapsulate information, while procedural languages at best suggest it.

      Of course it's possible to write clear code in any paradigm, and some of the most beautiful code I've ever seen has been purely procedural, but that is unfortunately the exception. Most code I read is pretty poor, and the worst OO code I've encountered is far ahead of the worst procedural code in terms of readability and maintainability. I'll take the kludginess of OO over the heroic measures it takes to keep a large C project from turning into an unintelligible mess.

      --
      How can I believe you when you tell me what I don't want to hear?
    9. Re:Missing the point by phantomfive · · Score: 1

      I think OO was the natural evolution of concepts like interfaces and namespacing, but what sets it apart is that it insists (so far as it can) the developer encapsulate information,

      No, that's not what sets it apart. See above for the meaning of OOP: it means that the objects and functions are bundled together.

      --
      "First they came for the slanderers and i said nothing."
    10. Re:Missing the point by Anonymous Coward · · Score: 0

      Too bad that the perfect platform for the object oriented revolution, namely the CELL architecture, was cancelled. As a consolation, we still have state machines to partition the space. ;)

    11. Re:Missing the point by phantomfive · · Score: 2

      No, sorry, multiple dispatch existed in Lisp before object oriented programming.

      --
      "First they came for the slanderers and i said nothing."
    12. Re:Missing the point by lokedhs · · Score: 1

      Which system provided that? I know that CLOS was built on previous work, although I haven't heard of any MD system in Lisp that did not also provide objects.

    13. Re:Missing the point by phantomfive · · Score: 1

      I don't know, I think I was actually brain-dead when I wrote that post.

      --
      "First they came for the slanderers and i said nothing."
    14. Re:Missing the point by swilly · · Score: 1

      Many definitions of Object Orientation describe methods as functions associated with data (or with an objects state) and define them formally in terms of message passing. In fact, Alan Kay (creator of Smalltalk and I believe the originator of the term Object Oriented) includes objects sending and receiving messages as part of his definition of Object Oriented. Of course, Alan Kay also stated that every object is an instance of a class, so perhaps his definition isn't quite correct today.

      Multiple dispatch often relies on inheritance, which is necessary but insufficient for Object Orientation. However, it isn't clear how to map a function call into a message for an object. Message passing is too useful of a model of computation to throw away. Perhaps you can create a definition of Object Oriented that doesn't use it, but I haven't seen one.

    15. Re:Missing the point by angel'o'sphere · · Score: 1

      Nearly all OO languages except SmallTalk don't use message passing, but function calls: C++, Java, C# and nearly everything implemented on the JVM and the CLR ... exceptions I know about are Groovy, not sure about Phython.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    16. Re:Missing the point by angel'o'sphere · · Score: 1

      The only OO language that I'm aware of that insists on encapsulation is SmallTalk.
      In all other languages you can make data fields as public as you want. And encapsulation means: part of the implementation is not accessible from the outside or even: hidden.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    17. Re:Missing the point by lokedhs · · Score: 1
      I'd argue that the difference is largely academic. They do refer to two distinctly different ways of thinking about it, but if you look at how method calls/message passing is actually implemented there is little difference. In both cases you request the invocation of a method, and there is a dispatcher that chooses at run time which actual implementation will be called.

      Having the actual method implementation tied to a class (as is the case in most languages, including Java and C++) is again an implementation detail, albeit one that can limit the flexibility available to the programmer.

      Extrapolating this further brings us to generic functions which are just plain functions which is a dispatcher to multiple implementations. I'm sure one can argue for hours whether or not that is message passing or not.

    18. Re:Missing the point by angel'o'sphere · · Score: 1

      The difference is absolutely not academic!

      but if you look at how method calls/message passing is actually implemented there is little difference
      And exactly that is plain wrong.
      In a method invocation like C++/Java you have an array of pointers to functions/methods.
      That means the compiler creates code like this: $classname.vtable[methindex](arg0, ... argn) to call the virtual method with index 'methindex' belonging to class 'classname'. (This are static allocated array of pointers to functions). Java/C# does it slightly different via the invoke_virtual opcode but bottom line ends at the same double indirection via an array of pointers. That is e.g. the reason why virtual function calls in C++ are considered to need ~1.7 times the time than a static (non virtual call). This obviously is only true for parameter less empty methods, for methods (member functions) that actually do something, the overhead is neglectible.

      In a message passing system, the message itself often is an object like this:
      class Message {
      String messageName; // usually called 'selector'
      List arguments; // the arguments of the 'method call'
      }

      Now usually in a message passing system every class has a meta class that handles method invocations. So now we have a method (yes a method in a message passing system) that is named 'invokeMethod(Object o, Message m)'. Instead of using the direct dispatch to a method (which is basically assembly code generated by the compiler) we now simply call the invokeMessage method of the metaClass and give it the object (what is named 'this/self' inside of the method) on which a certain method is to be called and also the message.

      Now the big difference is: in method calling, the compiler only generates code to call methods it knows to be existing.
      However in a message calling environment the compiler simply constructs a Message object and calls the metaClass's invokeMetjod method of that objects metaClass, passing that Message to it. So the MetaClass - or if it can't - the object itself (by overwriting the 'dispatchMessage' method), interpret the Message and call the appropriated method.
      In other words message passing works completely dynamic and is resolved by the runtime system while method calls are resolved statically by the compiler.

      Generic methods have nothing to do with that at all.

      In the MetaClass above as well as in the 'real class' the invokeMethod() method can be overwritten. And bottom line the compiler also calls non existing methods, as it simply converts any call into a message and 'hopes' the runtime system knows what to do.

      Groovy builders and SmallTalk DSLs e.g. work via that trick.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    19. Re:Missing the point by dkf · · Score: 1

      In other words message passing works completely dynamic and is resolved by the runtime system while method calls are resolved statically by the compiler.

      Am I right in saying that the marks of a message passing solution are that it can handle "calls" of arbitrary methods and that the class/object itself can control what happens in that case?

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    20. Re:Missing the point by angel'o'sphere · · Score: 1

      Yes, that is the point.
      There are easy examples on the groovy introduction site.
      Either you implement 'invokeMethod()' yourself or you let the normal invokeMethod call handle it, which will fail in the end if it finds no fitting method and will call 'methodMissing()'.
      InvokeMetjod is usually handled by the meta class, methodMissing by the class the object belongs to.
      The names vary a bit from language to language, but the principle is the same. Python e.g. works similar.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    21. Re:Missing the point by lokedhs · · Score: 1
      Clearly you never used CLOS. In CLOS, a generic function is called just like any function (in fact, you can compile a code that calls a generic function before that function has even been defined). Defining a GF means that the dispatcher function is created that allowed you to define methods on it.

      The actual dynamic behaviour that you talk about has nothing to do with the object orientation at all. The "invokeMethod" that you talk of is simply the FUNCALL or APPLY functions that simply calls a function.

      At the end of the day, regardless of how you choose to think about object orientation conceptually, all that really happens is that some code is called based on some property of the arguments that you pass in. The most common form is simply the choice of implementation based on the runtime datatype of the first argument.

      Here's the important point: If I were to give the following statement: "Java uses message passing", it's actually very hard to contradict that. Every single feature and behaviour of message passing systems you mentioned above with the exception of having a fallback implementation can be replicated in Java with just a bit of reflection. If the designers of Java had really wanted (and IMHO, they should have) they could have added the necessary extra syntactic sugar to achieve that.

      Whether or not an "actual" message object is constructed that is passed as an argument to a dispatcher, or if the compiler creates a vtable is really an implementation detail and as a programmer you very rarely, if ever, see the difference. You seem to have confused the difference between static and dynamic languages with that of object orientation style.

      If you still feel the desire to reply, then I really would like to know how you categorise generic functions (in particular, the CLOS kind) in terms of message passing vs. something else.

    22. Re:Missing the point by Anonymous Coward · · Score: 0

      More to the point, this article is worthless and the summary ("where an anthropomorphized analogy for Object Oriented Programming breaks down") incorrect. The analogy does not break down at all. I was expecting a case where anthropomorphic reasoning gave you the wrong answer, but here it gives you an answer that - once you elide the OO sugar - is completely the same as the "right" answer.

    23. Re:Missing the point by angel'o'sphere · · Score: 1

      Erm ... why do yoou shift topic?

      We did not talk about object orientation.

      We talked about method CALLing and MESSAGE-passing.

      Both are complete different things.

      I don't know how CLOS works, and never claimed it. AFAICT it has nothing to do with the discussion you raised.

      Whether or not an "actual" message object is constructed that is passed as an argument to a dispatcher, or if the compiler creates a vtable is really an implementation detail
      No, it is not. It is a fundamental difference in approaches. One maps directly to assembly/machine code the other uses a meta object protocol.
      One is lightening fast, the other blamed to be slow(er).

      If you still feel the desire to reply, then I really would like to know how you categorise generic functions (in particular, the CLOS kind)
      http://en.wikipedia.org/wiki/G...
      A CLOS generic function is a helper function to realize multiple dispatch on the functions arguments to call the most appropriated concrete function. AFAIK there is an IDE shortcut to generate them.
      No idea at what your question aims, as you claim to have CLOS experience while I have none (which does not mean I don't know what it is :D ) Actually if I would not hate the LISP parenthesis labyrinth so much I would like to try it.

      Your statement about Java and message passing and reflection: simply makes no sense, so I did not comment on that. Java works just like C++ with a dispatch table - no message passing involved and what the heck should reflection have to do with that? Groovy is a dynamic language, Java like, running on the JVM. It implements message passing ... it is a no brainer that you can do that with reflection. So what is your point again?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    24. Re:Missing the point by lokedhs · · Score: 1

      My point is, in a nutshell, that a "message passing" system can (and often will) compile down into exactly the same code as the other kind of calls.

    25. Re:Missing the point by angel'o'sphere · · Score: 1

      And this is wrong as I now pointed out 4 or 5 times.

      C++
      MyObject o = new MyObject()
      o->someMethod()

      Asm:
      load Rx, o // load reference to o into a register
      load_indirect Ry $_MyObject_vtbl, #indexOf_someMethod // load method adress via class' vtable
      jsr_indirect Ry // invoke the method

      Java:
      aload o // get object reference on stack
      invokeVirtual #1 // or what ever index the method has

      MessagePassing in pseudo code:
      creste a message object
      fetch metaclass of object
      call invokeMethod, passing object and message ...
      down in "invokeMethod":
      find most appropriated method implementation, based on name and arguments
      call it via "reflection"
      -- this uses likely a hash map and some optimizations
      if failed to find a suiting method: call "missingMethod" of the class of object o
      -- and here in missingmethod it goes on ...

      The pseudocode for message passing is up to 1000 times slower than the assembly of the call in the C++ example. And the compiler only generates a "fire and forget call" to the metaClass without caring if the method exists or not. OTOH in the C++ (or any other method _call_ scenario) the compiler only generates code which is guaranteed to work.

      Message Passing _can compile down_ to a direct call if many assumptions are true, for that I suggest to read how SmallTalk environments generate C code (Squeak/Pharo) ... one case e.g. are calls to self/this and super, because here the exact type is known.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    26. Re:Missing the point by lokedhs · · Score: 1
      Saying something several times doesn't make it true. There is nothing in the behaviour of message passing that would prevent it from being compiled into a vtable call behind the scenes.

      Of course, in highly dynamic systems you need to recompile method calls on the fly, but that is true for languages like Java as well, which also needs to do this.

      Finally, CLOS has the most flexible method calling in existence. You can write your own methods that chooses the appropriate method to call (look up define-method-combination for the gritty details). Amazingly enough, it still manages to compile the method invocations into direct calls.

      That said, the actual underlying implementation of the compiler is completely irrelevant in this case. The actual provided functionality available to the programmer, is. And from the point of view of the programmer, the difference between message passing and nay other calling style is minimal, at best.

    27. Re:Missing the point by angel'o'sphere · · Score: 1

      Well insisting on your point of view, which I demonstrated now several times to be false, makes it not true either :D
      There is nothing in the behaviour of message passing that would prevent it from being compiled into a vtable call behind the scenes.
      You seem not to understand how message passing works. Now I wonder if your recent posts where done by you or if you copy pasted it from somewhere.

      Of course AFTER the message dispatch mechanism finally calls the appropriated method it can be called via vtable (but likely it is not). The point is the resolving happens during runtime, and is not done by the compiler.

      Your claim about CLOS being unique or superior is wrong again ... all languages that use message passing give you the option to either modify the message dispatch it in the meta class or in the class itself. Otherwise the whole approach would be pointless.

      the difference between message passing and any other calling style is minimal, at best.

      This is complete nonsense as I pointed now out several times, but it seems you are not reading or grasping what I write. You are even contradicting yourself :D as that last sentence stays in stark contrast to everything you said so far about CLOS.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    28. Re:Missing the point by lokedhs · · Score: 1
      I've been consistent all along. you're the one who keeps moving the goal posts.

      Let's pretend I'm stupid (which should be easy for you since you either seem to be convinced I'm intellectually inferior to you, or you are just being a condescending arse) and explain to me what part of method dispatch is done statically (in a "non-message-passing system" vs. dynamically in a "message-passing system").

      Since you are arguing that these methods are so fundamentally different, I would expect to be able to see functionality in the latter that just can't be achieved in the former.

      I argue that, once you strip out the terminology and look at what these systems actually do, there is not real difference.

    29. Re:Missing the point by angel'o'sphere · · Score: 1

      A message passing system e.g. can respond to messages for which no method exists. A static calling system will create an compiler error in that case.

      Is that what you wanted to know? Sorry, your sentence "explain to me what part of method dispatch is done statically (in a "non-message-passing system" vs. dynamically in a "message-passing system")." is imho incomplete.

      No idea about your stupid versus arse comment/part.

      I argue that, once you strip out the terminology and look at what these systems actually do, there is not real difference. Yes you said that now 10 times. And it is wrong. So no idea why you argue that way. You seem not to grasp how "non message passing" as in "virtual method call" in e.g. C++ or Java or any "static" compiled language works. I explained it now several times ... perhaps I'm just to bad in explaining?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  14. another article by the same guy by phantomfive · · Score: 1

    He says that anyone who uses the term 'object oriented programming' is crazy. I don't think he's realized that OOP means that the functions go with the data.

    --
    "First they came for the slanderers and i said nothing."
    1. Re:another article by the same guy by K.+S.+Kyosuke · · Score: 1

      I think he understands it very well if he's familiar with how Kay defined it.

      --
      Ezekiel 23:20
    2. Re:another article by the same guy by phantomfive · · Score: 1

      I think he understands it very well if he's familiar with how Kay defined it.

      Do you know how Alan Kay defined it? (hint: he didn't give a clear definition)

      --
      "First they came for the slanderers and i said nothing."
    3. Re:another article by the same guy by phantomfive · · Score: 1
      --
      "First they came for the slanderers and i said nothing."
    4. Re:another article by the same guy by K.+S.+Kyosuke · · Score: 1
      Yes, he defined it as:

      "OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them."

      It's a googleable quote.

      --
      Ezekiel 23:20
    5. Re:another article by the same guy by phantomfive · · Score: 1

      That's how he described it once, but that's not how he defines it (and you know it). He seems to think of OOP as a concept of communicating between cells, more than a list of features.

      --
      "First they came for the slanderers and i said nothing."
  15. Analogy by WillKemp · · Score: 1

    One of the worst things about OOP is the stupid analogies used to explain it. If the people you're explaining it to can't understand it in abstract, programming terms then they're not worth wasting your time on because they'll be useless programmers anyway. But, of course, it's probably not the audience that's the problem, but the writer - who's incapable of communicating without resorting to stupid analogies.

    1. Re:Analogy by Anonymous Coward · · Score: 0

      Yep, the stupid ones are very irritating. Like most people I prefer insightful analogies.

  16. Functional as in C by mrflash818 · · Score: 0

    Yeah, probably true.

    I _meant_ function-al programming, .like as in using functions in C, as opposed to OO.

    --
    Uh, Linux geek since 1999.
    1. Re:Functional as in C by Pinhedd · · Score: 1

      C is a procedural programming language (and a member of the imperative paradigm). The programmer writes statements and flow control that describe changes in state and the compiler translates this into equivalent machine code. Imperative languages do not care what the programmer wants the program or procedure to do, just what the programmer tells the program or procedure to do. Imperative programming is all about describing how to do something without describing what the desired result is. Classic example: C.

      Functional programming languages (members of the declarative paradigm) are an entirely different beast. In functional languages, the programmer describes the program using some sort of logic without specifying implementation. Functional programming is all about describing what to do without describing how to do it. In functional programming, the compiler, interpreter, or parser evaluates the logic and figures out how to arrive at the what on its own. Classic example: SQL.

      Some languages, especially those used for safety critical applications, support elements of both imperative and declarative programming. A programmer may write a program imperatively which describes how to do something, and then attach formal logic in the form of descriptors, preconditions, and postconditions that can be used by the compiler or interpreter to ensure that the program code does not only what it is written to do, but what it is formally intended to do. This kind of programming takes a very, very long time to do but it will be damn near bulletproof when done properly.

    2. Re:Functional as in C by angel'o'sphere · · Score: 1

      Functional programming languages are usually not declarative. They are as imperative as any procedural ones.

      Your whole paragraph about functional languages is wrong, simply replace 'functional' with 'declarative' there.

      A functional language is a language where functions are 'first class citizens'. As in an OO language objects are 'first class citizens'. That means functions can return functions as results and accept parameters that are functions.
      E.g. this is a function that accepts to functions and returns as result a function that adds its two arguments: fun composeAdd(fun f(x), fun g(x)) { return f + g }
      Note: composeAdd accepts two functions, called f and g. Those functions have one argument each. The result is not the sum of f(x) and g(x) as you see the arguments x are not used inside of the braces but a new function that takes two arguments and will call f and g and will finally add the results of those calls.

      This kind of programming takes a very, very long time to do but it will be damn near bulletproof when done properly. That is nonsense. It is just as fast as proper written imperative code that checks its preconditions and throws exceptions if they are not meat. Or do you mean the programming itself? Using pre and post conditions in languages that support it (or annotation based libraries in Java/Groovy) is an extreme quick way of coding!

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:Functional as in C by Great+Big+Bird · · Score: 1

      I believe you want this: https://en.wikipedia.org/wiki/...

  17. Calling poor code organization OOP is flawed by RhettR · · Score: 4, Interesting

    Dijkstra makes an argument about what he calls object oriented programming, but doesn't really use OOP. That he happens to base his argument around two styles of coding, one that is clearly procedural, and one that happens to use objects, is merely accidental. His argument is centered around poor code organization, plain and simple. He passingly slaps down some code modeling Student as an object, neglecting to mention anything about why one would do that (e.g. encapsulation), and completely fails to even mention other OOP ideas such as composition, inheritance, polymorphism, etc. In short, he bashes horrendous code organization, and calls that OOP, without addressing a single reason typically given in favor of OOP. Frankly, that article was awful.

    1. Re:Calling poor code organization OOP is flawed by gnasher719 · · Score: 4, Insightful

      Just saying: It's not Dijkstra talking rubbish. Dijkstra is died 12 years ago. There is a handwritten article by Dijkstra which probably made sense in 1983 when it was written. In 1983 Dijkstra didn't know about C++. Stroustroup didn't know about C++ in 1983.

    2. Re:Calling poor code organization OOP is flawed by RhettR · · Score: 1

      Quite right you are. I read the summary too quickly and authored my reply hastily. s/Dijkstra/The author/.

    3. Re:Calling poor code organization OOP is flawed by ChunderDownunder · · Score: 1

      C++ is a horrible language. It's made more horrible by the fact that a lot
      of substandard programmers use it, to the point where it's much much
      easier to generate total and utter crap with it. Quite frankly, even if
      the choice of C were to do *nothing* but keep the C++ programmers out,
      that in itself would be a huge reason to use C.

      Linus. :)

    4. Re:Calling poor code organization OOP is flawed by serviscope_minor · · Score: 1

      Excape that quote is completely full of logical fallacies and blatant revisionism.

      --
      SJW n. One who posts facts.
  18. Object Oriented sex by david.emery · · Score: 1

    self.fuck

    1. Re:Object Oriented sex by Anonymous Coward · · Score: 0

      I prefer self.fuck(hot_chick)

  19. Spaghetti model by Anonymous Coward · · Score: 0

    After working with decades of procedural software apparently modeled after spaghetti, I think object oriented models are a bit better.

  20. disingenuous by Anonymous Coward · · Score: 0

    His argument against anthropomorphism assumes that the person writing the code actually believes that their code magically acquires the qualities of a full blown human being with a consciousness. I'd wager that anyone that stupid (insane?) wouldn't be able to write computer programs that execute, let alone work as a programmer.

    disingenuous clickbait in my book.

    1. Re:disingenuous by Anonymous Coward · · Score: 0

      Not to mention half the people in these comments seem to think the article was actually written by Dijkstra and not some random blog guy....definitely disingenuous clickbait.

  21. The limits of Dijkstra by anchovy_chekov · · Score: 3, Insightful

    I think what this article highlights is that not everything Dijkstra said was gold. Nor does slavishly following his missives make you a better programmer.

    1. Re:The limits of Dijkstra by Anonymous Coward · · Score: 0

      TFA's Author is not Dijkstra.

      And it's certainly rubbish (and some of his other articles on that site similarly so).

      If I had to guess, I'd say bright, idealistic, college student (maybe a grad student), who's never seen there real world.

    2. Re:The limits of Dijkstra by anchovy_chekov · · Score: 1

      I think we're in total agreement here. I did read the article - and others on the same site - and know only the quote was from Dijkstra. My beef is that adherents of Dijkstra's teachings tout this nonsense all the time, but I guess it's not surprising considering Dijkstra was primarily an academic (though a thoroughly brilliant one).

      I was going to go off on a huge rant about this, but I think you've summed it up. Thanks.

    3. Re:The limits of Dijkstra by Anonymous Coward · · Score: 0

      Nor does being a mindless iconoclast make you smart. Most people say shit like this because they fail to understand why goto is considered harmful, and want to justify their own use of it rather than learn something. That they'd rather trash-talk one of the smartest computer scientists in history than learn from him is fairly pitiful, let's face it.

    4. Re:The limits of Dijkstra by anchovy_chekov · · Score: 1

      Not always AC. Some people have actually read Dijkstra, consider him an extremely important contributor to computer science and yet have the capacity to not agree 100% with everything he said. Case in point, his comments about object oriented programming paint him as a man of his times:

      "I don't think object-oriented programming is a structuring paradigm that meets my standards of elegance" (http://www.cs.utexas.edu/users/EWD/transcriptions/EWD12xx/EWD1284.html)

      Let's not forget that Dijkstra was primarily an academic. His search for purity is admirable, but if we all followed his criteria for elegant solutions we'd never get any work done.

      Whatever the case, it's the 'X considered harmful' pattern that really diminishes his work. People thrash out blog posts along these lines - including the author of the original article - as if by association their work takes on more authority. The world doesn't need any more of these academic puff pieces.

  22. stupid by Tom · · Score: 4, Insightful

    One of the more stupid blog-level postings I've read. I use "blog-level" as an insult, btw. because blogs are generally a source of shallow thinking, because it just is too convenient to publish some thoughts. When it is more trouble, you're also forced to polish them more.

    Firstly, to understand the difference between trying to do and "trying to do", read some Dennett. If correctly understood, anthropomorphisms like the attribution of intention to a non-intentional entity can be extremely helpful.

    Secondly, not even his example is anywhere near what he's trying to explain. Yes, the analogy breaks down but it has nothing to do with the convulted reasoning he's applying. The cause for the analogy to break down is that there's no equivalent to walking to the classroom in his example. All of his code simply assigns a classroom number, without any equivalent of the walking part. As soon as you add that - magic ! - the analogy works again.

    --
    Assorted stuff I do sometimes: Lemuria.org
    1. Re:stupid by reve_etrange · · Score: 1

      Firstly, to understand the difference between trying to do and "trying to do", read some Dennett. If correctly understood, anthropomorphisms like the attribution of intention to a non-intentional entity can be extremely helpful.

      I have been saying something very similar in other comments here (and linking pages for intentionality and the intentional stance). I'm sure if Dijkstra or Vaillant were more familiar with the philosophy of mind, they would end up making this kind of distinction instead of just proscribing what they call "anthropomorphizing."

      I do think, however, that the intentional stance doesn't necessarily imply anthropomorphization. Programs in particular are designed towards specific ends and we can talk about how they represent facets of those ends without imputing to them human characteristics. I would cite any self-documenting code conventions (even as simple as a "speed" variable) as examples.

      The cause for the analogy to break down is that there's no equivalent to walking to the classroom in his example. All of his code simply assigns a classroom number, without any equivalent of the walking part. As soon as you add that - magic ! - the analogy works again.

      Dennett-style reasoning - I like it!

      --
      .: Semper Absurda :.
    2. Re:stupid by Tom · · Score: 1

      Yes, Dennett is brilliant because contrary to too many modern philosophers he actually has quite a broad non-philosophical knowledge and understanding. I've read Popper and wanted to vomit, for example.

      --
      Assorted stuff I do sometimes: Lemuria.org
    3. Re:stupid by ultranova · · Score: 1

      I use "blog-level" as an insult, btw. because blogs are generally a source of shallow thinking, because it just is too convenient to publish some thoughts.

      That's some cutting and well-backed reasoning you have there, bro. Have you thought about writing a blog about it?

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    4. Re:stupid by Tom · · Score: 1

      I am actually writing a blog, which I will not link here, where I try to be better than the usual crap. And there are some very good blogs out there. The majority, however, are basically stream-of-consciousness of some dude on some topic.

      --
      Assorted stuff I do sometimes: Lemuria.org
    5. Re:stupid by Anonymous Coward · · Score: 0

      Yeah, I hate all the mindless drivel from the Homotopy Type Theory blog these days.

    6. Re:stupid by reve_etrange · · Score: 1

      That reminds me of a story from my philosophy of science professor (I studied biochemistry but branched out in college).

      After giving lectures/presentations, scientists would ask about practices in their work which resembled induction, to try to understand how these practices should be approached philosophically, but Popper would just respond with "it's not science" or "it's not my fault you're a bad scientist."

      --
      .: Semper Absurda :.
  23. What about AI? by Irate+Engineer · · Score: 1

    The insensitive clod who wrote this is clearly not working in AI.

    --

    Left MS Windows for Linux Mint and never looked back!

    Vote for Bernie in 2016!

  24. Humans do not communicate formally by thomasoa · · Score: 1

    Often "the code is trying to..." is just shorthand for "the person(s) who coded this had the code to do...." It is always risky to speak informally about a formal system, but it is also a risk to be too formal - humans have a much harder time following formal language. The formal language, indeed, *is* the code, and the reason we don't just talk in code is that our brains are not wired that way.

  25. Irrational people, irrational results by Anonymous Coward · · Score: 0

    When you have an influx of "developers" who also believe in elephant-gods and other various cloud-sitters, it's not hard to see why "computer science" in general has become irrational.

  26. 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.

    3. Re:Toaster DRM by Anonymous Coward · · Score: 0

      You shouldn't put fruit in your toaster.

    4. Re:Toaster DRM by Anonymous Coward · · Score: 0

      I think that's called a wrapper.

  27. the killing fields by Anonymous Coward · · Score: 1

    Everywhere there was death as my process exited. So many destructors got called as objects self immolated, returning the souls of their allocations to the heveanly heap...

  28. Re:Degenerate by ArcadeMan · · Score: 0

    Felicia disagrees with you.

  29. This is why I like Python so I can use OOP or not by caseih · · Score: 4, Interesting

    This is why I like Python. Python allows object-oriented programming styles or procedural, or a mix. Python has a lot of warts, but it's really refreshing to me to use. Every time I look at Java, I'm turned off by the forcing of class-based object-oriented programming for everything, even when the program is really just procedural with a static main. Perhaps this tends to make programmers try to shoehorn OOP when it's not the best fit.

  30. while antropormophisation is bad by Anonymous Coward · · Score: 0

    the OO way can be parallelized in a much more reader friendly way than the procedural one:

    List group1=fetchGroup(1);
    group1.parallelStream().forEach(Student::moveToRoom(2));

    Even if this is a java-ism, the same things could be expressed in an even more concise fashion in C++ using Concurrency::parallel_for, now try do that in c99 while being as readable

  31. This is exactly what OO solves... by Anonymous Coward · · Score: 0

    The procedural code would not have been able to "know" when the bread is toast, it would just cook something for X seconds at T temp.

    This is exactly what OO solves.

    (but I still lol'd at the joke)

    1. Re:This is exactly what OO solves... by rubycodez · · Score: 2

      nonsense, procedural code cooks until the toasted flag is true.

    2. Re:This is exactly what OO solves... by ultranova · · Score: 1

      nonsense, procedural code cooks until the toasted flag is true.

      An OpenCL-accelerated toaster toasts the same bagel a million times with slightly different heat profiles and picks the best result.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    3. Re:This is exactly what OO solves... by rubycodez · · Score: 1

      I get the same good results 90% of time with fuzzy toast logic

    4. Re:This is exactly what OO solves... by Chris+Mattern · · Score: 1

      If you have fuzzy toast, you probably should've thrown the bread out.

    5. Re:This is exactly what OO solves... by cwsumner · · Score: 1

      If you have fuzzy toast, you probably should've thrown the bread out.

      I just spilled my coffee! 8-o
      What ever happened to using "coffee warning"?

  32. Balance by Tablizer · · Score: 3, Insightful

    OOP is a tool, and like any tool it has places and times where it is useful, and places and times where it is not. Knowing when to use it and when not to is part of the art and craft of programming. Does OOP improve the overall organization, reading, and flexibility of a given portion of software to change? If you don't have a good answer, then consider skipping it.

    All-or-nothing zealots are usually full of squishy stuff. In the past, one was told to model all domain nouns as objects and/or classes (depending on language flavor). That doesn't always work well, especially if a database is being used. Domain nouns are often poor candidates for OO-ness. Objects seem better suited, however, for computing-domain nouns, such as GUI's, report columns, files, sockets, security profiles, etc. That's my experience.

    (However, lately GUI's seem to have outgrown OOP, as multi-factor and situational grouping and searching becomes more important for managing mass attributes and event handlers, and I'd like to see research in database-driven GUI engines, perhaps with "dynamic" relational or the like.)

  33. That's not even why OOP was created... by Goldfish1974 · · Score: 0

    If someone would spend a little time and look at the history of programming languages, then they'd quickly realise that OOP wasn't about Anthropomorphism, polymorphism, or any other 'isms. OOP came about for the simple reason of maintainability! If you look at the history of programing languages, then you'll find that new programming paradigms appeared when programming maintainability suffered. Assembly gave way to high level procedural/functional languages, which gave way to OO languages, which gave way to "Interface" abstractions and now we are moving into the Message Passing type paradigm as a result of needing to build massive scale. (I read somewhere way way WAY back that effective maintainability for procedural languages maxes out at about 5M likes of code, OOP was about 50M lines max, whilst Interface oriented methodologies was somewhere above 50M...although that was based on the fact that you could organise you code better by not having to have libraries derive from ACMEObject, although these those base classes form the runtime type info/serialisation/etc. within language BCLs, whereas the BLCs generally are organised around multiple, unrelated trees of objects these days). Whilst many of the concepts are not new (e.g. functional languages are fairly old), it has taken time for languages to integrate those concepts into base languages...some of the more recent languages incorporate these concepts...some are bolted on as libraries. One interesting aspect to the whole history is that whilst functional languages existed very early one (I heard hat a functional language was the second high level language after FORTRAN...possibly wrong...but early...non the less), functional languages don't see to suffer as much from the whole saleability issues...probably a result being more expressive, and being able to represent the target program state using less types/objects. There's a lot to learn about software...just take a look at the history, and you'll be a better developer for it.

    1. Re:That's not even why OOP was created... by Tablizer · · Score: 1

      Actually, OOP came about in physical modelling applications via the Simula programming language for companies that modeled things like trains and shipping ports in terms of distributing goods. In that sense, it was a form of anthropomorphism in that each physical object knew how to "handle itself". Whether that idea is always good outside of physical modelling apps is another matter.

    2. Re:That's not even why OOP was created... by phantomfive · · Score: 1

      You need to look at the history of programming languages yourself, I'm not sure where you got that information, but it's all jumbled. For example, the message passing paradigm was in the language where "Object Oriented programming" was coined. There is a lot of good stuff Here.

      --
      "First they came for the slanderers and i said nothing."
    3. Re:That's not even why OOP was created... by angel'o'sphere · · Score: 1

      Actually there is a series of books called HOPL I - HOPL III.

      Surprisingly HOPL stands for 'History of Programming Languages'.

      I suggest you read them. They consist of small 'articles' of about 5 to 10 pages about programming languages and when and why they where invented by whom and where etc.

      You can easy read such an article in 20 mins before you go to bed or a few of them in a train etc.

      They are an interesting read and they certainly would help you preventing to make an idiot out of yourself.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    4. Re:That's not even why OOP was created... by reve_etrange · · Score: 1

      In that sense, it was a form of anthropomorphism

      I wouldn't call it that, since there isn't any necessary imputation of human characteristics to the objects. Instead, it's to do with intentionality. Whether I have a variable called "train_speed" or a "train" object with a "speed" member, the key thing is that these data are "about" achieving a particular purpose. I think TFA (and Dijkstra's piece) could have been much more insightful if the authors were familiar with a few ideas from philosophy of mind.

      As you point out, things are more clear for physical modelling than other domains because no one is going to argue that trains don't have speeds.

      --
      .: Semper Absurda :.
  34. Re:This is why I like Python so I can use OOP or n by Anonymous Coward · · Score: 0

    That's why I love Apple's Swift, it's multiparadigmatic and can be procedural, OO or functional.

  35. Anthropomorphism very useful, when used correctly by SuperKendall · · Score: 2

    A dash of anthropomorphism is actually quite helpful to a programmer - the trick is that people are just not applying it in quite the right way; instead of considering a program or objects as a rational kind of being that does what you tell it, instead consider that code and objects are all malevolent entities that exist only to twist what you tell them to do into the most horrific possible result.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  36. Re:Degenerate by readin · · Score: 2

    Anthropomorphism is degenerate no matter the situation.

    True. Anthropomorphism is always trying to get into trouble and ruin other people's lives.

    --
    I often don't like the choices people make, but I like the fact that people make choices. That's why I'm a conservative.
  37. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  38. Yes, stop anthropomorphizing animals! by Anonymous Coward · · Score: 0

    They don't really "know" or "think". It might look to some amateurs like apes (especially "homo sapiens") do that, but that's only because they are programmed to pretend to be thinking and knowing and in the end it's just a really complicated neuronal network that results in the "behaviour" you're observing. Basically it's all just a chemical reaction meant to make copies of chromosomes. If people wouldn't anthropomorphize everything, we would probably have found a more efficient way to produce chromosomes without the need for complex life decades ago!

  39. Do anthromorphise! by dwheeler · · Score: 3, Insightful

    Don’t anthropomorphize computers, they hate that notes that most developers do use anthropomorphic language. I think there are probably a variety of good reasons for it, too. Here's one speculation: When we communicate with a human, we must use some language that will be more-or-less understood by the other human. Over the years people have developed a variety of human languages that do this pretty well (again, more-or-less). Human languages were not particularly designed to deal with computers, but languages have been honed over long periods of time to discuss human behaviors and their mental states (thoughts, beliefs, goals, and so on). In any case, the problem isn't anthropomorphic language, it's the use of a bad analogy.

    --
    - David A. Wheeler (see my Secure Programming HOWTO)
    1. Re:Do anthromorphise! by reve_etrange · · Score: 1

      I think there are probably a variety of good reasons for it, too. Here's one speculation: When we communicate with a human, we must use some language that will be more-or-less understood by the other human.

      That is a good reason, but IMHO the reason for the origin of the "intentional stance" is that it's simply the most parsimonious way to approach survival in a dangerous environment.

      --
      .: Semper Absurda :.
  40. Stupidly bad example. by jklovanc · · Score: 1

    First I would like to point out that OO and procedural are not so much different. The main difference is that in OO the procedure run is governed implicitly by the class the call is made on and not explicitly by the code that makes the call. Saying OO vs procedural is a false dichotomy. I will refer to "procedural" as non-OO

    The example in the blog is overly simplistic and does not show the strengths of OO. It use OO where it is not needed. Here are some issues with the OO implementation;
    1. Too few classes. What about teachers.
    2. Class specific method; "move_students_to_classrooms" should not be a method it should be "move_people_to_classroom"

    By adding teachers, teaching assistants, etc as classes that can all be told to "move" and do what each different class needs to do.
    Try the following;
    Class: Person
          Abstract method move(cl)
    Class: Student extends Person
        Method move(cl){
              Select desk;
              remember cl
        }
    Class: Teacher extends Person
    Method move(cl){
              Count students;
              Write name on board;
              remember cl;
              etc.
        }
    Class Principal extends Teacher
        Method move(cl){
              Super(cl)
              Inform secretary;
        }
        Method move_people_to_classroom(List people){
                    for_each (person in people)
                    {
                            Classroom* cl = reg[student.name()];
                            person.move(cl);
                    }
            }
    Notice in this example the Principal would be doing the same thing in the classroom as a teacher plus a bit more.
    In this example the the method move_people_to_classroom does not care what sub type of person is in the list it just tells them to move to the classroom. In the non-OO method one line of code "person.move(cl) would be replaced by something like the following;

    Person_type = getType(person);
    switch(person_type)(
        case "Student":
            move_student(student, cl);
            break;
    case "Teacher":
            move_teacher(student, cl);
            break;
    case "Principal":
            move_teacher(student, cl);
            break;
    default:
    }
    Now what happens if a new class of Person gets added and they do something different when they move to the classroom. One would have to remember this code and update it. In the OO implementation the code would be in the new class and much more obvious as the 'move' method is not implemented so the code would not compile. The beauty of OO is the ability ignorant of the type of person, give them the same command and have them do different things.

    1. Re:Stupidly bad example. by Tablizer · · Score: 1

      "Types" of people is often ill-suited for the real world. Semi-independent attributes are often a better fit. A teacher in one classroom may be a student in another, for example (especially in college).

      If managers get privileged parking, for instance, and you hard-wire privileged parking to managers, what happens if due to a decree, instead of bonuses, employees get privileged parking for a month or so? The software may be more flexible if privileged parking is an attribute of "person" rather than part of a "manager" subclass.

      Excess use of hierarchical sub-classing can create maintenance headaches. Early OOP educators got "taxonomy happy" in my opinion. The real world often does not change in a hierarchical way (at least not the one I work in).

    2. Re:Stupidly bad example. by jklovanc · · Score: 1

      A teacher in one classroom may be a student in another, for example (especially in college).

      Then make Teacher a subclass of student. When the class list, no pun intended, is made the grad student who is taking the course would be instantiated as a Student rather than a Teacher. Problem solved. This would also allow a Principal to take a course. This shows another aspect of OO in that a Person can do completely different things depending on how they are instantiated.

      you hard-wire privileged parking to managers,

      Hard wiring anything make things less flexible.

      The software may be more flexible if privileged parking is an attribute of "person" rather than part of a "manager" subclass.

      "Parking" is an attribute of Person. No mater what class there needs to be a method to ask what kind of parking the person gets. In this case the Manager class would always return "privileged" when asked about parking and the Employee class would return "privileged" if the current date is within the privilege period. This could be done even if Manager was a subclass of Employee.

      Excess use of hierarchical sub-classing can create maintenance headaches.

      Excess use of anything creates maintenance headaches. It is all about balance. In many real word instance two levels of classes is sufficient.

      The real world often does not change in a hierarchical way

      True, but it sometimes does.

    3. Re:Stupidly bad example. by Tablizer · · Score: 1

      Then make Teacher a subclass of student.

      I find that silly and unnatural. I suppose if you always do it that way, then perhaps you get used to it, but the same can be said about Go To's.

      This could be done even if Manager was a subclass of Employee.

      True, but it doesn't get us anything. One could argue the determination of parking activity should be calculated in one place rather than scattered about different subclasses.

      The real world often does not change in a hierarchical way

      True, but it sometimes does.

      But the non-fits can make a code mess. I've found variations on Set Theory more flexible than classification hierarchies. OOP tends to push one toward hierarchies.

    4. Re:Stupidly bad example. by angel'o'sphere · · Score: 1

      It is completely wrong to use subclassing for that purpose.

      There are just Persons in the College, and they have multiple Roles, as e.g. teacher or as student or as tutor or as member of a sports team.

      Silly examples like that in the article and then talking about how silly it is only lead to even more silly code/examples.

      As a general rule in OO: as soon as you model people, places and events THEN inheritance between them is ALWAYS wrong.

      Note: people change roles ... how do you model the fact that I'm a student now and no teacher and that I will be a teacher tomorrow and no student and that in the end of the studies I will be both with inheritance?

      Perhaps you should get rid of the anthropomorphic terms used in OO? Don't call it inheritance, call it specialization. Obviously a teacher is not a special student. Nor the opposite around. Why should any of both inherit from the other or be a specialization of the other or be a subclass of the other?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    5. Re:Stupidly bad example. by jklovanc · · Score: 1

      I find that silly and unnatural.

      Those are value judgement. Back them up with reasons.

      The hierarchy works in that everyone should be able to take classes so everyone is a Student. A subset of those Students can also teach classes therefore Teacher is a subclass of Student. A subset of those Teachers is the Principal with the ability to assign classes therefore Principal is a subclass of Teacher.

      same can be said about Go To's.

      Sorry but this is very different than goto's. Goto's are a hack to get around poorly designed code.

      True, but it doesn't get us anything.

      Both Managers and Employees have vacation days. Keeping track of those days can be coded in the Employee class and the Manager class just inherits the code.

      One could argue the determination of parking activity should be calculated in one place rather than scattered about different subclasses.

      One of the features of OO is the ability to "scatter code". It creates smaller code files with fewer control structure to parse through to figure out what is going on. By having the code in the subclass and looking up the method you get only the code related to that subclass. You are not looking at one monolithic file and trying to figure out what code pertains to the class you are dealing with. It is very easy to get confused and change the wrong code. It took me a while to wrap my head around this code scattering but it makes sense if you can think hierarchically.

      How would you put that code in one place? The only way I can see would be a switch statement in the base class based on the type of person. To me that is no longer OO as it breaks compartmentalization. Adding a new subclass should not effect the code in any superclass. If it effects the superclass then I have to test the superclass and everything that uses that superclass. It is much less work to create a subclass and I only need to test the new code that is in the subclass.

      I've found variations on Set Theory more flexible than classification hierarchies.

      Classification hierarchies are a variation on set theory when each subclass encompasses a subset of the superclass. Look at how I used subsets to explain the Student>Teacher>Principal hierarchy.

      OOP tends to push one toward hierarchies.

      It is up to the programmer, not the language, when to use OO concepts and when not to. One can write non OO code using OO languages. Remember OO means Object Oriented and not Object Obligated. When OO concepts are applicable use them; when they are not don't.

      All class hierarchies are deep. Sometime there are many subclasses of a single superclass. For example, I am writing a system that uses several different payment portals. These payment portals require different protocols and parameters to operate. I will create one base class that contains the methods, such as "submit_invoice" and "refund", needed to complete transactions. For each different payment gateway I will create a subclass of that base class. Even though there are many subclasses they all have only one superclass. This is a very shallow heirarchy. The beauty of this is that I can add new gateways without touching or testing the old gateways.

    6. Re:Stupidly bad example. by jklovanc · · Score: 1

      how do you model the fact that I'm a student now and no teacher

      For a given id allow instantiation as a Student class but not a teacher

      and that I will be a teacher tomorrow and no student

      Allow instatiation as a Teacher. The ability to be a Student is still there but not used.

      and that in the end of the studies I will be both with inheritance?

      Nothing changes in code just start using Student methods again.

      Obviously a teacher is not a special student.

      In this case a teacher is a student who can also teach. This is an artifact of the restriction of an object having only one class and inheriting from superclasses.

    7. Re:Stupidly bad example. by angel'o'sphere · · Score: 1

      As I said: this approach is WRONG.

      No idea why you try to rescue it by making it even worth!

      What has the id and the instantiation to do with it? Nothing obviously!

      Now you are even mixing ids from the database with the idea to instantiate it with different classes. So who knows which id belongs to which class? And again: how do you manage 'class changes'?

      What is so difficult to grasp that you only need one damn Person class that has a list of Roles? So the Person can be a Student, a Teacher and a Manager in its start up without any instantiation or inheritance problems (at the same time even) and can change Roles or add and lose Roles?
      Why do you insist your approach (which is retarded) is working? It is not ... and if you manage to get it working in a small world example it blows into your face as soon as you get the requirements for your further development for the next 3 years.

      Anyway, good luck!

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    8. Re:Stupidly bad example. by Shados · · Score: 1

      Thats just moving things around. At one point in your program, you'll have to pick which class to instantiate, probably from a Person factory of some kind, that will create a new Student, Teacher or Principal. This may be abstracted away with some magic in the ORM that is loading it from your database, it may be a factory you wrote yourself, but that "switch" will exist somewhere. Maybe you're going to use some kind of reflection to do it without a switch, maybe you'll have a lookup table of types, but somewhere that decision has to be made.

      Now, if that decision is made somewhere, the same place could configure the behaviors by composition. So you could, at that point, simply have Persons, and have a constructor or setter method that take a move strategy as an argument and saved as a private member. Then the move method would simply invoke it.

      This way, a Person can move in any way they need to, without any tight coupling. Here you only have "move", but there could be countless of things people can do, and putting them in distinct buckets falls apart once your system gets any kind of reasonable complexity.

      That is when you see insane inheritance hierarchy that get refactored every other day because people forgot that transfer students and transfer teachers have things in common but someone made them inherit from student instead of a class between person and teacher/student.

      Composition, mixin, strategies, and other loose coupling patterns that don't associate actions with "is a" relationships are so, so much more flexible for systems you have to maintain for a significant amount of time... Its kind of ironic that out of all languages, Javascript got it right, and did so by accident.

    9. Re:Stupidly bad example. by Tablizer · · Score: 1

      Back them up with reasons.

      I did. By "unnatural", I mean it's not a hierarchy that exists in the "real world". Teachers are not a sub-set of student. They are generally independent traits.

      Technically you may be able to get away with modeling a "car" as a big roller-skate with passengers instead of feet inside, but it would probably confuse the daylights out of your replacement.

      Goto's are a hack to get around poorly designed code.

      I don't know what you mean. Goto's (usually) make for poorly designed code.

      Classification hierarchies are a variation on set theory...

      A more limited variation. Outside of biology, the real world tends to change and vary in a set-oriented way, NOT a tree-oriented way; and thus sets are a better fit.

      It creates smaller code files with fewer control structure to parse through to figure out what is going on.

      No it doesn't. Perhaps in C-based languages it does because C has a crappy Switch statement, but that's a language flaw, not a paradigm flaw. The total number of dispatching-related "decision blocks" is nearly identical. I've done the counts before.

      I've experimented with different ways to manage variations-on-a-theme, and sub-classing is usually not the best way, at least for how my brain processes code. Perhaps you found a way to simplify code testing using hierarchies, but there is more to code management than just testing. I don't want tangled subclasses JUST to simplify testing.

    10. Re:Stupidly bad example. by jklovanc · · Score: 1

      Now you are even mixing ids from the database with the idea to instantiate it with different classes.

      That is how it is done. You call a factory that creates a Person class. The actual class returned can be any subclass of person. Which class is actually created is dependent on the stored data.

      So who knows which id belongs to which class?

      By how the data is stored.

      And again: how do you manage 'class changes'?

      By changing the data.

      Person class that has a list of Roles?

      How about if you look at roles as classes.

      So the Person can be a Student, a Teacher and a Manager in its start up without any instantiation or inheritance problems

      You just trade those problems for method selection issues down the road. Every time you call a method it has to check what Role the person has and then call the correct method. Using the class way you just call the method and the class figures out which routine to call.

      One of the reasons to have different classes is that different roles have different data connected to them. Every person has demographic data. Every student has a GPA. Every teacher has teacher certificate number Every principal has an assigned school. Now you could put all that data in one class and never use the fields that do not apply but that is very inefficient.

    11. Re:Stupidly bad example. by angel'o'sphere · · Score: 1

      Ofc Roles are classes.

      Your proposal does not work.

      To change a Persons role you have to do in your proposal this: get rid of the Person in memory. Change the data (I assume with that you mean: change the databse), read the data back again. And now you have what YOU want, but not what ANYBODY ELSE wants. You have a new object belonging to a different class in memory.

      And all other objects that referenced the original object now need to be updated ... why would anyone in his sane mind do such nonsense?

      As I already said: modeling real persons as inheritance hierarchies is wrong, it is wrong in any system, regardless what the system does.

      Abusing factories to instantiate the correct subclass clearly shows your experience in OO is just at the beginning.

      I suggest you get someone who mentors you in case you have to design larger systems.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  41. Less accurate statement by SuperKendall · · Score: 4, Insightful

    "The program doesn't know to check for" is in fact more accurate than "The program wasn't designed to check for". The second statement could mean that it wasn't designed to do something, but might do it anyway - what the program ACTUALLY does is left somewhat ambiguous (this is a technique lawyers will often use answering in court). In the first instance the statement makes it quite clear the program DOES NOT KNOW HOW to do what you are talking about.

    You can shorten something so far for clarity, but if you go to far you end up with less clarity.

    The "thinks" part at the end could go though, removing that does no harm to clarity.

    The thing is, writing clearly is just plain hard - being able to use anthropomorphic kinds of terms helps make it simpler to add clarity to description at the cost of somewhat wordier sentences... kind of like how sometimes you make a program a little more verbose so that a different programmer coming across the code later can understand it.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Less accurate statement by BarbaraHudson · · Score: 2

      Or even simpler (and closer to the truth) "We screwed up. We didn't code a check for the start date."

      No passing the blame off to some imaginary "bug".

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    2. Re: Less accurate statement by ShieldW0lf · · Score: 2

      It's either a feature or a bug.

      I understand what you are saying, but language that makes the computer sound like an out of control actor makes me sound like I'm not in control of my job and my dog ate my homework, so I make an effort not to use it. I think it makes me look less professional. Language that involves me saying things like "I designed it that way for these justified reasons, but we can discuss changing it", or "I'm not sure why it's responding this way, but it's my screw up and these are the resources I need to try and fix it and this is my confidence that I will succeed, do you want me to try." project a better image.

      --
      -1 Uncomfortable Truth
    3. Re: Less accurate statement by SuperKendall · · Score: 3, Interesting

      language that makes the computer sound like an out of control actor... describes most accurately what is really going on. You sent the slinky down the stairs but it veered sideways and hit a wall.

      A program is basically a state machine, a very complex one - we start it and watch what happens, but with a complex enough state machine it is basically indistinguishable from watching a video feed of a person robbing a convenience store. You can describe later on what went wrong quite well, but at the time the result is unexpected.

      To be the description of something as a "bug" is leaning more towards papering over flaws; just admit we build systems and almost never have a 100% understanding of what they will do in operation. That is far more truthful than saying there is *A* bug rather than the program is a series of statements that may do what we intend, but may not.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    4. Re: Less accurate statement by ShieldW0lf · · Score: 1

      No, its a system I built to fix a problem, and if it's not working precisely like it does in my minds eye, then it's wrong because I made a mistake, and I'm ok admitting that.

      --
      -1 Uncomfortable Truth
    5. Re: Less accurate statement by SuperKendall · · Score: 1

      No, its a system I built to fix a problem, and if it's not working precisely like it does in my minds eye, then it's wrong because I made a mistake, and I'm ok admitting that.

      "The program has a bug" indicates the program is flawed, not you.

      I'm more than OK admitting I made a mistake, I prefer it.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    6. Re:Less accurate statement by grep+-v+'.*'+* · · Score: 1

      You can shorten something so far for clarity, but if you go to far you end up with less clarity.

      I see what you did there!!

      ... I only wish it had been intentional.

      how sometimes you make a program a little more verbose so that a different programmer coming across the code later can understand it.

      Oh, like comments? You can write insanely complicated code and as long as it produces the results you had intended, it's correct. But it helps the programmer behind you if you then also write "War and Peace" describing how it works. "It's Magic" is too short.

      --
      If the universe is someone's simulation -- does that mean the stars are just stuck pixels?
    7. Re:Less accurate statement by SuperKendall · · Score: 1

      I only wish it had been intentional.

      You aren't going to get anywhere in life if grammar issues bother you to the extent you feel compelled to comment on them.

      You can write insanely complicated code and as long as it produces the results you had intended, it's correct

      So cute that you think you can ever know with certainty that something is not only correct now, but will always bee.

      Oh, like comments?

      All experienced programmers know to regard the comments with at the very least, mild suspicion.

      For one thing, the comments described what the person who wrote the comments THOUGHT they were doing. Code is often buggy, so paying attention to the comments can mislead you right from the outset.

      But then of course, over time often code gets altered and comments do not, so they become even MORE misleading...

      Which is why it's really best if you write code in such a way that it's clear enough to follow, so what the program actually does is its own form of clearly written comment.

      There are times and places for tricky code when performance is essential, but they are few and far between and you had better damn well be sure there's a reason way better than it makes you feel clever. Otherwise you are screwing the next guy, and over time you will find YOU become the next guy - even if in cases as simple as you revisiting your own code a year later!

      If you can't be kind for other people, at the very least be kind to your future self who REALLY didn't want to be looking at this code right now.

      But it helps the programmer behind you if you then also write "War and Peace" describing how it works.

      The longer the comment is, the worse it is for knowing what is actually happening. That's a rule of thumb that happens to ALWAYS be true. Writing long comments does not help, good clear code helps.

      That's enough time spent educating you I think, feel free to respond but I have better things to do and my position here is clear.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    8. Re:Less accurate statement by ljw1004 · · Score: 1

      "The program doesn't know to check for"

      "The program wasn't designed to check for"

      In the first instance the statement makes it quite clear the program DOES NOT KNOW HOW to do what you are talking about.

      You can shorten something so far for clarity, but if you go to far you end up with less clarity

      "The program doesn't check for"

      In this case, like all others in this thread, the non-anthropomorphic version is shorter, more correct, and less misleading. What on earth does it mean for the program to "know" something? Is there a knowledgebase in the program? What is the difference between "the program doesn't check" and "the program doesn't know to check"? Is there an API subfamily related to some kind of "knowing" paradigm built into the architecture?

      The TFA is right. Anthropomorphizing is always bad.

    9. Re:Less accurate statement by Anonymous Coward · · Score: 0

      If I could remember my id and password, I would sign on to mod you up.

    10. Re:Less accurate statement by itzly · · Score: 1

      The TFA is right. Anthropomorphizing is always bad.

      And yet, you anthropomorphize the article.

    11. Re:Less accurate statement by ultranova · · Score: 1

      What on earth does it mean for the program to "know" something?

      It means that Guru has Meditated on some value long enough for Amiga's karma to spent and it to be released from bounds of matter and the cycle of manufacturing and recycling into a virtual Nirvana as an emulator.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  42. Why not use it, if it works? by Tony+Isaac · · Score: 1

    If programming were strictly about efficiently providing instructions to computers, then anthropomorphism would be wasteful and counter-productive. Think about all of the code and processor cycles devoted to displaying data as windows, folders, icons, or just plain aesthetics. Those metaphors are highly wasteful of computer processing power.

    But the point is, computers are, above all, a tool for people. So why not make them function in a way that is understandable to people? If anthropomorphism helps programmers understand the interconnections of complex software, then by all means, we should use it! If the metaphors break down, fix the metaphor, or use a different one. It's how we think. It's OK if it's not perfect, as long as it gets the job done.

  43. 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".

  44. Re:Degenerate by Anonymous Coward · · Score: 0

    I anthropomorphize my computer just to piss it off.

  45. 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.

    1. Re:Car Analogy by reve_etrange · · Score: 1

      Actually very funny, but I've already commented a bunch in this thread. I have points too (sad face).

      --
      .: Semper Absurda :.
  46. Spoken like someone who forgets how humans work by melchoir55 · · Score: 2

    Humans are bad at abstract logic. Not just bad, but shockingly, horribly bad. It requires many years of teaching to get them to learn how to reason according to logical principles and to avoid logical fallacies. Most people never get there at all.

    OOP is a step in the right direction, for some kinds of programming. You don't always need to tell a story about your concept space. Sometimes what you're doing is so simple, and so shortlived, that it doesn't matter. However if you want long term maintainability and something that other people are going to be able to learn as quickly as possible, OOP wins. Consider the following example:

    English:
    John loves Sally. People like to spend time with others that they love. Does John like spending time with Sally?

    If you are human and not deeply mentally impaired, you will quickly answer "yes" to the above question

    Symbolic logic:
    Derive Q (John likes spending time with Sally)
    P (Assertion)
    P -> Q (Modus Ponens)

    Did you immediately think in your brain the following:
    Q (Consequence of premises 1 & 2)

    A lot of people who stare at that sequence of symbols will require a few moments to process it. Very few will read it as trivially as they read the English expression, although both expressions communicate the same relationships and information. Why is that? It is because the logical derivation is an abstraction above the English expression (which itself is of course an abstraction of something else). Every level of abstraction adds to how difficult it is for a human to comprehend something. It doesn't mean they can't get it, it means it will take longer (though depending on the person it might mean they can't get it).

    Do you want people to be able to read your code in the future? The best chance of them succeeding is to use object oriented programming, and to create a class model that closely resembles what most people intuitively understand as the concept space you are working in.

    Humans did not evolve to process information regarding Ps and Qs. They evolved to process information about Johns and Sallys. They are much better at the latter than the former.

    1. Re:Spoken like someone who forgets how humans work by Tablizer · · Score: 1

      But, everybody thinks differently. I've had vast arguments over code versus mind and have concluded that people vary widely. Whether there is a most-common or average thinking pattern, I don't know. Individual differences seem to swamp them if they exist.

    2. Re:Spoken like someone who forgets how humans work by phantomfive · · Score: 2

      A lot of people who stare at that sequence of symbols will require a few moments to process it. Very few will read it as trivially as they read the English expression

      It's not very well written.

      although both expressions communicate the same relationships and information.

      I don't think they actually do. You don't define what P means, and actually you have two assertions in your English sentence, but only one apparently in your symbolic logic.

      --
      "First they came for the slanderers and i said nothing."
    3. Re:Spoken like someone who forgets how humans work by Anonymous Coward · · Score: 0

      Pfft. Your example is ridiculous!

      Your conclusion doesn't follow unless you assume that 1) John is a person and 2) that John and Sally aren't identical.
      For all we know John is a dog named Sally.

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

    Well I fucking disagree with Felicia.

  48. Agree by cruff · · Score: 1

    I didn't see any anthropomorphism in the example. It just looked like a comparison of procedural and OO coding styles.

  49. Re:Degenerate by Anonymous Coward · · Score: 3, Insightful

    > Anthropomorphism is degenerate no matter the situation.

    a) Man is the measure of all things.

    Anthropomorphism is something we cannot really ever abandon -- be it regarding our tools and even regarding what goes around us.

    I always got upset with people who are Biology Nazis and go like "you cannot say that organism wanted to lose its teeth". Well, this is obvious! And yet (IMHO) it's a perfect valid way to state a fact -- either for youngsters who cannot grasp the way evolution really works and for adults, as a figure of speech.

    b) The discourse at the end of The Great Dictator, by Chaplin, would also be useful. If you abstract enough, a good part of morality is lost. You are not machines...

    c) OOP was never about anthropomorphism. One model entities, which might be humans or not. The article author didn't like an anthropomorphic example. Fine, do it with bacteria. Analogies now and then break. This has nothing to do with OOP as a method for problem specification and treatment.

    d) Sometimes we get fed up with things and the current trend of flat designs is an example. We got tired of anthropomorphic controls. Very nice. And it shall pass, too. And we'll be back to more human-adapted designs, futurely, and will be touted as a novelty. Hah!

    e) I've read both articles: the author has a much narrower aim at how one analogy broke; EWD says anthropomorphism fails (with what I agree) in a text written by hand (I had the pleasure to read another some months ago, he even let some text he stroke through remain. It's obvious he's not against anthropomorphism de per se, but he cautions us about the dangers of using it (like in the expression "restless waves").

    f) OOP has its place, and in some niches it may not be as useful, so procedural might be better. But then this can be said about the car and the bicycle. Where I disagree with the author is about OOP being syntactic sugar, since OOP happens at an earlier stage -- before syntax takes place. The implementation of OOP might be seen as that, but then again an implementation is not the idea itself.

    g) The author is way above my knowledge level; but then, this might be the source of his problems. I'd humbly suggest he backs away of his expertise and try a more conventional big picture view. There's a reason why OOP was invented and it will be debunked by a better knowledge model -- not by a previous one.

  50. Yep. OOP for gui controls, procedures small & by raymorris · · Score: 1

    As you said, use the best tool for the job. As an example, if you're coding a combobox control, that control has a visual representation, some behaviors (methods), some properties, and some things that can happen in it (events). There are likely to be several comboboxes should should have approximately the same behavior. Combobox is naturally an object.

    On the other hand, the small inner loop of lookup service which needs to be fast takes one parameter, a single value, and returns one value. There's no need for any object. This:

    return x + 3;

    Is much better than:

    Number three = new Number;
    three.value = 3;
    return three.plus(x);

  51. Too simple of an example to express his stance by Anonymous Coward · · Score: 0

    I love simple examples, they're so easy to manipulate to one's desired outcome.

    If one takes his example to the next step (the step after his statement that "everything runs on one CPU anyways") and starts thinking about multple cores, multiple CPUs, or distributed systems (like each human being can be thought of), his example just falls flat on its face and is a good argument as to why the entire industry is at a crossroads how to handle the slowing of CPU power density and the implied code complexity that it brings, needed to solve the ever-increasing data/analysis power needed. Solving with parallism can be one way, or Ungar's recent race-retry approach (personally I think this is the wrong way to go).

    Human beings ARE sentient, eventually we'll solve the entire AI thing (either with a good ending or a bad ending) and once we do, we, as software architects, developers, programmers, etc. should be ready. NOT following his advice would be a good start.

    Sorry dude, but you're barking up the wrong tree.. (IMHO, of course).

  52. Re:Degenerate by Sardaukar86 · · Score: 0

    Felicia disagrees with you.

    This female is a furry.

    At the very least she needs a 'tail-ectomy' and she could do with a new hair stylist, her mop reminds me of Farscape's Jool (SFW) but in blue. And those ears!

    Most of the males here evolved to appreciate HUMAN females and that's how we likes em', thanks all the same.

    --
    ..Mullah or Pope, Preacher or Poet, who was it wrote: "Give any one species too much rope and they'll fuck it up"?
  53. He doesn't understand the analogy by rendermaniac · · Score: 1

    The analogy expressed in the article isn't procedural versus OOP - which the author completely misses the point over. The analogy is serial versus parallel computing. In the first case each student is dealt with individually in order, in the second case the principal is a despatcher and each student is an independent process. So the analogy does hold. It has nothing to do with objects or not.

  54. Re:Degenerate by Z80a · · Score: 0

    We're on 2015, which means the trend now is to chase down the bronies.

  55. Re:This is why I like Python so I can use OOP or n by Anonymous Coward · · Score: 0

    Java is pretty much the only language with forced OOP.

    Any sane language is multiparadigm these days.

  56. Re:Programming languages are not really "language" by loonycyborg · · Score: 2

    Btw, in reality procedural and object oriented are just two different views and controls on the exact same datastructures and process-flows.

    'Object oriented' just means that you can extend the type system of the language which is completely orthogonal to procedural programming. It doesn't matter if you use only base types in your sub-routines, or add some custom types made with oop. So those approaches aren't even mutually exclusive. Just some common language constructs, which some languages implement and some don't.

  57. Re:This is why I like Python so I can use OOP or n by radish · · Score: 1

    There's absolutely nothing stopping you writing procedural code in Java, just put everything in one class and mark all your methods as static. Of course if you're going to start interacting with the class library you'll have to bend to it's way of thinking but that's not a _language_ thing. Of course I don't recommend doing that, but it can be done.

    This is why an experienced developer has multiple tools at her disposal - Java is great (IMHO) for a lot of things, but I'll pull out Ruby or Perl for some stuff, C# for others (e.g. when I want a native windows UI), Scala for yet more. There is no one size fits all, and just because one tool doesn't do everything doesn't make it useless.

    --

    ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

  58. Excellent comment. People relate to people by Peter+(Professor)+Fo · · Score: 1
    People relate to people. (That's not to say I like a UI which tries to have a 'human' conversation (Microsoft paperclip/doggy are you listening?) [You see what I did there?] But as a developer if you're 'asking' for data from the user then why not put yourself in the position of 'the clerk at the desk taking the details'. Once you've done that you may go the next level and put yourself in the position of the person answering the questions.

    You've all seen good and bad 'personal details' websites so it's hardly necessary to continue.

    We all know about stupid questions asked by an insensitive drone.

    IMHO the difference is between 'demanding' and 'asking nicely for a reason'.

  59. Re:This is why I like Python so I can use OOP or n by loonycyborg · · Score: 1

    Don't forget C# too. Just try to write a self-contained program in it that doesn't involve at least 1 class :P

  60. A Strange article... by Anonymous Coward · · Score: 0

    ...I wonder why anyone would want to read it.

  61. Re:Degenerate by pigiron · · Score: 0

    "One model entities"

    Entity modeling predates OOP.

  62. 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.

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

    OOP doesn't want to be anthropomorphized

  64. Re:We need FAT NIGGER LIPS in OOP! And bubble butt by Anonymous Coward · · Score: 0

    To qualify for GNAA membership, it has to be a first post, and you have to do it logged in. Sheesh. Don't they teach kids anything nowadays?

  65. Anthropomorphism / analogies can be useful by wormbin · · Score: 1

    The original analogy involved a principal (a fairly complex process) who instructs a group of students (a collection of complex processes) to go to various classrooms (a fairly expensive / time consuming task). The pseudo-code he has breaks most of these assumptions and results in a simple single threaded task calling move-to-classroom routine that is so trivial that the implementation is not even shown. His straw man analogy is thus not correct.

    It could easily be the case where the analogy is correct. e.g.

    1. This is distributed system run on a server farm so the principal and each student could easily be run as separate processes and thus giving responsibility via messaging would be more efficient.
    2. Assigning a student to a classroom is an expensive operation. Perhaps many transactions have to be made, email needs to be sent, humans need to approve, etc.

    In this case, implementing this system (especially with a technology such as actors) would very closely parallel the analogy and the anthropomorphism would aid in communicating the design. The straw man argument that the author dredges up is a very simple example not worthy of most tasks a software developer faces in the 21st century.

    Any analogy can be incorrect. Don't use them if they're incorrect.

  66. Re:Programming languages are not really "language" by Immerman · · Score: 1

    I beg to differ. I'm primarily a C++ programmer (came from C) and have done an aweful lot of the "C with classes" style programming you're describing, and it is a very different thing than object-oriented programming. The language constructs may be the same, but the design philosophy is extremely different.

    Today I mix and match as approppriate - there are situations where an OOP-oriented design has decided advantages, just as there are places where a more straightforward procedural problem decomposition makes things much more straightforward, but can still benefit from custom data types tailored to the problem space.

    --
    --- Most topics have many sides worth arguing, allow me to take one opposite you.
  67. Bears repeating... by Alomex · · Score: 1

    Object orientation is a tool, unfortunately most programming languages treat it as if was a religion.

  68. Re:Degenerate by gargleblast · · Score: 1

    Anthropomorphism is always trying to get into trouble and ruin other people's lives.

    Wha? Anthropomorphism just wants to be free!

  69. Meta bagels by Anonymous Coward · · Score: 0

    Godel called and wants to know if "isAnthropomorphizable" has been inherited in anyone's classes.

  70. Dijkstra's rejection of analogies in learning by Beeftopia · · Score: 1

    This has to do with Dijkstra's rejection of trying to learn new concepts with analogies to existing concepts we already know. I'd read an essay of his on the same subject some years ago. From the linked Dijkstra essay:

    "The above tried to capture the most common way in which we seem to cope with novelty: when faced with something new and unfamiliar we try to relate it to what we are familiar with. In the course of the process we invent the analogies that enable us to do so.

    It is clear that the above way of trying to understand does not work too well when we are faced with something so radically new, so without precedent, that all analogies we can come up with are too weak and too shallow to be of great help. A radically new technology can create such circumstances and the wide-spread misunderstanding about programming strongly suggests this has happened with the advent of the automatic computer.

    There is another way of approaching novelty but it is practised more more rarily. Apparently it does not come "naturally" since its application seems to require a lot of training. In the other way one does not try to relate something new to one's past experience - aware of the fact that that experience, largely collected by accident could well be inadequate. [...] To ease that process of liberation it might be illuminating to identify the most common metaphors and analogies and to see why they are so misleading.

    I think anthropomorphism is the worst of all. [...]

    I skip the numerous confusions created by calling programming formalisms "languages", except a few examples. [...]

    And now we have the fad of making all sorts of systems and their components "intelligent" or "smart". It often boils down to designing a wooly man-machine interface that makes the machine as unlike a computer as possible: the computer's greatest strength - the efficient embodiment of a formal system - has to be disguised at great cost."

    1. Re:Dijkstra's rejection of analogies in learning by Beeftopia · · Score: 1

      And this is all good of course, in terms of deep learning. But how does the average person then use that system to do something useful?

      It seems to me that trying to come up with interfaces that are easily understood while allowing us to translate our algorithms into instructions that the computer can execute (in the context of the formal system that it is) is the best way to make the device as useful as possible to as many people as possible.

      Thinking about new paradigms in computing is great; doing the Big Think is essential for technological progress; but in the meantime, how to maximize the productivity of the typical programmer? Are those "woolly" interfaces then so bad?

      Creating the "woolly" interface between the human and the formal system is a quite amazing and useful feat. All hail the compiler / OS writers?

    2. Re:Dijkstra's rejection of analogies in learning by Smallpond · · Score: 1

      The problem is that the model method is a very good way to learn things. When you learn electricity it's always compared to water in a pipe: voltage is like pressure, current is like flow rate, etc. Where it breaks down, as Djikstra says, is on radically new things like quantum mechanics. There is not much in real world experience that you can model that on.

      But how much of software is radically new? What in the last 10 years, say, is so new there isn't a well-undertood precept for?

  71. Toasting just a step away by SuperKendall · · Score: 1

    Unnecessary, since the IsBakeable interface provides a default implementation of the toast() method that throws an exception if you attempt to toast something that is not toastable.

    Unfortunately for you the entry-level coder actually building out the objects copied the Bagel implementation to make Cake, so now Cake does have a .toast() that does not throw an exception.. and of course there's no unit test to find that because it's stupid to toast a Cake.

    The first thing all four thousand clients did when getting the software was try to toast a Cake, and discovered Smoke.detect() worked great (well, for all the living ones anyway which is all that matters since they are the only ones you can bill).

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Toasting just a step away by amalcolm · · Score: 1

      Panatone, an Italian cakem is delicious toasted.

      --
      Time for bed, said Zebedee - boing
  72. Re:Programming languages are not really "language" by skids · · Score: 5, Interesting

    What gets me is this:

    If you don't draw analogies (like anthropomorphism), or abstractions, how the hell do you choose your names in a way that lends itself to understandable code? The author should take his own argument one step further and realize that calling a string of bits a "student" is likewise anthropomorphising the data, and calling another memloc a "Classroom" is applying an anology to what is really going on. Then he could reduce is argument ad-absurdium to requiring that all identifiers be randomly chosenstring to avoid installing unintentional meaning into data structures and procedures/functions.

  73. Re:Degenerate by reve_etrange · · Score: 2, Interesting

    I always got upset with people...go like "you cannot say that organism wanted to lose its teeth". Well, this is obvious! And yet (IMHO) it's a perfect valid way to state a fact...

    It's what Daniel Dennett calls the "intentional stance." I agree with Dijkstra, that anthropomorphizing code is frequently problematic, but the intentional stance can be quite useful in general. Most of the systems we build and encounter in our daily lives are "intentional systems", designed to achieve specific purposes in an external physical reality, and the intentional stance is really parsimonious for these cases.

    --
    .: Semper Absurda :.
  74. Re:Programming languages are not really "language" by reve_etrange · · Score: 1

    If you don't draw analogies (like anthropomorphism), or abstractions, how the hell do you choose your names in a way that lends itself to understandable code?

    That's a good point. Our programs are "intentional" (in the sense used in philosophy of mind), because we design them as means to specific ends. They are inherently about those ends, and self-documenting code conventions reflect that.

    I think it's possible (and quite natural) to use the "intentional stance" without anthropomorphizing as such, for example when naming a variable "speed," or saying a program "tries" to do something (again, reflected in self-documenting conventions like a "try" construct). Purpose and intentionality are everywhere in the the world, and are not properties of the human mind only.

    Dijkstra and Vaillant are probably not very familiar with intentionality (or philosophy of mind in general), or they probably would be making this distinction instead of blanket proscriptions against discussing code in certain ways.

    --
    .: Semper Absurda :.
  75. Re:This is why I like Python so I can use OOP or n by angel'o'sphere · · Score: 1

    But you do know that the static main method my call other 'procedural static methods?

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  76. Re:Anthropomorphism very useful, when used correct by andrewbaldwin · · Score: 1

    you mean use anthropomorphism to make computers seem like politicians / journalists / managers ...

  77. Re:Self-defeating argument? by reve_etrange · · Score: 1

    It seemed easier for me to organize things into classes for a poker program because anthropomorphizing the methods made sense in that case.

    In what way did you impute human characteristics to the poker code? My guess is you didn't truly anthropomorphize, but rather used some form of intentional stance or design stance.

    IMHO, Vaillant (not having studied philosophy of mind) is a bit confused about intentionality, which is actually totally inescapable in programming.

    --
    .: Semper Absurda :.
  78. Re:This is why I like Python so I can use OOP or n by vrt3 · · Score: 1

    I wouldn't even call Java object oriented, rather class oriented. It forces you to put everything in a class. Most of the time when I see Java code, there's a whole bunch of classes with nothing but static functions in them.

    Python is in a sense much more object oriented than Java: everything is an object. Modules are objects, functions are objects, classes are objects.

    --
    This sig under construction. Please check back later.
  79. Re:Degenerate by Anonymous Coward · · Score: 0

    Well, I disagree to fucking with Felicia.

  80. Re:Degenerate by Anonymous Coward · · Score: 0

    Disagree with me to fucking Felicia well?

  81. Re:anthropormphism sounds like a chick thing... by smittyoneeach · · Score: 1

    Old and busted: anthropormphism.
    The new hotness: gynomorphism.

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  82. That's all been debunked by smittyoneeach · · Score: 1

    Nobody buys a 'Toast Decorator'. They buy a 'Toast Decorator Factory'. If you don't pick the right framework, you're never going to be more than an HTML coder.

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  83. Re:Programming languages are not really "language" by loonycyborg · · Score: 1

    There's no such thing as 'OOP-oriented design'. Just some common design (anti-)patterns that people associate with object-oriented language features. Object-orientation is nothing more and nothing less than the capability to extend the type system. Looking for deeper philosophy in it is a waste of time.

  84. Re:Programming languages are not really "language" by jbengt · · Score: 1

    Btw, in reality procedural and object oriented are just two different views and controls on the exact same datastructures and process-flows

    Btw, TFA is promoting Functional programming over Procedural/ObjectOriented programming, and does consider OO as a Procedural style.

  85. Re:Degenerate by Anonymous Coward · · Score: 0

    Well, I agree to fuck Felicia.

  86. Re:This is why I like Python so I can use OOP or n by Anonymous Coward · · Score: 0

    >There's absolutely nothing stopping you writing procedural code in Java, just put everything in one class and mark all your methods as static. Of course if you're going to start interacting with the class library you'll have to bend to it's way of thinking but that's not a _language_ thing.

    That in general cannot be done and the reason is a language thing. Try something like (I can't even write it without pseudo code in Java, much less do it):

    class X {
          static auto f(int x) {
                    int g(int y) {
                              return x + y;
                    }
                    return g;
            }
    }

    That would be perfectly normal procedural code.

  87. Re:Programming languages are not really "language" by Immerman · · Score: 1

    There's no such thing as structured programming design - structured programming is nothing more and nothing less than convenient wrappers around "if" and "goto" statements.

    Do you see how ridiculous such a claim is? Or perhaps you are too young to remember the wonderful world of "spaghetti code" programming before "goto" was demonized and nicely encapsulated functions became a common language feature.

    --
    --- Most topics have many sides worth arguing, allow me to take one opposite you.
  88. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  89. Re:Programming languages are not really "language" by Anonymous Coward · · Score: 1

    Not all OOP languages have types. For example, Self is generally considered object oriented but does not have a type system. Furthermore, classes are not the same as types (Google type theory if you don't believe me).

    OOP is hard to define!

  90. Example breaks down by PPH · · Score: 1

    The example cited in TFS breaks down. It claims that underlying the procedural and OO methods of moving students to classroms, the work done is the same. And then it conveniently shows the functions/methods move() and move_student() as "implementation not shown".

    But in real life (and OOP), moving a student might differ for each instance. Some students might have to stop by their lockers to drop off some books. Or sneak out into the parking lot to blow a butt between classes. Likewise, in OOP, the move_student() methods might differ between students. If heuristics are applicable, some students might choose a more efficient path, while the dumb ones wander through the senior lounge and get the snot beat out of them.

    --
    Have gnu, will travel.
  91. Re:Degenerate by Anonymous Coward · · Score: 0

    We can work around that tail.

  92. Re:Programming languages are not really "language" by loonycyborg · · Score: 1

    Design patterns themselves transcend language features. That was my only point here. Mixing those two is a mistake. Using a language feature doesn't automatically make you proficient in using design pattern it's associated with. It's merely a syntactic sugar. And many language features serve different design patterns. And those patterns are implemented with different features in different languages.

  93. Only thing that matters by mrflash818 · · Score: 1

    However, I also think that if a team or individual programmer can release software that serves a useful purpose, and is maintainable, then those are the only things that matter. Which language, functional or object-oriented 'way' that was used to get there? Seems less important.

    (As for all the CompSci101 ad hominem one-upmanship of which definition is best to apply to each programming language, methodology, or style, I say: go do your bran muffin time *rueful laugh*

    "A shoe!" -- Monty Python, Life of Brian

    https://www.youtube.com/watch?... )

    --
    Uh, Linux geek since 1999.
  94. Re:Programming languages are not really "language" by Immerman · · Score: 1

    Yes, and an extensible type system is a language feature that simplifies object oriented design - but it is neither necessary nor sufficient to the purpose.

    --
    --- Most topics have many sides worth arguing, allow me to take one opposite you.
  95. Re:Degenerate by the_digitalmouse · · Score: 1

    "This female is a furry." BZZT! Wrong answer, but thanks for playing! It's a cartoon/drawing of an anthropomorphic female from a comic/game/fantasy setting. A 'furry' is an actual person that sympathizes with, relates to, or even wishes they were an animal in some form or fashion, often by wearing fursuits and/or engaging in some form of animal behavior, sexual or otherwise. And for the record, we haven't 'evolved' to fuck human females, that's just how it's happened more often than not due to species dominance or relationships or that it was the 'only game in town'. Evolution hasn't stopped human males from fucking anything (like sheep or even other human males) that stands still long enough for him to try.

    --
    http://about.me/jimm.pratt
  96. not seeing the problem by khallow · · Score: 2

    Anthropomorphizing is not this ridiculous caricature. It is a very effective process by which we relate new information to information we inherently have. Would you rather relate new information in a way you and others can readily understand or in a way you and others can't readily understand?

    Sure, it's not perfect, but usually you're looking for good enough, not perfect. For example, consider this example from my neighbor, Yellowstone National Park. You are tourist and come across a bull (male) elk. It's a 600 pound member of the deer family with an antler spread around two meters wide. There are correct and incorrect ways to anthropomorphize the behavior of that bull elk. The following is the incorrect way which unfortunate, real world tourists use each year: "That's a pretty elk. I know he wants me to pet him, because I would like being petted if I were a pretty elk too!" Their world gets rocked as a result. Consider the alternate approach: "That's a big elk in the middle of rut season. I bet he'll be pissed if a crazy human tries to touch him. I would if I were running around hyped up on hormones." Look! No headbutt Ma! Obviously, neither approach captures what it means to be elk or those elk sensibilities. There is this certain lack of nuance of the elk point of view. But one approach, which I would go as far as to label an entirely correct approach to understanding in this scenario, keeps you from finding out what pointy antlers backed by 600 pounds of enraged elk can do to a person.

    My view is that humanity and our behaviors are sufficiently complex that one can shoehorn any understandable phenomenon into an anthropomorphic basis. The real problem is not the process, but insufficient understanding of the problem needed to come up with a sufficiently correct anthropomorphic model.

  97. Simplistic and Limited by Anonymous Coward · · Score: 0

    The author uses a very simplistic example. In the real world a school has an admin dept to handle placing students in requested classes. Therefore at least one other Admin Class is needed. A Student should remember class assignment unless modified by Admin. This way the Principal can directly assign class if need be or contest an assignment.

  98. the worst by BadFroggy · · Score: 1

    The only thing I truly can't stand is when they call the program "he". I can honestly say I've never heard anyone I consider a good programmer do that.

  99. Re:Degenerate by plopez · · Score: 1

    it doesn't like it ;)

    --
    putting the 'B' in LGBTQ+
  100. Re:Degenerate by Sardaukar86 · · Score: 1

    BZZT! Wrong answer, but thanks for playing! It's a cartoon/drawing of an anthropomorphic female from a comic/game/fantasy setting.

    I beg your pardon, you are quite correct.

    And for the record, we haven't 'evolved' to fuck human females, that's just how it's happened more often than not due to species dominance or relationships or that it was the 'only game in town'. Evolution hasn't stopped human males from fucking anything (like sheep or even other human males) that stands still long enough for him to try.

    I didn't say that; appreciating is rather far removed from the act of fucking females.

    However, whilst we're on the topic of fucking, males have most certainly evolved physically and psychologically to fuck females*. Are you really saying that they have not? Unless I misunderstand you, this may be difficult to argue given the preponderance of evidence to be found throughout the natural world.

    * No offence intended to LGBTt people, I'm just simplifying and generalising in this case

    --
    ..Mullah or Pope, Preacher or Poet, who was it wrote: "Give any one species too much rope and they'll fuck it up"?
  101. Duh! by tinkerton · · Score: 1

    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.

    Yeah well, don't push it too far then. Are there a lot of people who are pushing it too far?

  102. It's called OOD. by TapeCutter · · Score: 1

    You have it backwards, OO is primarily a design methodology, not a language feature. If you look carefully, most of the examples in K&R are actually implementations of good OOD written long before the term was coined. The "OOP features" found in today's languages actually evolved from the use of OOD, not the other way around.

    How do I know this? - I'm degree qualified and have been using it professionally for almost 25yrs. Do yourself a favour, admit to yourself you might not understand OO properly and crack open an OOD textbook.

    --
    And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
  103. Re:Programming languages are not really "language" by Half-pint+HAL · · Score: 1

    You could claim that subroutines are just syntactic sugar built on GOTO, but then again, even 6502 assembler supported three types of flow control -- JMP (unconditional jump); conditional branches (only a small memory offset, so only useful for IF-type constructs) and JSR: Jump to SubRoutine. But your typical C subroutine isn't syntactic sugar for a JSR, as you have more context to stack than just the accumalator, X and Y registers and the program counter.

    Sytactic sugar has to refer to features within the same language, and while I'm sure I could get close to reimplementing Python's OO in Python using dictionaries, it's going to be very messy to get method calls and multiple inheritance working. But implementing Python's magic methods in non-OO Python... well, that's a whole other braintwist.

    --
    Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
  104. Don't confuse anthropomorphizing with syntonicity by the+agent+man · · Score: 1

    When Dijkstra suggested that "It [anthropomorphizing] invites the programmer to identify himself with the execution of the program" he was a bit confused about the notion of anthropomorphization. To attribute human behaviors to objects, i.e., to anthropomorphize, is very different from projecting oneself into an object. Papert called this projection, e.g. to program a virtual or physical turtle, body syntonicity. There certainly is evidence that this can be a useful thing to do to write or debug programs.

    I fail to see the relevance of the example provided by the recent article for or against OO. The code in both cases is essentially the same. Just because there is no explicit class teacher does not mean that example #1 is not OO. There are really cases in which OO does lead towards certain implementation approaches that are inefficient or overly complex for no good reason. Search for "Antiobjects" to find some examples where OO would suggest to put certain behavior into a certain classes in ways that may result in very complex code. The Antiobject approach, in contrast, can lead to a very simple solution. The two approach are not only different in terms of perspective and where the code really goes but in terms of actual code. An example would be to compare a concurrent search, e.g., multiple ghost tracking down a pac-man. In the traditional OO approach one would be tempted to put the complex, e.g., A*-based "AI" into the ghosts. In the antiobject approach one would put the tracking code into the background, e.g., the tiles and walls of a maze to implement, say, a Collaborative Diffusion approach. The collaborative diffusion approach is not only trivial to implement but also results in sophisticated collaboration patterns that would be much more difficult to match with approaches flavored by traditional OO design.

  105. Design methodologies by TapeCutter · · Score: 1

    Design patterns themselves transcend language features. That was my only point here.

    Yep, that's why it's called a design "methodology", it ignores the implementation details. OOD is an older design methodology you are apparently completely unaware of even though many languages have gone out of their way adding features to make it easier to implement OO designs. "Functional decomposition" is the oldest methodology commonly used by developers and is also well supported by specific language features. "Design patterns" is the only popular methodology that is not well supported by language features, perhaps that's why you noticed it "transcends language features"?

    Agree that mixing two methodologies will end in tears but that doesn't mean you can't use OO language features to implement a design pattern.

    --
    And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    1. Re:Design methodologies by loonycyborg · · Score: 1

      Let's just say extension of type system is the only aspect of OOP I took as something significant and rejected everything else as either individual style preferences or intellectual masturbation.

  106. I don't understand the hate by Anonymous Coward · · Score: 0

    The concept of Object-Oriented Programming is to encapsulate not only data but also functions, almost like wrapping them up together. Packaging them if you will. This means, if you're given an Object and its API, you know that the given Object has properties A, B, and C, and the functions that come with it are intuitive, straight forward, and compatible with the data. You can call function x and by way of the API know it will do something predictable, intuitive, and hopefully usefl to A.

    Think about writing OOP code in C. You basically have a struct, which is the closest thing to an object, with some properties (variables), but you can't package functions in with it, so you end up with functions that need prefixes to allow you to differentiate between the "object functions" and the rest of your functions.
    Like, if you have the struct Triangle with sides a,b,c and angles a,b,c, you can't just call triangle.Area() to get it's area, you have to do triangle_area(triangle); since you might also have square_area() and rectangle_area() or even circle_area;

    The problem is the same for procedural, functional, and imperative. If you can't wrap your functions and data together, you can't guarantee compatability and you'll encounter far more trouble when you try to update, extend, or maintain code written to operate on said data. Granted, this isn't an issue for a program that only operates on one set or type of data at a time, such as researchers, but even having objects that can calculate a t-test based on its own data makes processing research data as easy as thisObject.t_test();

  107. On the cruelty of really teaching... by tepples · · Score: 1

    Learning something new without analogies is probably going to be very slow.

    Dijkstra appeared to be a fan of the slow. See his essay "On the cruelty of really teaching computing science".

  108. Article seems to be a load of crap by Anonymous Coward · · Score: 0

    Article seems to be a load of crap, and the examples given are horseshit. None of that code would pass code review, and the OO example is not remotely OO. Kids.

  109. Re: Degenerate by Anonymous Coward · · Score: 0

    No offence intended to LGBTt people

    I don't see why you should have to say this. If humans had not evolved to be heterosexual, the species would not exist. How could anyone be offended by this truth?

  110. Re: Degenerate by Sardaukar86 · · Score: 1

    I don't see why you should have to say this. If humans had not evolved to be heterosexual, the species would not exist. How could anyone be offended by this truth?

    A fair comment and I'd wager that my friends who fit within the LGBTt umbrella probably wouldn't bat an eyelid.

    However, in this enlightened age of political correctness and sensitivity (oh, and punitive moderation) I thought it wise to clarify.

    --
    ..Mullah or Pope, Preacher or Poet, who was it wrote: "Give any one species too much rope and they'll fuck it up"?
  111. Re:This is why I like Python so I can use OOP or n by Anonymous Coward · · Score: 0

    You may like programming in Nim then (http://nim-lang.org), it gets away completely without objects because they are in most cases an artifact of the syntax. In fact, one of the first things you learn in OOP is how to *extend* or *add* methods to existing classes. Check the examples on the website header, no trace of class keywords, yet OOP like anything else.

  112. That is dumb by neminem · · Score: 1

    One of my favorite quotes from the Jargon Files, on this exact subject, as relevant now as when it was written:

    "At first glance, to anyone who understands how these programs actually work, this seems like an absurdity. As hackers are among the people who know best how these phenomena work, it seems odd that they would use language that seems to ascribe conciousness to them. The mind-set behind this tendency thus demands examination.

    The key to understanding this kind of usage is that it isn't done in a naive way; hackers don't personalize their stuff in the sense of feeling empathy with it, nor do they mystically believe that the things they work on every day are `alive'. To the contrary: hackers who anthropomorphize are expressing not a vitalistic view of program behavior but a mechanistic view of human behavior."

    Full text here: http://www.well.com/~lonewolf/...

  113. Re:Self-defeating argument? by reve_etrange · · Score: 1

    Am I understanding that correctly that you basically define how an object should respond to data, thereby giving it a human-like response?

    Pretty much, although part of the point I wanted to make is that "human-like" is not necessarily as broad as it's made out to be. For example, IMHO the "try" construct is intentional without being anthropomorphic - I think "try" is an accurate moniker for what the program does.

    --
    .: Semper Absurda :.
  114. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  115. Re:Self-defeating argument? by reve_etrange · · Score: 1

    That is a very difficult one to explain to someone with no coding experience.

    I disagree. The try-catch block just performs an action while listening for special return values indicative of failure. Take establishing a connection, which may succeed or fail. If the failure code (or exception) is found, the program reacts differently than if it is not. I think most people would catch on quickly, especially if with some pseudocode to point to.

    How can you ask a computer to "try" something, really?

    I think "try" is a lot like "do," with uncertainty. Take a look at the definitions of "try". Def. 1 seems circular, but Defs. 2 - 4 and 7 seem to apply pretty well to the program. Of course, if we use Def. 8 instead, then few of us ever "try."

    Ahh, semantics (being the study of meaning, I actually think semantics is pretty important).

    --
    .: Semper Absurda :.