Slashdot Mirror


The Object Oriented Hype

bedel231 sent us a fairly lengthy and detailed article discussing the hype surrounding Object Oriented Programming and tries to claim that a lot of things taken for granted are mythical. Personally, I've never been a huge fan of OOP, so I tend to agree on a lot of these points. Regardless of your stance on the issue, it's worth a read.

195 of 730 comments (clear)

  1. Re:Myth... by Wraithlyn · · Score: 2
    No kidding... it's been my experience that code is almost ALWAYS rewritten to jive better with the specific program environment.

    The problem is that people tend to only code methods which are needed for their particular use of the object in question. And why shouldn't they? It makes for leaner code. It also makes for horrible reusability, because later when you try to the use the same object for a different application, you generally have to get under the hood and rip away at the guts to refashion it for YOUR use. This of course completely sidesteps the whole point of encapsulation and data hiding in the first place.

    --
    "Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
  2. Re:The King of Argument By Authority (Addison) by pjrc · · Score: 2
    BlackStar, very impressive post.

    Of course, you only gave two solid examples, admittedly from two of the best known and most respected men in the field, but still only two.

    Even with a third, I'm sure Bryce wouldn't back down.

  3. But compiler support helps a lot. by Ungrounded+Lightning · · Score: 2

    one common misconception is that one can not do object oriented design in C, or any language that isn't approved by the OOP zealots...

    one can create objects in C by...


    Yes. But by doing that you're sacrificing the compiler support.

    And IMHO it's the wroing parts of OOP that get the hype. Encapsulation and strong type checking rate higher for me than code re-use or some aspects of inheritance (though polymorphism is right up there).

    One big thing about languages like C++ is that they give you a way to express your intent regarding encapsulation and data hiding to the compiler and related tools, which then check them for you. (I'd say "enforce", but C++ also has ways to express your intent to deliberately violate the normal boundaries.)

    It's really instructive to look at the "things to check for in a walkthrough" section of Miller's book on software quality. There are four pages of essentially one-liners describing the easy errors to make in languages like Fortran or Cobol. And with C++ they're vitrually all impossible to generate without producing, at a minimum, a compiler warning.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  4. Now engaging write-only mode... by TheKodiak · · Score: 2

    I think, far and away, the best part of this article, is the part where he takes vague numbers from studies of large (2+ year before initial shipment) development efforts and tries to apply them to products that can go through 10 whole number versions and get abandoned by the roadside in 2 years. The slowdown he talks about in the beginning of an OO dev cycle is partially proportional to the length of the dev cycle overall - NOBODY spends 3 years developing objects for a 3 month project, no matter how fanatical their devotion to OO.

    --
    -=Best Viewed Using [INLINE]=-
    1. Re:Now engaging write-only mode... by TheKodiak · · Score: 2

      Oops - I was wrong. I forgot about the one part of the article that's more insightful than any comment about programming ever: "In addition, the OOP community is strongly divided on whether the "component" model or the "inheritance" model is the way to go. Microsoft seams to favor the component model. The jury is still out on this one. Without getting into the details of this battle, let's just say OOP still has some growing up to do." Holy fuck! There might be more than one right way to do things! ABANDON FUCKING SHIP!

      --
      -=Best Viewed Using [INLINE]=-
  5. OOP invented PolyMorphism?! by LionKimbro · · Score: 2
    Sounds like you've done mostly encapsulation, maybe a bit of inheritance is natural too. Probably not polymorphism though.

    ...As if the world owes the concept of interface to OOP.

    The concept of a wall socket is very old. It's so old, it's even present in UNIX. Look in your /dev/, and the interface that your devices are programmed to. The author of the web page is right; OOP is claiming a lot of inventions that are not it's own...

    It's too bad. I wish more computer scientists look at computer science history, rather than the "Learn SQL, C++, and make a bunch of money" book shelf.

    1. Re:OOP invented PolyMorphism?! by BeanThere · · Score: 2

      I think you've misunderstood me, I most certainly was NOT claiming that OOP "invented" polymorphism, or anything of that sort. I was merely saying that polymorphism is one of the three main things that "OO" encompasses (and typically support at a language level). Nowhere does that even vaguely imply "invention". In fact I even rather explicitly stated that encapsulation is quite a natural concept in pretty much any paradigm - so how exactly did you arrive at the conclusion that I (or anyone else for that matter) was claiming that OOP *invented* those things? If you've seen that, its in your own mind, not in my post.

  6. My .02 dollars by panda · · Score: 2

    As someone who has done the exact same kind of programming that the author of the article talks about: small to medium software packages for business, mostly in-house, custom stuff to get the job done. I can sympathize.

    However, I don't think his real issue is with OOP, but with general programming practice in that sector. None of the developers with whom I worked took the time to actually design anything. They jumped in with their first idea and hammered at it until it "worked." They didn't care if there was a "better" design or a better way to do something, they just wanted it to work and for the customer (i.e. some other division of the company) to be happy with the software. If it came back for bug fixes later, oh well, that's what keeps us employed.

    The real problem is not with OOP itself, but with the kinds of OOP tools (often linked to some RAD package) that are heavily used in this area and with the fact that so few of the programmers have the time to actual do design or code review. The managers were constantly telling us to review each other's code and to design everything, but no one ever did, and what passed for a group code review was a joke. No one actually looked at code. The lead programmer, often the only programmer, for the project stood up and gave a "best case" (i.e. outright lie) description of how the code works. Later, when some poor schmuck (i.e. you) has to maintain that very same code (which you were not involved in designing or coding in the first place) you find out just what a mess the code really is. The software more often than not did not even begin to approach the design discussed at the "code review."

    Nah, the problem isn't with OOP, 'cause I have personally seen massive improvements in my coding since I've started using an OOP style with thorough documentation and formal notation. The problem is that in the very sector the author is complaining about, the vast majority of programmers are mediocre, and the managers (who don't do the work, but pick the tools and "methodology") are even worse. The problem is with buzzword programming where you pick tools because they are compliant with all the latest buzzwords, not because they are right for the job at hand, nor because your programmers know how to use them, which the majority don't.

    Some folks need to go back to school!

    --
    Just be sure to wear the gold uniform when you beam down -- you know what happens when you wear the red one.
  7. common misconception by jon_c · · Score: 3

    one common misconception is that one can not do object oriented design in C, or any language that isn't approved by the OOP zealots. this is just not true, while it may be more natural to write a good object oriented design in C++, Java or Smalltalk. it can also be done in C or BASIC.

    one can create objects in C by creating a structure, then passing that structure to every method that performs on that structure. a common use could be something like this.

    struct window_t win;
    window_init(&win)
    window_draw(&win);
    window_destroy(&win);

    it is also possible to perform polymorphism and inheritance with function pointers and other techniques.

    -Jon

    --
    this is my sig.
    1. Re:common misconception by David+Gould · · Score: 2


      I did, just maybe not carefully enough; I guess you did say that, after all. You gave the classic "Draw() method for abstract class Shape with concrete subclasses Circle and Square" example, and claimed at the top that it was something that "With the structure+procedure approach, [...] would have to be [a switch statement]" Following that, the last sentence seemed to be claiming polymorphism as a virtue of OOP over C. Rereading it, though, I see that it sounds more like you are acknowledging that polymorphism can be done without explicit language support, which was also my point. If that's right, then sorry.

      Mainly, I was looking for a good context in which to make the point of my last two paragraphs, namely that OOP is a bigger concept than a feature set of any language. In fact, I still have trouble with your initial argument that:

      According to your definition there's no difference between procedural programming with good practices such as data encapsulation, and OOP. But there IS a difference... an object is self-contained.

      We've already covered methods (explicit and otherwise), including polymorphism, and you specifically mention "good practices such as data encapsulation", so what else does "self-contained" mean? Will it still be anything that a good C programmer doesn't (or couldn't) already do anyway?

      What I'm trying to say is that programming in an OO frame of mind does not necessarily require any particular language, language construct, or even programming technique (see my claim that even the version with the switch statement is in a sense OO).

      David Gould

      --
      David Gould
      main(i){putchar(340056100>>(i-1)*5&31|!!(i<6)<< 6)&&main(++i);}
    2. Re:common misconception by scrytch · · Score: 3

      It's also true that you can do good object oriened design with a Turing Machine, implemented in the Game of Life, composed of a million midgets wearing reversible parkas, which is directed from above by an Elvis impersonator in a hot air ballon shaped like a guitar.

      You signed an NDA on that design. Expect a call from our lawyers.

      --

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    3. Re:common misconception by David+Gould · · Score: 2


      A good solution in C isn't quite as simple as you described. Specifically, your circle is described by parameters top, left, bottom, & right. Not only is that an inefficient way to describe a circle, it is ambiguous for other simple shapes (e.g., two different ellipses can have those 4 parmeters be identical). So, to do it "right" in C, you'd have to do something like having your shape structure hold a pointer to another structure that holds the shape parameters.

      First, let me mention that I had originally included a line "//..." after the "members" and "methods" declaration lines in the struct, to indicate that more would go there, but Taco's so-called "lameness filter" once again demonstrated its own lameness by tagging them as "junk characters", so I had to take them out to post it.

      I don't disagree with you much, but my example still deserves some defense. It may not be a good (efficient or even sufficient) way to describe geometric shapes for mathematical purposes, but it is good for objects that correspond directly to stuff that is to be drawn to some output device. Most 2D graphic toolkits I've seen have a DrawOval() function with exactly the same interface as DrawRectangle(), i.e., they take a Rectangle (struct or individual coordinates), and disambiguate the ellipse by using the one with vertical and horizontal radii. Even if the rectangle coordinates have nothing to do with the specific shape, they are needed because the code that manages the shapes together generically will need to know each one's bounding rectangle, so this information is universal to all shapes. In OOP terms, it would be in the abstract base class; in non-OOP syntax, it would be in the struct as I have it, along with (as you say) a pointer to another struct with any additional (you didn't say that) shape-specific information, which would have gone in the place of my lamented "//...".

      Note the phrases "In OOP terms" and "in non-OOP syntax" -- this gets back to my main point about OOP as a way of coding vs. OOP as a way of thinking. It's not just (as we all seem to agree) that you can do OOP without the syntax by using some (admittedly, increasingly awkward) techniques. I'm also claiming that there's not (necessarily) anything special about "OOPy" code at any level. In some sense at least (I just seem to keep adding that disclaimer everywhere) OOP is in how you think about it, no matter how you implement it, or even whether or nor you implement equivalent techniques at all. Even if you don't use the tricks we have been discussing with structs and function pointers as substitutes for OOP syntax, your code could still be called "object-oriented" as long as it is structured around entities or things with behaviors and interactions that model stuff, which will probably happen to some degree whether you think about it in those terms or not.

      David Gould

      --
      David Gould
      main(i){putchar(340056100>>(i-1)*5&31|!!(i<6)<< 6)&&main(++i);}
    4. Re:common misconception by slim · · Score: 2

      That's not a misconception at all. I think you need to look at the definition of an "Object Oriented" language. You'll see that to be OO a language must support certain things like inheritance, polymorphism, run time binding (dynamic binding) and many other fun things that you can't do in procedural languages. C doesn't support any of those.

      Since g++ (the GNU C++ compiler) is written in C, C and C++ are equivalent. In fact, all programming languages are equivalent. You could write OO code in a big pile of NAND gates if you really put your mind to it... or on a Turing machine... or on a Neural Net... etc. Basic language theory, that.

      Just because a language doesn't provide the syntactic niceties of (say) Eiffel, doesn't mean you can't create objects with methods and inheritance, and ask them to run said methods.
      --

    5. Re:common misconception by aardvarkjoe · · Score: 2
      Unfortunately, a large contingent of programmers claim that OO is the only way to program, and universally is easier to write/easier to read/faster to code/faster running/etc/etc/etc. You see it in the 'language wars', where you often see "Java is better than C, because the OOP support is better." Please. You should base your style of programming on the task at hand, not try to twist it into the techniques of the current fad.

      There are problems where OOP is good, and problems where it's not such a good idea. If you insist on using one or the other, pick those problems that it's suited for. I admit that I have some real problems with object-oriented programming's approach to things, but I don't want to convince people to give it up. Just don't make me do it. (That's the main reason why I chose not to do CS in school.)

      --

      How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
    6. Re:common misconception by Black+Parrot · · Score: 2

      > I think you need to look at the definition of an "Object Oriented" language. You'll see that to be OO a language must support certain things like inheritance, polymorphism, run time binding (dynamic binding) and many other fun things that you can't do in procedural languages.

      I've seen a number of different definitions of what it takes to qualify as an OO language, and as far as I can tell the various definitions exist for the sole purpose of letting people say "My language is; your language ain't."

      Not to defend C; I avoid it whenever I can. But we should concern ourselves with the essence of what OO means.

      So far as I can tell, the GTK+ people have caught the essence of OOness in GTK+, even though it's implemented in C.

      --

      --
      Sheesh, evil *and* a jerk. -- Jade
    7. Re:common misconception by BinxBolling · · Score: 3
      If you add the methods to manipulate the structure (via function pointers if you're using C), then you have an object.

      What do you think the "window_init", "window_draw", and "window_destroy" functions were? Just because these functions weren't formally defined as methods of the window_t object doesn't mean that they aren't methods. In the programmer's mind, they're methods, and that's what matters, in the end.

    8. Re:common misconception by SpinyNorman · · Score: 2

      According to your definition there's no difference between procedural programming with good practices such as data encapsulation, and OOP. But there IS a difference... an object is self-contained.

      One classic example is a program that draws a bunch of different shapes. With the structure+procedure approach, the code would have to be:

      switch (shape.type) {
      case Circle: DrawCircle(shape); break;
      case Square: DrawSquare(shape); break;
      }

      With an OOP approach, the object "knows how to draw itself", and the code becomes:

      shape.Draw();

      See the difference? -- Procedural vs OOP.

      What happens to both these code fragments when you want to add support for triangles?

      That is the essence of OOP - to keep things self contained.

      The above example is also an example of polymorhism, and doesn't need a language such as C++ that explicity supports it. In C the Draw() member would just be a function pointer.

    9. Re:common misconception by gfxguy · · Score: 2
      So far as I can tell, the GTK+ people have caught the essence of OOness in GTK+, even though it's implemented in C.
      Funny, that's what I've always said about the X Windows System.

      To throw in my $0.02, I've always felt I could do what I do in C++ in C, but I've also always seen how much easier some things are in C++. OOD applies to a lot of problems, but I don't recall any OO programmers claiming it applies to everything, and everything should be forced to somehow comply with OO structure.

      I didn't get through the whole article, but it sounds like a bitter programmer with a chip on his shoulder. I mean, what's the big deal? If you don't like object oriented programming, don't use it. Just sounds like another whiney geek with too much time on his hands.
      ----------

      --
      Stupid sexy Flanders.
    10. Re:common misconception by baka_boy · · Score: 2
      Right now, OOP is often over-hyped in business situations where there the management is making key technological decisions, rather than letting the people who are actually in a position to know what would be a good design paradigm (basically, the programmers) choose. If some executive gets a really nice, flashy demo from Rational, Microsoft, or ATG, they're probably going to believe a lot more of the buzzword/technobabble that the salespeople throw out there than an experienced developer would.

      However, it's pretty impossible to argue with the productivity that something like COM or JavaBeans allows for non-mission-critical systems (or with EJBs, even for some more advanced systems, so long as you follow the 'rules'). Visual Basic, Java, et. al., can do a very good job of allowing programmers of many different skill levels to produce working code, and that, guys and gals, is often all that matters.

      The programmers who claim that OOP is the only way to go are often the ones who really don't care to understand any other design paradigms; I've known quite a few developers who were basically only in it for the paycheck, and since OOP and component systems were hot in the business world, they did everything they could to play along. Hell, I work almost exclusively in Java at the office, 'cause that's what the (business) people want. At home, it's Perl, Python, and ML, but I can only afford the time and hardware to play with those languages because of my day job.

      Like it or not, business programming is becoming more and more one of the new "blue-collar" occupations. Most people doing it are there because they like the wages and the predictable work, not because they're hardcore geeks.

    11. Re:common misconception by SpinyNorman · · Score: 3

      Sure OOP is a design technique not an attribute of a language (although some make it easier than others), but your example is bogus.

      A data structure is a structure, not an object.

      If you add the methods to manipulate the structure (via function pointers if you're using C), then you have an object.

    12. Re:common misconception by segmond · · Score: 2

      good point, but it is hard and not natural! just like you can say that, it is like saying one can write strucuted and object oriented code in basic, ask any basic programmer, they will agree, but what use is basic if you can't use your goto etc?

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    13. Re:common misconception by RevAaron · · Score: 2

      Binx is right. If those functions could be called (generically, without specific reference to the "class") purely in context of the struct/object, without knowing the special names of the "methods," (window_init, &c) and simply with init(), then it would be approaching it.

      But who cares? You can write OO assembly as well. Neither OO-C or asm accomodate it to the point where it's very useful.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    14. Re:common misconception by 0xdeadbeef · · Score: 5

      It's also true that you can do good object oriened design with a Turing Machine, implemented in the Game of Life, composed of a million midgets wearing reversible parkas, which is directed from above by an Elvis impersonator in a hot air ballon shaped like a guitar.

      That isn't saying it's a good a idea.
      --
      Bush's assertion: there ought to be limits to freedom

    15. Re:common misconception by Anonymous Coward · · Score: 4

      I agree.

      OO is just a handy way of structuring large systems for maintainability. It is extremely useful for what it does, but isn't magic.

      People who dismiss OO out of hand are making the same mistake as zealots who insist that it must be used for everything by rejecting a useful tool.

      Structured programming, functional programming, OO etc are all extremely useful given the right problem domain. The skill is being able to look at a problem and pick the correct tool for the job. Rejecting, or choosing, something automatically can be a very good way to shoot yourself in the foot.

    16. Re:common misconception by BinxBolling · · Score: 2
      One classic example is a program that draws a bunch of different shapes.

      I'm familiar with this example: I've implemented it myself, although the "shapes" were actually 3D objects being raytraced, not drawn. I was using C++, and that language's features made it possible to very cleanly and elegantly express what I wanted. Since I got comfortable with C++, I won't touch C with a 10 foot pole, unless I absolutely must.

      But for the sake of discussion, let's modify your code slightly: Take the case statement and wrap it in a procedure named DrawShape, which will be used consistently throughout the rest of your code. Having done this, it's really a matter of

      shape.Draw()
      vs.
      DrawShape(shape);
      Now, the second version still has certain disadvantages. Most significantly, you have to manually maintain the DrawShape function yourself, increasing the possibility of bugs (since you might forget to update it, whereas the compiler would never forget to generate vtable entries for a new subclass of some abstract base). This will get even worse when you have multiple programmers creating shape types and needing to maintain a single shared DrawShape function.

      Still, this scheme means that all changes to how the shape "type hierarchy" works are isolated from the rest of the program. The rest of your code doesn't have to worry about the specific 'subtype' of shape that it's trying to draw at any given time, and if you want to add a Triangle shape type, you merely have to write DrawTriangle (which you have to do, anyways) and add an entry for it to the DrawShape function.

      Again: I think that OO is ultimately an approach to constructing programs that is more-or-less independant of the languages we choose for implementation. Some languages may make it more natural, but few make it impossible.

    17. Re:common misconception by aardvarkjoe · · Score: 3
      (Go figure; that post just gave me my bonus back. Time to lose it again :)

      Well, OOP should be used for things where the data structures resemble (in some way) real-world objects. For instance, games and other things that simulate physics can benefit from object-oriented design. Databases with dissimilar chunks of data might be easier to deal with using OOP. It may be helpful to represent other computers or programs as objects, in applications that require large amounts of intercommunication and response.

      OOP essentially downplays procedural programming, but (at least I) tend to find many things procedural, which would have to be twisted up to fit into the OO paradigm. Anything that does an easily-definable process, such as most system utilities and so forth, is probably not suited for OOP. Back to games, I recently wrote a 'roguelike' game: although the code dealing with monsters and items was somewhat object-oriented, the game logic itself was procedural. Programs that primarily deal with large amounts of raw data should probably deal with it in a procedural rather than OO manner.

      --

      How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
    18. Re:common misconception by David+Gould · · Score: 2


      With the structure+procedure approach, the code would have to be...
      [sample switch statement which really isn't that bad, either]

      Oh, yeah?

      typedef struct Shape {
      //"data members" (scare-quoted because it's not really a class)
      int top, left, bottom, right;

      //"methods" (scare-quoted because it's not really a class)
      void (*Draw)(struct Shape *s);
      } Shape;

      void DrawCircle(Shape *s);
      void DrawSquare(Shape *s);

      int main(int argc, char **argv) {
      Shape s1, s2;
      s1.Draw = DrawCircle; //s1 is a Circle
      s2.Draw = DrawSquare; //s2 is a Square
      //set other fields

      s1.Draw(&s1);
      s2.Draw(&s2);
      }

      See the difference? The function pointer makes the struct just as polymorphous as a class would have been. Sure, the extra argument is not as nice aesthetically, but you can't think it makes that much difference. Yeah, yeah, OOP has more powerful features, like inheritance (make the second struct have an instance of the first as a member and refer to its fields explicitly) and mulitple inheritance (being forced to refer to inherited fields explicitly might actually make things clearer to someone trying to figure out what function -- sorry, method -- is being called), but for many purposes, you can do what you really need without it. OO languages provide syntactic sugar to make OOP more convenient, but those constructs are not essential to the idea of OOP; applying OOP concepts without them is just more tedious.

      Even this misses the point, though, if you ask me (not that you did, but let's pretend): I would contend that even your switch statement example is object-oriented "in spirit", even though the code is not, because it is still designed around program entities representing things: there is an abstract concept of something called a "Shape", that concept is extended into concrete things called "Circle"s and "Square"s, and there is an action "Draw" associated with Shapes. OOP syntax has only a little bit to do with OOP design. If your program is designed around entities (whether they are implemented as plain structs, fancy structs with implicit function tables [i.e., classes], data-driven tables, or whatever else you can imagine) that represent the concepts and/or things that the program is intended to deal with, then the design is, at least in some sense, object-oriented. You can call it "structure-oriented" or "thing-oriented" if you want, but really, what's the difference?

      I tend not to think of OOP as necessarily a language feature (though it can be, and in some cases is very useful as such), or even a design methodology (though it can be, and in some cases is very useful as such), so much as a way of thinking about code and how it relates to and reflects the real world. In that sense, almost anything you could possibly do (with some exceptions) will share some of these concepts, even without being directly "object-oriented".

      David Gould

      --
      David Gould
      main(i){putchar(340056100>>(i-1)*5&31|!!(i<6)<< 6)&&main(++i);}
    19. Re:common misconception by cyber-vandal · · Score: 2

      That's because most programmer tasks are mind-numbing fire-fighting, due to the poor design of the original system. I enjoy coding when I get the chance to do it, but I only think of the money when I have to unravel some piece of spaghetti that was badly-specified and changed dozens of times. I much prefer to write my own code, but there's plenty of shit code around that companies are quite happy to pay outrageous wages to have maintained.

  8. Re:Wrong by scrytch · · Score: 2

    > Pray tell, how does run-time instantiation have anything to do with either encapsulation or abstraction?

    Simple. You can do abstraction in anything, even turing machines. Encapsulation is done in objects, otherwise you don't have encapsulation so much as namespaces. Not much encapsulation going on if you only have one capsule, neh?

    --

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  9. Hammers, nails, screws... by David+Gould · · Score: 2


    I've always liked that saying (in various wordings):
    "If you give someone a hammer, problems will all start to look like nails to him."

    To really drive the point home, I like to add:
    "...and what would he do if given a screw?"

    There's also a response that I came up with once when a friend and I were talking about the coolness and power of some particularly cool and powerful Lisp-related thing (lest my previous post and/or my sig make me seem like just an old-fashioned C hacker):
    "A sufficiently powerful hammer can turn any problem into a nail."

    David Gould

    --
    David Gould
    main(i){putchar(340056100>>(i-1)*5&31|!!(i<6)<< 6)&&main(++i);}
  10. Re:Tell us something we don't already know... by Omnifarious · · Score: 2

    I gave up and decided to write in Python. It's still kinda complicated, but at least that's just because the code is doing something complicated.

  11. Re:Wrong by Mr.+Slippery · · Score: 2
    Think about it a minute. What does a C++ compiler do? It translates the (high-level) C++ code to (low-level) assembly code.

    Actually, it's worth noting that the original C++ implementation was a precompiler - it translated C++ to C. (I believe that this would be very difficult or impossible to do with today's C++.)

    Can you do object-oriented stuff in C? Yes. It's often hideous, though. Motif was one such attempt. The horror...the horror....

    The key attributes to a well-structured program (OO or not) are encapsulation and abstraction.

    Can you get these in C? Yes! File scoping is the most underappreciated feature of C; it's often negelected because of poor revision control systems that end up encouraging a one function, one file paradigm. When you use it properly, though, you can put code and data members in a package with well-defined interfaces and the option of private data members. It rocks.

    Can you screw things up by inappropriate use of OO strategies? Sure. Object-obfuscated designs with spaghetti inheritance are common, and are usually caused by becoming infatuated with inheritance and polymorphism at the expense of encapsulation and abstraction.

    Tom Swiss | the infamous tms | http://www.infamous.net/

    --
    Tom Swiss | the infamous tms | my blog
    You cannot wash away blood with blood
  12. Re:"Object-oriented" languages (oops) by Richy_T · · Score: 2
    Operator overloading is a C++ feature, not an OO feature.

    But it's not the global shift operator that's been overloaded, it's the shift operator associated with cout. Although it's not an oo feature as such, it is dependent on it. I.e. you're effectively doing cout.print("hello world").print(endl);

    Rich

  13. Re:"Object-oriented" languages by crgrace · · Score: 2
    For example, I claim that the following program is legal C++ code:

    cout However, I wouldn't dream of claiming that the program is "object-oriented" simply because C++ is perceived to be an "object-oriented" language.

    You know what? cout is an object oriented function! You can send it strings, characters, integers, and floating point variables without having to indicate to the complier what you are sending, as you do when using printf() in C. Try a better example. In fact, since C++ is a superset of C, I would submit that THIS is a truly non-OOPed C++ program:

    int main() {
    printf("%s\n","hello world!");
    }

    Now, THAT would compile with g++ and doesn't use anything OOP.

  14. Perl is easy so lots of non-pro's use it by Morgaine · · Score: 2

    There is some truth in this, in the general case. When something is easy to use, you don't need to be a professional to use it. And when you're not a professional you will in general make a less-than-professional job of it, even if it looks OK to you --- you just don't have the background to judge good from bad.

    --
    "The question of whether machines can think is no more interesting than [] whether submarines can swim" - Dijkstra
  15. Re:Article Only Proves Low Education Level by ftobin · · Score: 2

    On the other hand, Perl powers Slashdot, so I guess this is the place for the procedural approach to have its message heard. In fact, Slashdot totally vindicates the article: its non-OOP approach is fast, effective, efficient, and easy-to-understand. Highly scalable and expandable as well. I especially like Slash.pm (aka THE BEAST) and the my_conf{shit} variable. I'm sure the non-OOP approach will really take off once everyone switches over from C++/Java to Perl.

    I wouldn't put down those who write in Perl that much as being anti-OOP. There are many, many of us who write and like OOP in Perl (it's especially useful to read Damian Conway's "Object Oriented Perl" to see the beauty of Perl's OOP.)

    OOP in Perl, actually, is much more fun than other languages because of it's flexibility. For instance, Class::MethodMaker is capable of creating accessor methods for various types of data members of objects at compile-time; this is a beautiful thing. Perl's flexibility has a whole lot of other things that allow fantastic OOP, and "Object Oriented Perl" expounds on much of this.

  16. The Defense is Self Evident by Skip666Kent · · Score: 2

    You're soaking in it, and probably have been for years!

    The chief objective of computer programming is too create useful things. Elegance is tremendously valuable but secondary. NO OTHER interactive message board has come close to Slashdot in terms of useability, readability and even whiz-bang features.

    --
    **>>BELCH
  17. Re:Article Only Proves Low Education Level by Shotgun · · Score: 2

    How small is a small business app?

    Didn't the author say that this is a question that needs study?

    We have both enterprise-scale and small-business scale versions, but neither would survive long as a procedural app.

    And your still a software house building apps for other businesses. The software you produce is your product, so you expect to extend and improve upon it. You don't expect to throw it away at the end of the quarter/project/fiscal year. It wouldn't last long as a procedural app, but the authors point was that most of the software he has been commissioned to produce doesn't last long...period.

    Moreover, the enterprise "niche" is the greater part of the software market.

    Your point being...?

    There's no reason to object-orient the shitty little linux apps that you use, since they are usually 1-2 wannabe code monkeys writing bad C++.

    OK. A personal attack. So if someone disagrees with you then their applications are shitty and they are code monkeys. Or is it that when someone buys the hype and uses the it-applies-to-everything sledge hammer to build a picture frame and ends up with a mess, then they are wannabe carpenters. Oh, and by the way, Chevy's suck.

    Any multi-employee project requires the kind of abstraction that only OOP provides.

    So you're saying that there are no large projects except those using OOP techniques?

    I read as much of the article as I could stomach before his baseless graphs and lack of data made me stop, but I saw enough to know an Epsilon Minus Semi-Moron trying to sound academic.

    You couldn't stomach what he had to say because it challenged your close minded view of the world. The author didn't present data, because (as he repeatedly pointed out) there is no data to present. OOP is hyped as the next big thing, but no one has studied the parameters of when, why, and where it is successful in any meaningful way. He stessed at the start of the article that he was presenting his view of the world and where he was oriented in order to have that view. His article was a data point and asked questions. Scientist and academics don't just present data, they also gather, analyze and question data and assumptions. Assholes and idiots, on the other hand, resort to name calling and flaming when their ideas of their own superiority is called into question.

    It was a pathetic article, and anyone with a college degree and a smidgen of programming experience would tell you the same thing. It certainly provided a lot of laughs in my office.

    There are a lot of people with college degrees and lots of programming experience who would say that it is a quite well thought out article. Many with the same credentials would say that the article is mediocre flaimbait. Either way, if this is what produces laughs in your office, then you need counseling.

    Overall, the author tried to point out that no language is appropriate for all projects and tried to set parameters where one language/style of programming would be better than others. Of course, some people who only know OOP, believe that OOP solves everything and get upset when someone suggest differently.

    --
    Aah, change is good. -- Rafiki
    Yeah, but it ain't easy. -- Simba
  18. This Goes Back to one thing by jjr · · Score: 2

    How people like just get it instead of getting gone right. If you start your project does not matter which language you use or the programing method as long as you choose the right right for the job. At school people are always asking way I use c instead of c++ I simply say I do not need c++ right now therefore I do not use it.

  19. Re:Some zealottery is good by BeanThere · · Score: 2

    But what evidence do you have that these concepts lead to good design

    Holy cow, did you even read the part of my post you are quoting? I said it DOESNT lead to good design. Good design has nothing to do with the paradigm you're using. You must have been in a seperate universe or something when you read my post, you've missed the whole point.

  20. Re:GUI's vs GUIs by FunkyChild · · Score: 2

    I think you'd better have a look at this, pal.

    http://www.angryflower.com/bobsqu.gif

    Apostrophes are certainly NOT used for plaurals in any way, shape or form! I think I know who needs a slap in the face...

  21. Orbix? Yuck! by Malc · · Score: 2

    Orbix. Bwwhahahaha! We ditched that for TAO (a free open source, standards complient ORB). Even if Orbix were the fastest, the cost you pay in bugs, non-standard implementation and dreadful customer more than outweighs any benefits.

    It's 2 years since I used it. Back then it felt like a bad port from UNIX to Win32. We couldn't have any COM DLLs talking to our CORBA services. Why? Orbix spawned some threads and provided no way of deleting them. This caused crashes when the COM DLL unloaded, or it caused a crash on exit as the process shut down. Unusable.

  22. Re:Wrong by plastik55 · · Score: 2
    Unfortunately some people have strange hangups about language. For example RMS, for whatever reason, urges GNU programmers to write ANSI C and *only* ANSI C. So you get things like GNOME and GTK, which, though thoroughly object-oriented in design, have to be written is the object-oriented C idiom.

    Looking through the sources of GNOME and GTK is quite a trip--it *seems* well-organized, and probably is. But the language idioms used are frightening--it's C, and legal C at that, but at what cost? No one offers training in this dialect--universities use object-friendly languages when teaching object-oriented design, and businesses use object-friendly languages when they need object-oriented design.

    The clearest book on C++ I've read comes in near 1000 pages. If I want to contribute to most GNU projects, I have to generate the knowledge of their equally complicated pidgin OOP-C for myself by staring at reams of barely-commented source code. If written in C++, the code would be identically fast and have 25% the footprint, and probably fewer bugs too. But RMS says no, so they don't do it that way.

    --

    I have a positive modifier on Troll. When I mod someone Troll their karma should go UP!

  23. Re:OOP...in BASIC? by Chester+K · · Score: 2

    A company named Thoroughbred has an Object-Oriented programming environment built around Basic called OpenWorkshop. The company I work for has a several million lines of code written in it.

    Now, I'll be the first to admit, their idea of "objects" strains the definition a bit, but with a very loose interpretation of what OOP is, this fits the bill.

    --

    NO CARRIER
  24. Re:more empty claims by smack.addict · · Score: 2
    Well, I will pit well-designed procedural/relational apps against well-designed OO apps any day.

    I would claim that any well-designed procedural app looks a hell of a lot like an OO app. Relational and object are technologies that can go together, they are not mutually exclusive concepts.

    I see nothing inherant in OO that really improves maintenance in the business domain. Inheritance does not model business things well, and OO's version of HAS-A is messier than procedural IMO because you have to have an object reference attached to lots of stuff and find a class to stick every method into, even if it should be self-standing.

    Inheritance != OO. Inheritance is a necessary property of an OO language, but that does not mean one should use inheritance every chance you get. Properly used inheritance is like a good spice--use it sparingly. A sign of a bad OO system is one with deep and/or complex inheritance hierarchies.

    The advantage OO has is that it is a discipline that describes how you write well-designed components. Procedural is not analagous to OO, as it does not prescribe in any way how you properly design your code.

  25. Re:Reply to your claims by SpinyNorman · · Score: 2

    [quote] It is a clean module packaging mechanism that encourages cleaner interfaces between modules [end quote]

    Modules are available in some procedural languages also. (Don't bring up state. It was already mentioned.)


    I was specifically referring to the benefits of C++ over C, and in the real world many programmers don't even have the discipline to structure C into module definition (.h) and implementation (.c) files, or even to use #ifnedf/#define protected headers. I programmed in Modula-2 for many years, and it's a great language, but hardly an option for most projects today, and certainly lookigng rather dated in terms of features.

    [quote] It encourages opaque data interfaces (method access vs public access) which results in less bugs [end quote]

    Real-world business example?


    How can you feel qualified to write an opinion piece on design technique (OOP) if you can't understand this without an example???

    Let me spell it out for you:

    If you make a C++ data structure member private, and *only* accessible via methods, then you remove the possibility of people using your class accessing or modifying the data structure in incorrect ways. One source of bugs made IMPOSSIBLE.

    BTW, who said anything about business programming?

    If anything, this tends to create set/get bloat--One of the silliest structures that is just crying out for some sort of cleaner factoring. Also, they can often be replaced by good data dictionaries.

    Usually the data structures involved would be something more complicated than a variable that can be "set or get"!!!

    With your comment on data dictionaries, you again seem to want to limit the discussion to business, and specifically database related, programming! Odd.

    [quote] It makes use of self-initialization/cleanup (constructors/deconstructirs) that avoid a whole slew of programmer errors. [end quote]

    I just got chewed out by readers who claimed that defending my garbage-collection myth was a strawman because nobody believed except a few dummies.


    I'm talking about C++ constructors and destructors period. Who said anything about garbage collection??

    In short, you are comparing C to C++. C is NOT the pennacle of procedural/relational programming.

    Is this meant to be a practical discussion or not. In the real world there are very few widely used languages. Outside of the modern scripting languages like Perl/Python/etc, and leaving aside specialty anguages like VB, you've basically got C, C++, FORTRAN, COBOL, Java, and Ada if you work in the defense industry. Where's your pennacle [sic] of procedural languages? Ada?

    [quote] The self-containedness of objects does make code reuse simpler and less bug prone. [not quote]

    Specific example?


    Huh? Are you challenging that statement???

    Perhaps you think it's easier to resuse code when there's MORE to think about and get right, rather then LESS?

    Again, these all sound great on paper, but when specifics are looked at by the non-indocrinated, the ugly grey of OO thinking starts to ooze out.

    I'm neither talking about on paper, nor am OO "indoctrinated". I've been programming for over 20 years in languages including 6502/Z80/68000/16032/x86 assembler, BASIC, FORTRAN, COBOL, Algol-W, LISP, Pascal, Modula-2, C and C++. IMO C++ is simply the best general purpose language available today for utilizing the sound prgramming techniques I've learned over the years, and OO is to a large degree just a modern name for design techniques that have been around for years, but are now better supported.

  26. Re:word games by AME · · Score: 3
    Many OO debaters often stretch the meanings of the the big three (poly, inher, encap) to mean whatever they want them to mean. ... "Encapsulation" is such a vague, watered-down word that it can mean just about anything you want it to.

    Just because many people don't understand the definition does not mean that the definition is vague or watered-down.

    Anything that is "not at the right spot when you need it" can be blamed on "lack of encapsulation".

    I would more likely blame lack of coherent design. But lack of encapsulation can result from the programmer hacking his way around the encapsulation to solve the problem.

    Note that many of the goals of OO can be achieved in ways that are not necessarily OOP.

    Agreed.

    --

    --
    "I have a good idea why it's hard to verify programs. They're usually wrong." --Manuel Blum, FOCS 94
  27. Re:Wrong by scrytch · · Score: 2

    Can you get these in C? Yes! File scoping is the most underappreciated feature of C

    Pray tell, how do instantiate a file at runtime?

    --

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  28. Re:My view by scrytch · · Score: 2

    > To use a language (any language) you have to grok it

    I don't know why, but I just can't stop chuckling after reading that

    --

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  29. Re:bad code == secret language == job security by panda · · Score: 2

    Yeah, exactly.

    So, maybe I exaggerated with the "massive improvements" bit, but I'll tell you that it's certainly more fun to code using some kind of plan/design. In my case, usually OO, and usually in C, C++ or Perl. Nothing better than reuseable objects if you ask me.

    At my previous place of employment, there was an attempt made to do that very thing: build a reuseable framework of objects for the business software. There were problems galore with making this work because one of those drag and click types of commercial "programming" tools was chosen, where you create graphical objects on screen and then add code inside the objects, code that's tied to that graphical representation and to that object. In other words, the code was not factored at all, and if you needed a different widget, or even no widget, that implemented the same business rules in code, then you had to rewrite the functionality from scratch. Very poor planning, and just shows that the problems with OO are not really problems with OO but with OO that is misapplied by developers who don't really understand the paradigm.

    --
    Just be sure to wear the gold uniform when you beam down -- you know what happens when you wear the red one.
  30. Re:OO is all about components??? by smack.addict · · Score: 2
    You just got through saying that most of the time inheritance is used sparingly in good OOP?

    Sparingly is not the same as not at all.

    What is left? Encapsulation? That is a loaded issue because what aspect to "encapsulate" by is not cut and dry.

    Encapsulation, polymorphism, and abstraction. And encapsulation is the big piece. In OO parlance, it means to capture the data behind a concept along with its behaviors--and not expose that behavior and data willy-nilly to the public.

    So OO is all about component design?

    Not entirely, but it is the most critical element. An OO language is simply a language that maps well to OO component designs.

    But there is also OO analysis.

    That does not sound like a majority OO fan stance to me.

    It is probably not what you hear from the inexperienced Java and C++ programmers who think they know OO because they are using an OO language. However, most OO experts will tell you the language and the technology only have a secondary importance to the OO-ness of a system. It is the design.

    Besides, the making of components themselves are not what most custom application programmers do. Does that mean that OO is nearly useless for them?

    What are you talking about? Custom does not imply not componentized. A custom application can be built from existing components. Similarly, just because you are writing something for the first time does not mean it is not a component.

    Procedural tends to emphasize grouping (encapsulation) by actions, while OO tends to emphasize grouping by nouns. This is perhaps an over-generalization, but seems to hold true time after time.

    This is a crude description that serves only to help someone who has no understanding at all of the difference between OO and procedural so they can get an initial grasp of the concept. OO is about modeling a system, not programming. It looks at the processes to be modeled, aka use cases. Note, OO starts with actions! The system then looks at the things involved in these actions and the ways in which they interact. Then classes are built to model the things and their interactions. OO is things and their actions, procedural is nothing more than actions. And that is why procedural applications are poor models of the processes they are supposed to be modeling.

  31. Re:The macho paradigm? by jilles · · Score: 2

    RDBMS systems are certainly usefull, nobody said they weren't. However, OO databases do partition things more naturally, at the cost of performance. Often RDBMS systems are wrapped by a middle ware layer to hide the complexity and emulate OO behavior while retaining the performance and scalability associated with RDBMS systems.

    Comparing OO Components to procedures is just plain silly. They are different concepts. Read Szyperski's book on components (and yes, non OO components do exist).

    "The real world does not give a rats behind about fat-type trees. It will change any way it feels like."

    The real world is also full of fools who make the same mistakes over and over because they think they are experts while in fact they are not.

    "A graph-oriented approach like relational modeling and HAS-A relationships model this aspect of the real world better."

    You should take a look at adaptive programming and aspect oriented programming. (use google to find the relevant material). Both approaches extend the OO paradigm to support what you want.

    --

    Jilles
  32. Re:Orthogonality Problems by smack.addict · · Score: 2
    Another sounds-good-on-paper statement that I have been unable to translate into real benefits. How about a realistic example. I find it hard to draw a single wall around things in a system without creating a nasty little bureaucracy for the team. The "walls" depend on the aspect that you want to view things by at the moment.

    No, you appear not to understand OO encapsulation at all. The aspects you speak of are nothing more than views of the object, and it has nothing to do with encapsulation.

    OO encapsulation actually works very well in the real world. Consider, for example, the use of a Date object instead of a char array or even a long. With the Date object, you have one place to fix your Y2K problem if you made the mistake of storing the date internally in the Date object as a char array with the year in 2 digits. If you make the same mistake in the procedural world, you end up with a big ass bug that costs a hell of a lot of money to fix.

    Look at something like the OO Visitor Pattern. That is the mess created by increasing the aspects by *one* dimension. Add another, and kapoof!

    If you think it is a mess, then you do not understand the pattern. The Visitor Pattern helps eliminate the mess the same code would otherwise have in either OO or procedural realms. And, the Visitor Pattern is also overused in places where it is not appropriate.

    Close enough. Languages should only support fairly common things, not blue-moon things. Otherwise, it ends up being and electronic packrat or offer arbitrary features for bored programmers to futz around with (and they *do*).

    Ugh, it is not "close enough". It is nowhere near close enough. Most classes in an OO system will inherit from something else. Sparingly means that your inheritance trees are simple and shallow.

    Yeah, everybody bashes everybody else's modeling techniques, even WITHIN the OO community. This is what happens when there are no metrics. Metrics are the cops of ideas.

    First, this paragraph changes the argument. Your original point was that a lot of OO "fans" seem ignorant that OO is about design, not coding. Now you say that the problem is everyone is bashing everyone else's modeling techniques and there are no metrics. A different argument.

    On the new argument, however, you are still wrong. There are formal processes, with the Unified Process being the most widely accepted process. And as with anything, there are expert OO modelers and there are wannabes. Expert OO modelers are getting the job done.

    I hope you are not one of those who try to generitize everything.

    Nothing I said suggested I do. So the rest of the paragraph that follows is meaningless since it is based on that assumption. However, your claim that you can never have true genericity is absurd as trying to make everything generic. What do you call the Date class in Java?

    On use cases, This is not really OO, per se.

    Uh, yes it is. It is the starting point of OO software engineering. Non-OO processes do not model things in this manner. They start with workflows and decision trees, which are very, very, very different from use cases and object interactions.

    The rest of your post is on how you think your tables and procedures are the best models for a reporting system. First of all, your dismissal of OO for this problem shows a poor understanding of how the modeling should be done. ER data models are nothing more than collections of DATA and ways of relating the DATA. While the data is data about things in the real world, the table structure is only indirectly and poorly a representation of the thing being modeled. The result is that systems relying on the relational database as a model of the business processes end up being difficult to impossible to maintain over the long haul.

  33. Re:OOP *is* really the next level by Adam+Wiggins · · Score: 2

    I'm not really that concerned with convincing anyone, in truth. If there are good tools available and you choose to make your own work harder by ignoring them, it's no sweat off my back. :)

    However, here's a quick example where OO excels. I was in the game industry for many years. Virtually all games involve a bunch of "things" moving around on the screen, anything from spaceships and laser beams to puzzle pieces falling from the sky.

    For years I struggled trying to reconcile the fact that all of these "things" are very similar in many fundamental ways. They all move around and bump into other things. They all need to be saved to disk and loaded again at savegame time. They may need to blow up or otherwise be destroyed when certain game events happen. And of course, they need to display themselves on the screen somehow. Yet they are all very different - the logic that controls, say, an homing missle is quite different from the logic that controls the player character, for example.

    During this time I wrote hacks involving void points, casting, functions with huge "switch" statements at the top to try to figure out what something was, and other roundabout ways to handle all the similar functionality of these things in one place, yet still allow for all the special code that goes with each type of thing.

    OO solved all of that nastiness for me. It pretty much works the same in the end, but it's much easier to code, and *vastly* more maintainable. I can now make a base class entity, and derive all my specific types of things from them. I have virtual functions for Move(), Collide(), AI(), Update(), Draw(), which have defaults, but I fill them in with special code for each type of thing, and I never have to duplicate my basic motion/collision/whatever code, nor are there any messy hacks to be able to put all these types of things into one giant list of entities, but still have each thing "know" what it is and how to behave.

    It's more complicated than this, but that's the gist of it. Every game company I've worked at has used this scheme almost exactly (although the terminology may differ) because it works so well.

  34. Re:God's Hierarchies by Arandir · · Score: 2

    Who said anything about hierarchies? OO doesn't have to be hierarchical at all. Few OOLs require all objects to be derived from some base class. C++ certainly doesn't.

    --
    A Government Is a Body of People, Usually Notably Ungoverned
  35. Re:Another reason ... by FunOne · · Score: 2

    All the things you've mentioned are compiler isssues.
    FunOne

    --
    FunOne
  36. Evolving interfaces by Chalst · · Score: 2
    The author makes two valid (but unoriginal points): firstly that
    trying to do everything with inheritance is bad (every non-novice OO
    programmer agrees), and secondly that you don't support for classes
    and objects to get the benefits of object orientation (but you need
    first-class functions and dynamic/existential/abstract types, obvious
    to the LISP world for over twenty years).

    Object orientation makes it easier to manage changing interfaces.
    Support for object orientation makes it easier to achieve this in
    programming practice. The author seems so upset about bad designs he
    has encountered caused by an inflexible, deep inheretiance that he
    seems blind to the fact that OO support can facilitate good design.

  37. Re:People think in objects by sjames · · Score: 2

    One of the basic assumptions is that the human brain is built to think about the world in terms of things that have properties and behaviour. We can think in terms of procedures and execution flow as well, but we're not nearly as good at it.

    The problem is, humans tend to think in terms of something acting on something else. With the data and methods mixed together, it feels like building a house by 'asking' the nails to hammer themselves rather than 'asking' the hammer to act on that nail.

  38. The real benefits by SpinyNorman · · Score: 4

    The article is vapid since it addresses a collection of OOP myths that don't cover the real benefits, and secondly comletely ignores the practical reality that for most people the OOP/procedural choice is C/C++ choice, and that C++ has many features (such as constructors/deconstructors) that while not necessary for OOP, are huge benefits.


    Myth: OOP is a proven general-purpose technique
    Myth: OOP models the real world better
    Myth: OOP makes programming more visual
    Myth: OOP makes programming easier and faster
    Myth: OOP eliminates the complexity of "case" or "switch" statements
    Myth: Inheritance increases reuse
    Myth: Most things fit nicely into hierarchical taxonomies
    Myth: Self-handling nouns are more important than self-handling verbs
    Myth: Only OOP has automatic garbage collection
    Myth: Components can only be built with OOP
    Myth: Only OO databases can store large, multimedia data
    Myth: OODBMS are overall faster than RDBMS
    Myth: C is the best procedural can get
    Myth: Implementation changes significantly more often than interfaces
    Myth: Procedural/Relational ties field types and sizes to the code more
    Myth: Procedural/Relational programs cannot "factor" as well


    Classic OOP features such as inheritence may generally be over-hyped, but specific cases such as polymorphism are very useful (even if there are ways of doing the same thing in languages such as C that were not designed for OOP).

    Some of the major benefit of OOP, and specifically C++'s objects, are:

    o It is a clean module packaging mechanism that encourages cleaner interfaces between modules

    o It encourages opaque data interfaces (method access vs public access) which results in less bugs

    o It makes use of self-initialization/cleanup (constructors/deconstructirs) that avoid a whole slew of programmer errors.

    o The self-containedness of objects does make code reuse simpler and less bug prone.

    etc, etc.

    The guy who wrote the article (and the esteemed Mr. Taco) appear not to have much hands on experience writing OO code.

    1. Re:The real benefits by PSC · · Score: 2

      Disclaimer: I code in C++ mostly and am generally positive towards OOP... as long as it's done pragmatically! (As opposed to those religious OOP nuts.)

      Some of the major benefit of OOP, and specifically C++'s objects, are:

      o It is a clean module packaging mechanism that encourages cleaner interfaces between modules


      Which is definately a Good Thing if done properly. Point is, in my observation, for most people it seems to be MUCH easier to define proper procedural interfaces than to design proper OOP ones.

      o It encourages opaque data interfaces (method access vs public access) which results in less
      bugs


      Only it the accessors do any check! In our current project (high energy physics) we have lots of objects which consist largely of floating point numbers, and you can't do much checks. So accessors make no sense here. If the data structures change, the client code has to be changed anyway because we can't take a performance hit. (This happened exactly once in more than a year, so what?)

      o It makes use of self-initialization/cleanup (constructors/deconstructirs) that avoid a whole slew of programmer errors.

      Granted, they are very useful indeed, but, as you say, not necessarily OOP.

      o The self-containedness of objects does make code reuse simpler and less bug prone.

      I don't buy that one. A well-designed C module is just as easy to maintain and reuse. Basically classes (without inheritance) are just structs with syntactic sugar (i.e. the first parameter, "this" in C++, is written in front of the function name).

      Cheers, patrick

      --
      --- The light at the end of the tunnel is probably a burning truck.
  39. Re:reusability... by slim · · Score: 2

    Properly implemented, code re-use can pay off immediately.

    I don't know very much about OO -- I learned about it at University (in Eiffel) but it never 'clicked' and I always found OO design to be something of a strain. I only mention this to demonstrate my bias :)

    However, you seem to be implying that code re-use is something you only get from OO, and that just doesn't make sense to me. I really only code in C and Perl these days, and I reuse code all the time.


    --

  40. Table-Oriented + OOP by theonetruekeebler · · Score: 2
    The article really hyped the idea of table-oriented programming. I've seen both brilliant and horrible example of T.O.P. since I started programming. The horrible examples were, of course, the ones where the developers insisted on absolute purism in every corner of the system. This is true in just about any development environment--the difference between reality and a model of reality is that reality usually doesn't fit into models very well, because it is a inherently a superset of any model.

    And I've seen at least one OOP project go down the tubes because the designers, among the smartest people I've ever met, treated data persistence as just another implementation detail--they had been seduced by the model of a computer that never fails and has unlimited memory.

    But one of the most successful projects I've seen is one where an object-oriented framework provided a transportation and communications infrastructure on which table-oriented applications could be developed. OOP gave us just right level of hierarchical abstraction to make platform-specific issues irrelevant to higher layers; at those higher-layers, the mind-boggling flexibility of table-driven rule sets provided a potent way to model business processes without trying to put everything in exactly one box.

    I do believe we are heading for a convergence of sorts. The tables in question are going to be XML, with Java (or pick another OO language) providing the framework in which (and with which) to parse it.

    --

    --
    This is not my sandwich.
  41. This is not just OOP versus Procedural by Tom7 · · Score: 2

    There are lots of paradigms around. You can go ahead and choose your favorite, but let's not make this an OOP versus Procedural battle.

    Check out abstract, typed functional programming in a language like SML, O'Caml, or Haskell (I find it's much easier to write abstract modules in these languages than it is to do so in an OOP language). Check out logic programming in a language like Mercury or lambda-prolog. Don't forget the zillions of other genres and subgenres.

    C'mon, slashdotters, it's your responsibility to ignore the marketing hype and use technology because it's superior. Do your shopping before you fall for something because everyone uses it (procedural) or because it's buzzword-compliant (OOP).

  42. there is something to be learned! by segmond · · Score: 2

    i totally disagreed with this article, but i respect the guy, why? because he is not just sprouting shit, he wrote lots of materials and preseneted them from his own humble point of view! learn, learn, learn! is there anyone in slashdot, who is willing to write half as that much to prove him wrong? nah, instead the best most of you can do is flame him with 4 line comments. OOP is not a HYPE, yes it has been overhyped, it is not the cure to all as well, it is here to stay.

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  43. It's a good analysis by scott1853 · · Score: 2

    It tends to be a little too anti-oop though.

    I use OOP and procedural programming because they each have benefits. It enables me to clearly envision the flow of code and make everything modular. It also enables me to manage multiple instances of the same type of object easier. However, it's possible to implement the same functionality in procedural form. And somebody familiar with coding everything as procedures can visualize the code just as easily. If you have used procedural all your life and are familiar with it, then you can perform the same tasks as somebody that is experienced in OOP.

    Using procedures, you may have a separate source file for procs related to working with strings. You could also use OOP to declare a string object, and just put all the functions within the object. Note: The above is just an example, don't EVER waste time with string objects unless you are forced to.

    It's really more of a personal preference than anything else. Synonymous with your wallpaper. In the end, all that really matters is whether or not the software performs its intended function.

  44. Myth... by DaveWood · · Score: 4
    Myth: Implementation changes significantly more often than interfaces

    This is the most stingingly correct point, in my opinion. In fact, in my experience, they change equally often at best. And in cases where code is actually meant to be reused - something which, by the way, some of my smartest friends have told me, after no small amount of experience over the years, never actually happens - its the interface that often proves more likely to need modification...

    1. Re:Myth... by BeanThere · · Score: 2

      And in cases where code is actually meant to be reused - something which, by the way, some of my smartest friends have told me, after no small amount of experience over the years, never actually happens

      Where I work now, we've put a lot of effort into designing reusable components. And it's paying off, bigtime. We've built a powerful, flexible SDK, all our applications use it, and now we save a huge amount of time and money every time we create a new application. Also, by abstracting away a lot of the technical, low-level / difficult stuff, we don't need to hire super-knowledgable people any more to do the applications. Worked for us.

      The thing about making reusable code is that it has nothing to do with the language, and everything to do with good software design. The application also makes a difference. We mostly make Virtual Reality training simulators, so building reusable components has worked well.

      People also seem to forget the "code reuse" that happens every single day. People will spend a few weeks using re-usable components - e.g. write a gtk+ application, using reusable libraries for image loading, re-usable components in the posix stuff, re-usable components in the C and C++ standard libraries - and then at the end of all that they'll come out and say "geez this code reuse thing is a complete myth".

  45. Re:Poor criticism by rw2 · · Score: 2
    I agree with you on this one Neutron. My favorite comment was:

    I just heard someone say that they found an old procedural program of theirs that used too many global variables and too many parameters. Rather than blame his bad programming or lack of knowledge about procedural/relational organization techniques, he blamed the paradigm and used it as a sorry excuse to proceed with OOP.

    Ironic given his very long rant essentially pointed at bad OOP implementations rather than OOP as a paradigm!

    Of course, I run Cetus Links so I may be biased...

    --

  46. core reuse and objects by josepha48 · · Score: 2
    have nothing to do with each other© If you reuse object you can stil get stuck with stuff that you dont want© An object has properties, and it may be that the object that you are using has properties that you probably don't want, but if you use that object you get stuck with them©

    Personally I think OOP is okay in some cases© Take for instance Tcl/Tk© Tk is probably the best GUI programming language that I have ever used© Unfortunately that is about all it is good for© Yes you can do more with it, but I think the GUI is is probably the best© Guess what it is done with objects as well© The button, the text the lable the entry, etc© Tk is also not to heavy as far as overhead either© Some may say that java is better, but I have actually tested a simple GUI text editor and the java editor was slower to start and slightyl slower than Tk© I have also used powerbuilder© Now there is a nice OOP language© To bad it is so slow and flakey©

    I have also tried C/C++ and the problem they both have it memory management© And lets face it trying to figure out do I need to destroy or free this can be a real pain in the butt©

    Personally I'd like to see a language that has syntax like perl, but is compiled and effecient like C© Maybe C with garbage collection© Instead of me having to malloc and free, I'd just declair char * item;, and then maybe item = "string"; Then when I am done with that string I'd forget about it© Sort of like Java, but a language that does not require you to do everything with objects like perl© More like a JavaScript / perl / C / Java cross© Powerscript ¥Powerbuilder is close, but is not a general programming language, it is a propritary language©

    Oh and if you look at KDE and GNOME projects, both have major code reuse and one is OOP and the other is not ¥not really, and they are both awesome works of coding©

    I don't want a lot, I just want it all!
    Flame away, I have a hose!

    --

    Only 'flamers' flame!

  47. Re:Another reason ... by taniwha · · Score: 2
    nope - virtual method calls are a language feature, and calling lots of little subroutines is a coding style encouraged by OO devotees.

    On the other hand a compiler could spend time optimizing this stuff more (maybe more inlining of those tiny calls at least).

    The one thing that is a compiler issue in my posting is the poor use of the call/return paradigm (for example using a jsr to make a call, but not ret to get back means the architecture can't do a hidden [branch target predictor] stack cache to keep the pipe moving - many modern cpus, even x86s do this)

  48. Re:I tend to agree with the author.. by Alioth · · Score: 3
    OOP (IMHO -- I'm crazy for the acronyms today), is just a fad. Like structured programming was before it.. Unfortunately a lot of these companies today fall into "trendy" programming methodologies.

    Structured programming a fad? OOP a fad? A rather long-lived fad then! Software developers have been using structured programming techniques and OO design for years, and will continue to do so.

    Personally, I believe you should program using the style you're most comfortable and familiar with. If you're trying to fit a mold it will slow you down.

    That's fine if you're working on a small project with maybe one developer. But if you had 30+ developers using their own techniques and styles on a large project (like the >1MLOC project I've been working on for the last 5 years) you'll end up with an unmaintainable mess. If everyone conforms to a standard methodology and style then at least you can maintain each other's code.

    This is one of the differences between software ENGINEERING and code that's been congealed instead of designed. Software engineering should result in a robust and maintainable system. Letting every programmer go off and do their own thing as you advocate leads to the truth in the phrase "If builders built buildings the way programmers write programs, the first woodpecker that came along would destroy civilization!" It sounds nice to let the programmer go off and just write in their own style using their own unique design techniques. But it's terribly naive and unrealistic in the real world.

  49. Re:My view by Alioth · · Score: 2
    I am *not* a OOP programmer. To be honest, I've never been able to understand it.

    snip

    And you know what? I've never understood OOP. I just don't "get it." Sure, I understand the theory, but when it comes to real work, I've never understood it.

    It's like if everyone started calling the TV a "forbick". Doesn't make any sense does it? I mean, it's a TV. Why call it a forbick?

    To use a language (any language) you have to grok it, and think in that language or - in the case of OO - in that kind of style. Your example of calling a TV a "forbick" is kind of right on - the French, for example, call cheese "fromage".

    You'll never be a good Francophone if you have to think in English, then translate to French, and say it. You have to actually think in French. Same with computer languages. When I first learned C, I was thinking in BASIC and translating. It didn't really work very well. (BBC BASIC doesn't have pointers for one). It was not until I grokked C and started thinking in C that I got any good at the language. Although it seems natural to think in C then code in C++ because the languages are so similar, unfortunately it won't work out very well. You have to think "object oriented" instead of thinking in non-OO and translating. Once you get to that stage, you'll truly grok OO and its usefulness.

    I'm currently learning Perl. I'm trying to start off thinking in Perl rather than thinking in C++ and translating. So far, it's working OK, but I'm still doing things the C way that would be better done the Perl way, so I guess I'm not truly thinking in Perl yet!

  50. Re:My view by Malc · · Score: 2

    I understand where you're coming from. Everybody's minds works differently. I found structural/procedural programming reasonably straigh forward. When I switched to OO, it felt orders of magnitude more natural, and I never want to switch back. Other paradigms were much harder for me. Functional programming, such as lisp or scheme where a real nightmare... eventually I learnt how do recursion in other languages from the experience. SQL has been the hardest challenge for me... I just don't think in sets like that! That caused me a lot personal grief and stress... I think I'm a reasonable C++ programmer, but when I had to do some stuff the database, I felt incompetent. Eventually I got my mind around that too, but I'm certainly no great SQL guru (and I doubt I ever will be).

  51. OOA article by bmongar · · Score: 2

    Much of this article seems to be OOA, Out Of Ass. The author states many figures such as designing takes 3 times as long with no backup. There are some points but most of the apply to missused OOA&D.

    Object reuse only coming after years. Well, I work for a company that is a big user of object technologies. We have our own data access, mapping, and server objects that are our bread and butter, we can go in and have an application up in little time because we don't have to write most of the functionality, just abstract the business logic.

    Buy in. That is true, if not everyone buys in the programmers will be pulling their hair out, however this is true in the development contract of many methodology.

    Not everything is abstractable/in a hiearchy, true but I find in most of the work I do, it is. There are cases where some of what needs to be done doesn't make pretty objects, but that is the exception

    --
    As x approaches total apathy I couldn't care less.
  52. A longer viewpoint... by whitroth · · Score: 2

    I've been programming for over 20 years now, and, unlike almost anyone here, I've been on mainframes, and PCs, and w/s.

    'Bout 7 years ago, I took some coursework in OOPs and GUI (sounds like someone dropping an egg, to me), and what I saw then was this:
    1) OOD looked real good...BUT the closer you got
    to actual coding, the fuzzier it got (as
    opposed, for example, to flow charts), and
    2) what OOP appears to be doing is enforcing by
    compliler all the good coding practices
    that they've been trying to teach for
    25 years (y'all use goto's in C,
    frequently? how bout type checking?).

    What I've seen since then is that it *may* be possible to write good, tight code in an OO language (though I found the person who worked on chips cmts, above, fascinating), the overwhelming majority of coders write *lousy*, bloated code - you want a clipping of Gojiro's (Godzilla, to those who don't know) toenail, and you get the big guy, himself, with a window frame around his toenail. Explain Lose98, or LoseMe, or M$ Office....

    Reusability - isn't that where knowledgable management assigns the position of librarian to someone (*sigh*, probably the configuration manager), and they make sure that programmers use existing subroutines? Oh, right, sorry 'bout that oxymoron about "knowledgable managers".

    Thank you, some of us would rather master our discipline (check the meaning in the dictionary that doesn't refer to whips), and write good, tight, fast code...that can be maintained by someone else, when we've moved on.

    mark

  53. OOP isn't magic, but it's still great by ZanshinWedge · · Score: 2
    Granted, OOP is not the silver bullet that will solve all your problems as some people seemed to think it was. It will not make your programs automatically more easily updated, faster, and give you a full glossy coat of fur. However, OOP is most definitely not a fad, it is here to stay and will continue to be very important. There are many circumstances where Object Oriented design is completely unnecessary and would give no advantages, however there are also many cases where OOP is in fact the magic bullet that makes everything click together.

    Personally I write OOP only very rarely, but that's partly to do with the nature of my work which is more small program oriented than large system oriented. However, I do find OOP to be significantly useful in lots of occasions. One way that Objects are particularly useful is in extending programming languages. The old style of libraries is somewhat cumbersome and leads to unnecessarily bloated code that is more difficult to read (and to understand easily), whereas extension via object makes immenently more sense and keeps your code (which may or may not be Object Oriented) a lot tighter. Perl demonstrates this excellently since most Perl programs are not Object Oriented, but almost all the "extensions" to Perl that are being written (and being used) these days are Object Oriented.

    And in some ways OOP is still playing catchup with older programming styles, it's a lot easier to change languages than it is to change to a whole new philosophy of programming and I think that has shown. OOP is not a fad, it's most definitely here to stay and in fact I think it will grow as more and more languages (other than C++ and Java) take on Object Oriented design and more and more programmers learn when and when not to use OOP.

  54. Article Only Proves Low Education Level by scotteparte · · Score: 5
    It seems our skeptical OOP critic is pulling graphs from nowhere and making logical flaws left and right. Refuting his article is quite easy, but there is no doubt in my mind that he would not accept the refutation. His failure is that he refuses to accept the absolute need for abstraction.

    I work in a software company, and our product takes up no less than 300 MB of code. Even in the most well-organized non-OOP code, our software would be impossible to debug or even build, because we would need to go through hundreds of lines of code. In addition, reusability would be hurt, since even though the functions would be there, minor changes in the arguments might make the entire function worthless.

    The author's example using People and Taxes is particularly striking. He suggests that an object oriented approach would create a person object and a tax object, set their attributes, and run the T.CalcTax method on Person P, while a procedural approach would just feed the relevant parameters to a function. I wonder if the author has ever actually filled out the 1040 Personal Income Tax Return Form. The easy version has 70 entries, and while some are calculations, others are references to other, much bigger, forms! Keeping track of all these variables without some structure to hold them all is just stupid. Object orientation is necessary when code hits a level of complexity where several people, or several hundred, are simultaneously working on a project. The "black box" approach allows for greater flexibility and optimization, since a code change will be transparent to the objects around it.

    Another thing to consider, although I know CmdrTaco would berate me for even mentioning it, is the expansion of OOP provided by Java. The Interface in Java allows you to specify several functions, abstractly, that are required for a class to implement the Interface. The implementation of these functions is class-specific: for example, all clothes implement the Wearable interface, but you would not want underwear and shoes to have the same implementation of Wear(). However, in Java, you may specify a function to take a Wearable object, and not need to specify any further. This abstraction level is why OOP does, in fact, better model the real world.

    In conclusion, the rantings of a PASCAL junkie should not constitute a Slashdot article. Anyone who has coded in procedural and OO languages should see the extreme idiocy of the article within milliseconds. On the other hand, Perl powers Slashdot, so I guess this is the place for the procedural approach to have its message heard. In fact, Slashdot totally vindicates the article: its non-OOP approach is fast, effective, efficient, and easy-to-understand. Highly scalable and expandable as well. I especially like Slash.pm (aka THE BEAST) and the my_conf{shit} variable. I'm sure the non-OOP approach will really take off once everyone switches over from C++/Java to Perl.

    1. Re:Article Only Proves Low Education Level by Shotgun · · Score: 2

      I work in a software company, and our product takes up no less than 300 MB of code. Even in the most well-organized non-OOP code, our software would be impossible to debug or even build, because we would need to go through hundreds of lines of code. In addition, reusability would be hurt, since even though the functions would be there, minor changes in the arguments might make the entire function worthless.

      And your niche is the specific case that the author spent considerable time excusing from his argument. The niche he talked about was the small business application that would not be expected to last more than 3 years. He specifically stated that large applications written by software houses for others were the province of OOP and OOD.

      Read the article before making a fool of yourself in an open forum.

      --
      Aah, change is good. -- Rafiki
      Yeah, but it ain't easy. -- Simba
  55. OO is dead as a silver bullet, alive otherwise. by Ars-Fartsica · · Score: 2
    Like any technique or technology, OO methods must ultimately be incoporated into a larger scheme of structured and generic programming (and perhaps one day, functional programming).

    Ultimately, multi-paradigm languages that can absorb new techniques as they mature, like C++ and perl, will be the winners. I have yet to see a mono-paradigm language have sustained appeal over a five to seven year period.

    1. Re:OO is dead as a silver bullet, alive otherwise. by Black+Parrot · · Score: 2

      > Like any technique or technology, OO methods must ultimately be incoporated into a larger scheme of structured and generic programming (and perhaps one day, functional programming).

      IMO, OO is just a further refinement of the traditional values of modularity, data hiding, etc.

      Some authors treat it as a fourth class of language, yielding {procedural, functional, declarative, OO}, but I disagree. I get {procedural, functional, declarative}, with OO being a refinement of procedural, just like structured programming, data hiding, etc. are, rather than a new classes to themselves.

      My language of choice is an OO language, but I think the big OO push is mostly hype. As far as code reuse goes, OO still has not provided additional reuse on the scale of what we already had with (say) glibc. (You do realize that linking to a library is code reuse, don't you?)

      In my experience, low-level components are reasonably likely to be reused, but high-level components are rarely reused outside the program they were originally written for, or at least a very closely related program. (Here, I use "low-level" to mean things like widgets, sorters, etc., not "low-level" languages.)

      OO is a useful idea, just like modularity, structured programming, data hiding, etc., but it seems to be surrounded by a disproportional amount of hype. Look at the number of development lists where people regularly suggest rewriting an existing C project over in C++, and sometimes even actually start a branch project for that sole purpose. The argument usually boils down to "because it's better". I have never seen an instance where changing the language would let the maintainers solve a problem that they couldn't solve with their current language, nor have any of the rewrite proposals that I've ever seen offered any arguments that the rewrite in an OO language would provide benefits that outweighed the cost of the rewrite. There just seems to be a widely held belief that "OO is better, so we should convert everything to OO implementations".

      --

      --
      Sheesh, evil *and* a jerk. -- Jade
  56. Spaghetti code, anyone? by bgalbs · · Score: 2
    Ignoring the tone of the article, which had a distinctive mid-pubescent feel, the thesis is mildly interesting: can procedural methodologies be as maintainable as object-oriented ones?

    Unfortunately, the thesis was quickly replaced with some teenage-esque rants that have been noted already.

    What seems to have been overlooked is the advantage of OO: code maintainence. In entreprise environments, a great deal of time is spent on project maintenance. Anyone familiar with procedural programming can testify that scanning lines of undocumented and tightly written code can be a nightmare. The old ideals of syntatic efficiency at the expense of readability, while fun and good in the hacker world, don't fit into the corporate world.

    OO attempts to solve this problem by introducing a methodology that makes it easier for programmers to make their code maintainable.

    This is analogous to the manager that keeps all his notes in his head versus the manager that documents his job and his notes. Both can probably do a great job, but when they move on, which one do you want to replace? I'll take the latter.

    All the arguments about procedural programming being faster and easier than OO are moot: it's the nature of the beast. But OO is definitely a great tool for facilitating ease of code maintainence and leveraging past effort.

    I can't believe the guy that wrote that post has had any career of significant length.

  57. Re:I tend to agree with the author.. by slim · · Score: 2

    I wonder how much C++ code is actually OO, though?

    I've seen any number of C++ books which are effectively C books, using cout instead of printf, with an object orientation chapter tagged on as an afterthought.

    I'll bet a lot of Windows programs use OO to work with the GUI (because MFC makes them) but have an underlying program structure that's procedural to the core.

    I've no doubt that OO is heavily used, but you can't get comparisoms just by counting how many programs were built with a C++ compiler.
    --

  58. Re:Anonymous hack berates OOP by squiggleslash · · Score: 5
    Absolutely. Let's look at OOP vs Communism:

    Classes: Communism - adamantly against. OOP: For, not merely for, but in favour of more classes than you could possibly imagine.

    Inheretance: Communism - opposed to. Inhereted property regarded as a prop for the aristocracy. OOP: Treats the concept with a reverence not known even amongst the Kennedies and Rockafellas of this world. Encourages, aids, and supports.

    Property: Communism - private property treated as an ambonination. OOP: Supports, allows objects to have whatever properties they want, and decide for themselves what is public and what is private.

    Objects: Communism - usually on the side opposing the objectivation of anyone, women, minorities, etc. Even cynically, prefers to deal with people as an anonymous mass rather than discrete objects. OOP: Pro-objectification. Treats everything and everyone as objects.

    I think it's pretty obvious that our OOP berater has no idea what sie's talking about. That said, most communists I know feel the need to talk in wordy jargon to demonstrate their superior intellects. With OOP programmers making sure they use everything from 'abstraction' to 'polymorphism' in every other sentence, I can see why the author might have been confused...
    --

    --
    You are not alone. This is not normal. None of this is normal.
  59. Re:Tell us something we don't already know... by Anonymous Coward · · Score: 2

    Taco is a perl c0d3r; what do you expect. The relationship between perl c0d3rz and programmers is in the 'distant admiration' category.

  60. There's no magic bullet... by Greyfox · · Score: 3
    The hype of OOP is that it's a magic bullet that does all your thinking for you and that all you have to do to write a completely new program is derive a new class and change a couple of lines. This is, in a word, crap.

    Thing is, if you can't do design in procedural code, OO's not going to buy you anything. Projets that buy into the aforementioned hype will fail. A company throwing OO at a projet without investing in training of it programmers will see the project fail. There are some simple OO mistakes that you see new programmers or procedural programmers who've never done OO before. Deriving everything from everything else. Using inheritance for everything. Habits that it's hard to break them of because nobody realizes that they're bad habits.

    Do a bit of research though, and you can find ways to be very productive using OO. If the designs are good, it does actually get easier. Buy "Design Patterns" and poke around in the various OO language netnews archives for little nuggets of wisdom and you will find your object designs improving immensely. Read about STL and use well designed toolkits like gtkmm and you'll start to realize benefits from using Object Oriented programming.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  61. Wrong by cje · · Score: 4

    I think you need to look at the definition of an "Object Oriented" language. You'll see that to be OO a language must support certain things like inheritance, polymorphism, run time binding (dynamic binding) and many other fun things that you can't do in procedural languages. C doesn't support any of those.

    Of course it "supports" them. It's just not as easy as it is in other languages. As has been pointed out before, creative use of function pointers in C can be used to implement polymorphism and "dynamic binding."

    Think about it a minute. What does a C++ compiler do? It translates the (high-level) C++ code to (low-level) assembly code. Are you somehow suggesting that there is no way that the generated assembly code can implement inheritance and polymorphism because no assembly language "supports any of those?" If so, how is it that C++ programs are able to compile, link, and execute? The original C++ compiler, cfront, generated C code as output from the input C++ code. Surely the output C code was no less "object-oriented" than the C++ code it was generated from.

    You can write object-oriented code in nearly any language. The difference is how much language-level support for OO is provided. Just because you can't write "virual void myFunc()" in C doesn't mean you can't generate the same behavior.

    --
    We're going down, in a spiral to the ground
  62. Wow! A Troll on the frontpage! by PureFiction · · Score: 2

    Seriously, did anyone read this before they posted it?

    OOP is communistic?

    No references? (Sorry, we lost them...)

    A giant stinking POOP image header?

    perhaps this should be under the humor category...

  63. People and Taxes by maroberts · · Score: 2

    For a code example, suppose we have an application that calculates taxes for individuals. A common object oriented approach is to create a Person class and a Tax class...

    Nope, I'd just add a calcTax function to the Person class I already had. Maybe this explains why my objects seem to have a lot of functions....
    :-)

    To take the Tax and People example you have given, you have overlooked the fact that an object oriented approach allows inheritance and lots of other stuff. For example, if there was more than one type of tax T on a person P, one could still call a generic function T.calcTax(P) for both InheritanceTax and IncomeTax classes which inherited from the basic Tax class.

    Object Orientation is not an answer to Life, The Universe and Everything. And you often find that one persons idea of an object oriented approach to a problem is totally different from another persons idea. But having said that, I find that it is easier to work out what someone has done if they have used an object oriented approach than if they haven't. For one thing, most people implement all functions of each class in a single file named after a class, something you're never quite sure of with a parameter approach.

    Object orientation simplifies maintainability, by encouraging people to write in a style which may be easily understood, something many other methodologies have singularly failed to address.

    --

    Donte Alistair Anderson Roberts - hi son!
    Karma: Chameleon

  64. Re:Examples? by piggy · · Score: 3

    OO does not bring benefits for all projects. OO does not always bring short term benefits. Where OO excels is maintainability and understandability, as well as distribution of labor for a medium or large scale project. A 15 hour project is nothing. Worst case if you need to expand or maintain that project, you waste another 15 hours. A large scale multiple year project, however, truly benefits from an OO approach.

    If implemented with discipline and knowledge, an OO project is better maintained than a procedural one. However, I would take a disciplined procedural project over a messy OO project. The overall guiding point is rigorous software engineering, and OO provides some language level discipline, while procedural programming provides nothing at the language level. If a good process is followed, though, language level support is just convenient fluff.

    Russell

  65. NO silver bullet but C++ multiparadigm is usefull! by UnknownSoldier · · Score: 2

    The author is correct that OOP won't solve every problem. But he tosses the baby out with the bath-water! The author obviously hasn't read any of these great books/articles:

    What is Object-Oriented Programming? (Link to papers, since I can't find the .pdf for this one)

    Multiparadigm Design and Implementation in C++

    Design and Evolution of C++

    Now I'm not saying C++ is the end-all and be-all, but every language was designed to solve a certain problem. Use the right tool for the right job! If C++ lets you solve your problems quickly and efficeintly, then use it. If not, then use what works.

  66. Re:reusability... by Skapare · · Score: 2

    You obviously have a situation that calls out for OO design and programming. Now explain how that means that absolutely everything to be programmed has to be programmed in an OO language.

    What I got out of the article (which I thought was poorly done) was that the problem isn't OO itself, but that OO is being overly applied where it isn't needed, and even where it gets in the way.

    --
    now we need to go OSS in diesel cars
  67. How can OO be a "fad" if ... by Lumpish+Scholar · · Score: 4

    ... it's been around (and used successfully) for over fifteen years?

    As Jim Coplien has pointed out, OO (objected oriented programming / design / analysis) is older today than "structured" programming / design / analysis was when OO first burst upon the scene. (The structured movement first got some serious press in the mid to late 1960s; the classic book by Dahl, Dijkstra, and Hoare was published in 1972. OO started no later than Simula-67 and Smalltalk-72, and first gathered mainstream attention in the 1980 - 1982 timeframe. The first OOPSLA conference was in 1986.)

    Yes, some snake-oil salesmen overhype OO ... or whatever buzzword they can apply to their product. Surprise.

    No, OO is not a panacea. It's not even always the right tool to apply to a particular design or programming problem. (Coplien's recent book, Multi-Paradigm Design for C++ , is a tough but worthwhile read that addresses this issue.)

    You may dislike a particular language that supports OO (Smalltalk, C++, Java, even Perl) but find the paradigm worthwhile in some other language.

    For comparison, compare with this message in Risks Digest: "The structured programming revolution is a real bad idea that has been significantly holding back progress for years.... Have there been any double blind studies which unambiguously show that the kind of programs that structured programming partisans enjoy are really more maintainable than some other kind of program? I've heard lots of testimonials, but no real evidence." Sound kind of familiar? (Heh.) --PSRC

    --
    Stupid job ads, weird spam, occasional insight at
  68. the key phrase is: properly implemented by HiyaPower · · Score: 2

    The key is as you say: properly implemented. Too much oop has been implemented by the sorts of folks who will term a database as "almost relational". It takes intelligence and rigor to make sure that the corners are not cut that will reduce your small amount of oop to a very large amount of smoking oops.

  69. Re:Author is a USENET troll/pest by rkent · · Score: 4
    Ha! Man, he's probably trolling around here, too. I wonder what his slashdot ID is? Probably the same one who submitted the story ;)

    Wow. I think /. has been seriously trolled this time.

  70. Objects & RDBMS by hugg · · Score: 2

    I agree that for some applications, making an object->relational mapping is just a giant pain in the flipper. For the kind of timelines project managers impose on web projects, and the terrible ever-changing specifications given, it's usually easier to fill up an Oracle table and worry about elegancy later. This guy is probably recovering from wounds from some sort of overanalyzing OO web consultancy, having been forced to wear UML diagrams as underwear.

    Technology is rarely the problem -- the usual problem with projects and OO is that the zealots win, and centrists who want to use the most-suited technology for the specific application get ignored or called "hacks". The over-ambitious 3-tier agent-based project gets canned, and the "hacks" get called in to fix it using a less long-bearded method.

  71. Re:Poor criticism by VirtualAdept · · Score: 2

    Agreed. Frankly, I nearly stopped reading him when he mixed up OOP with poor business practices.

    Beyond that, he pointed a lot of problems with the way people design OO models that aren't necessarily a design flaw with OO. For instance, his argument about the dangers of 'IS-A'. From what I've read (Design Patterns), IS-A is pretty much regarded as less extensible than has-a. When you can use a has-a, use a has-a. If you want to use a is-a, think twice about if you really need to use one. But no, an OO language does not loose a lot of its benefits as compared to procedural when you use has-a. Modules do not have state. Objects do, which is frequently important.

    I think the last straw for me regarding this article was the unclever section comparing OOP to Communism. Gee, a social movement failed, therefore a programing methodology will fail too.

    --John

  72. Re:I tend to agree with the author.. by johnnyb · · Score: 3

    I don't think its a fad. Structured programming is still the model we use, even when using it within object-oriented programming.

    The guy who wrote the article missed one of the most important aspects of OO, and that's _interface_ inheritance. Interface inheritance is _NOT_ subtyping, and is vastly more flexible and usable than subtyping, which seemed to be one of his big gripes. If you want to know more about interface inheritance, look at my page at

    http://members.wri.com/johnnyb/comppapers/factor in ginheritance.html

    I called them "feature factors" here.

  73. People think in objects by Gorimek · · Score: 4

    Does OO make assumptions about human nature?

    Actually it does. But it's a correct one.

    One of the basic assumptions is that the human brain is built to think about the world in terms of things that have properties and behaviour. We can think in terms of procedures and execution flow as well, but we're not nearly as good at it.

  74. Re: Poor criticism - and biased by MidnightLog · · Score: 2

    First let me admit that I didn't read the whole article. I skimmed it and I read the Table Oriented Programming article (which is linked to in this article and presumably written by the same person) about a year ago. I believe that this OOP criticism page was around at that point. Although it is hard to take this page seriously (the comparison with Communism just killed me), I think I'll comment on a few of his points.

    I guestimate custom software systems last about 3 years on the average. This is well behind the alleged payback period of OOP.
    If that's true then why did I get all that Y2K work back in '98 and '99 fixing 5 to 10 year old programs?
    When a new language fad replaces OOP, how do you convert legacy Java objects into Zamma-2008 objects? (I will eat a week's pay if OOP is still in vogue in 2015.)
    I think here the author is refering to the data part of the object, not the logic. If so then this is a very good point, but its not an argument against OOP. Its an argument for "future-proofing" your system.
    A common misconception is that one has to change all the procedural code if a DB field type or size changes. For example, if a percentage rate changes from an integer to a float/real, then OO fans often claim that it causes a procedural code change cascade. However, this usually only matters in strong-typed languages, like C, Java, and Pascal. (Weaker typing is better for p/r usage in my opinion.)
    Here I just think its funny that he lumps C in with Java and Pascal as a "strongly-typed language".

    I'd like to add that IMHO, OOP builds on procedural (structured) programming. It usually allows better abstraction than procedural programming, just like using C allows better abstraction than assembly language. In general, abstraction is neither good or bad. As systems get larger and more complex, however, its necessary.

    --

    To understand what's right and wrong, the lawyers work in shifts ...

  75. Re:Another reason ... by SpinyNorman · · Score: 2

    Poor design and algorithms is a much greater cause of inefficency than the fit of C/C++ generated code to a processor's architecture.

    Anyway, 99.99% of programs don't need anything approaching the full performace of a modern processor, and those that do (such as games, speech recognition, media encoding) are always going to have been heavily optimized anyway.

  76. Re:My view by dbarclay10 · · Score: 2

    Like I said, I understand the theory.

    If an object is data with functions, then I've been doing object-oriented programming all my life. Even with assembly. Sure, it might not have been in the code, but each bit of data I was working had a function associated with it.

    Dave

    Barclay family motto:
    Aut agere aut mori.
    (Either action or death.)

    --

    Barclay family motto:
    Aut agere aut mori.
    (Either action or death.)
  77. Talk about flamebait... by Samrobb · · Score: 5

    The article is topped off with a gif image tagged "OOP Stinks!". That should give you a good insight into the level of discourse that follows.

    Of course, the author absolves himself from all responsibility for having to present anything more than an emotion-filled diatribe by stating early on:

    Disclaimer: not all myths discussed are necessarily shared by all or even most OO proponents. They are based on "common notions" found in the business and programming world as I have observed them. I am making no claims as to the frequency of beliefs in the myths. My frequency of encounter may differ from yours. Discussing myths is not the same as "punching a straw-man", which some OO proponents claim I am doing by mentioning myths.

    So... his article is based on debunking "OOP Myths", which he states are not "necessarily shared by all or even most OO proponents." He repeatedly fails to back up any of his points with citations or references (and at one point, actually states "Sorry, we accidentally lost the references.") Instead, he justifies his arguments by making blanket statements like "Many OO books and even some OO fans suggest that OO only shines under fairly ideal conditions." Which OO books? "Some" OO "fans"? (Remember the disclaimer - not neccesarily all or even most OO proponents...)

    Finally, some of his commonly (or not-so-commonly - take a look at that disclaimer, again) believed OOP myths are outrageous to the point of being silly... OOP eliminated the need for case or switch statements? OOP makes programming more visual? Only OOP has automatic garbage collection? Components can only be built with OOP? Only Only OO databases can store large, multimedia data? Who, exactly, does believe these myths? PHBs? Certainly not anyone with a CS education or decent amount of programming experience.

    The best thing I can say about this article is that I think the author has a few good points and compelling arguments that are, unfortunately, lost amid the noise and confusion of unsubstantiated facts. If you can read it through and keep from grimacing in pain as OOP is compared to communism and the lack of research in non-OOP languages is decried, you might be able to find an idea or two that will reward you for the effort.

    --
    "Great men are not always wise: neither do the aged understand judgement." Job 32:9
    1. Re:Talk about flamebait... by RevAaron · · Score: 2

      I know a lot of other, more primitive languages still rely on case statements, but there is none in Smalltalk. With proper OOP, you really shouldn't have to need them. Of course, it's easy to write in your own case statement to the language, but it's not a neccessary thing.


      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  78. In the tiger compiler book by f5426 · · Score: 4

    the quote on top of the object oriented langages chapter was something like:

    "object: to feel distate for something"

    I laughed my ass off (even if I do OO programming since 1991).,

    Cheers,

    --fred

    --

    1 reply beneath your current threshold.

  79. "Abstraction Distraction" my ass by VonKruel · · Score: 2

    Abstraction is the most important and useful thing you can do as a programmer. It takes many forms, but no matter what paradigm you're working in, programming is all about abstraction. It's the simplest thing in the world: when you find two or more sections of code in your program that look very similar, you ask yourself, "what is the common ground here?". In doing so, you are engaged in abstraction.

    OO is simply a way of exploiting this abstraction to maximum benefit. Because abstractions can pay off so well, you are encouraged to find them. As a programmer, you are not paid to be a typist, you are paid to think. Thought in general is part imagination and part abstraction. If you are not capable of finding such abstractions, it is not because OO is inadequate, it's because your skill is inadequate. So should you accept your incompetence, or try to better yourself? The author says you should just accept it and choose a paradigm more befitting your lowly intellect. I disagree with that.

    Is OO oversold? Sure - people do expect to gain benefits magically just by using OO languages and tools. There is no substitute for talented people. And OO is not appropriate for every project. But there are a lot of examples of great things that are nonetheless oversold. Look at the Nasdaq for example.

    I found the article to be pretty weak. He shows pretty graphs without citing references, and seems to be shaking a stick at OO more than anything else. Though he makes a few rational arguments, for the most part it's fairly obvious sophistry.

  80. Re:Wrong by TulioSerpio · · Score: 2
    I understand you now.

    but I insist. What's the point o programing in Objects in a Lenguge that doesn't support them?

    I think you must choise the Methodology AND the lenguage in response of a problem.

    In the end all code became assembler. but I won't program a SO in Java, for instance. Or Object in VB, as I see somewhere.

    --

    I'm from Argentina: Tango, Asado, Mate, Gaucho, Maradona, YPF

  81. Good objects are a lot of work by WillWare · · Score: 4
    I work in C and Python. In C, I occasionally do a tiny amount of C polymorphism using function pointers, but it's infrequent. Python's OO model is very easy to deal with, but I find that prematurely OO-ing my code is as bad as premature optimization. If I'm really lucky, my objects will be useful for some later project. This is by no means guaranteed.

    Objects are great where they work, and where you have the time and experience to tune them to perfection. The Python libraries are full of beautifully crafted, wonderfully useful object definitions. But that investment is large, and in many cases, doesn't make sense for the purpose at hand. And there are problem domains for which objects simply aren't the natural description.

    The OO people say that the wrong way to reuse code is the cut-paste-tweak method, because then you have two diverging copies floating around. In a perfect world everything might be in a source code repository and I could submit a change rather than spawn a private tweak. But change submissions mean bureaucracy, if I'm working with other people. If my tweak will never see public use, the overhead is an unnecessary diversion.

    The cited geocities page makes noise about table-oriented programming. I remember hearing similar things in the past, stuff like "Put the intelligence in your data and keep your code simple". I would have liked to see a better description of TOP, perhaps a few pointers to tutorials. The guy's own descriptions are pretty useless for quickly grokking his point. Maybe he's only preaching to the database crowd, and I'm not supposed to get it.

    --
    WWJD for a Klondike Bar?
  82. Beware!! Your coding dept. breeding bolsheviks! by corvi42 · · Score: 2

    Yes, those dastardly Lenninists are at it again!

    In their most fiendish and heart-chilling conspiracy ever they are targetting the free worlds most valuable intellectual resource! First they created a godless empire ranging across europe and asia. Then they sent their agents to infiltrate america. Then they tried to corrupt the youth of the free world with their underground beatniks and seducing the young into the sloth of hippydom with drugs and satanic music. Then they tricked us all by pretending to dismantle their empire, lulling us all into a false sense of security.

    Don't be fooled by marxist plots! They are still hard at work, and they have infiltrated into the most valuable resource of the information age - they are corrupting our programmers!

    They have put their best agents into key positions in the programming world, and unleashed the most mostrously conceived pinko commie plot since the flurodation of water!

    Boris and Natash say: "Java and C++ vill destroy the evil capitalist pig-dogs".

    B: "Gorsh Rocky, what can we do? Boris and Natasha are running amok!"

    R: "I don't know Bullwinkle - but we must warn the honest IT managers of America to reject OOP"

    B: "Hey Rocky, watch me pull Fortran out of my hat!"

    R: "But that trick never works!"

    B: "This time for sure. Presto!"

    --

    There are a thousand forms of subversion, but few can equal the convenience and immediacy of a cream pie -Noel Godin
  83. Three? Try nine... But its ALWAYS been like this. by crovira · · Score: 2

    OO is a design technique and OO systems can be implemented in Assembler (like CICS/IDMS-DC) all the way to Smalltalk.

    Brooks in "The Mythical Man-Month" talked about the difference between programs and systems back when they were building OS 360. The complaints talked about here aren't limited to OO.

    However, every non-trivial implementation of any successful system can be shown to be OO in design and technical every failure can be shown to have violated OO principles (that's not counting management, direction marketing and every other reason for failure.)

    Most systems tend to become unmanagable because the peoplle in the trenches doing the maintenance get "too busy" to maintain the documentation and rely on osmosis and oral tradition to pass on the system lore. Things get lost with ever departure until its necessary to start over again. ("Read the code" has NEVER worked for more than trivial stuff because the code only caries traces of its INTENT and clever programmers tend to obscure that through 'clever' hacks.)

    Smalltalk, a best of breed, has several short comings but that doesn't mean it can't be made to work easily. You just have to remember the limitations of container-based implementations.

    Java, C++, C#, CLOS, Simula, and Smalltalk ALL share in these deficiencies:
    1)Contained object don't know that they are contained unless you explicitely make a reference to the container part of the object.
    2)Object instantiation is made without regard to context.
    3)Objects don't understand anything about participation in relationships.
    4)Class membership tends to be hard to mutate.

    When we have a language that can model the difference between the cuppola of the Piaza Duomo in Firenze and a common garden wall, then we'll have something to work with. Until then OO is the best design technique we've got.

    --
    MSBPodcast.com The opinions expressed here are my own. If you don't like 'em... Think up your own stuff.
  84. Re:Criticizing Knuth's Tie Clips by segmond · · Score: 2

    if you think you have a point, go checkout ruby and python. :-)

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  85. If we'd all been using Pascal... by slickwillie · · Score: 2

    About 20 years ago Pascal was about as popular as C. But C won out because it didn't impose as many restrictions as Pascal ("look, I can cast a function pointer to int..."). And besides, Pascal was developed for teaching good programming practices, not for "real" projects like C. So, being lazy, people started using C, and Pascal faded out of use. Even Modula-2, the "Object Oriented Pascal" couldn't save it.

    How many virus exploits would have been averted if Microsoft had chosen Pascal?

  86. Re:My view by dbarclay10 · · Score: 2

    That might explain why I'm starting to understand it with Python. Python may be sufficiently different than anything else I've used that it makes me re-learn stuff.

    On the other hand, Lisp is also very different, but to me, only syntactically. 90% of the code I've ever written uses dynamic data for everything. I never did #a = $b + $c, it was always add(b, c, a) type things. Which is suprisingly like (setq a (+ b c))

    Dave

    Barclay family motto:
    Aut agere aut mori.
    (Either action or death.)

    --

    Barclay family motto:
    Aut agere aut mori.
    (Either action or death.)
  87. Re:Another reason ... by taniwha · · Score: 2
    I think you're missing the point a bit - it takes years for silicon to come out - as I pointed out in my posting the call/ret issue you mention is a real problem - partly I suspect because the compiler writers don't take it into consideration (and in the x86 case it's probably made worse by a lack of tmp registers that end up pushing people into using the stack for PC manipulation).

    The whole reason I was doing the work I was was so that we could discover and address exactly these sorts of issues.

    The problem with branching to an unknown offset is - well - it's unknown - and you often don't know what it is untill you've completed a data cache miss to get the address (that's a double pipe break in my mind) - the solution can be things like branch target caches (which make a guess at the target and start a speculative stream).

    Remember you're stuck a primary architecture (x86) that are decades old - that were optimized for compact code (at the expense of registers because they were designed for a system with no icache and limited memory bandwidth) that force complex language constructs into overusing the cache/memory subsystem - of course you are going to get data/branch interactions

    The other big problem in the architectures we see today is marketting - GHz is all - it's what Intel/AMD's marketting people know how to sell - it's a nice number that they can wave at their competition). It's driving their architects to longer and longer pipes to get the clock rates up ... and reducing the CPI into the bargin I'm sure it has a lot to do with why P4 is such a dog - I bet when their engineers are faced with the question "should we make virtual method calls run faster or shall we make it easier to up the clock speed" the clock speed wins every time - no one's saying lets make the pipes smaller (and clocks slower) so the actual programs will run faster

  88. I tend to agree with the author.. by Omega · · Score: 2

    OOP (IMHO -- I'm crazy for the acronyms today), is just a fad. Like structured programming was before it.. Unfortunately a lot of these companies today fall into "trendy" programming methodologies. Personally, I believe you should program using the style you're most comfortable and familiar with. If you're trying to fit a mold it will slow you down..

    1. Re:I tend to agree with the author.. by squiggleslash · · Score: 2
      Aw now come on! This "Fad" has lasted at least ten years. I remember in the late eighties magazine article after magazine article about how OO was about to change the face of programming as we know it, Zortech's C++ compiler and the massive uproar that followed.

      I agree it's overrated, and used predominantly because it's trendy not because the people proposing its use necessarily have made considered decisions, but a fad? I think we commonly agree now that the Internet is not a fad, just how long does a form of programming have to be mainstream before it, too, is no longer treated as one?
      --

      --
      You are not alone. This is not normal. None of this is normal.
  89. The biggest problem with OOP by AlgUSF · · Score: 2

    The biggest problem with OOP is when people use it too much, and end up with like a million classes.
    Example:
    class HelloWorldClass {
    HelloWorld() {
    printf("Hello World!!\n");
    }
    };



    --


    I want my rights back. I was actually using them when our government stole them after 9/11.
  90. Criticizing Knuth's Tie Clips by DaveWood · · Score: 2
    I love it when people get into the OOP/procedural debate. Especially when almost all of the time, it's a debate between C people and C++ people...

    C - a language which is one dreadul kluge after another... preprocessors, function prototypes... and yeah, your code runs fast, but you'll wear your wrists out trying to do robust, verifiable programming, the dreadful excuse "API"... At the end of the day, you're still feeding text files into the chute and turning the crank. The whole thing makes me feel like I'm in the 1880's.

    And then we have C++. Which has all of C's faults, with some additional syntax kluges thrown in to do "object oriented" code... while keeping C's superior style, apparently. So now in addition to everything else, I have to #IFNDEF SOMESHIT #DEFINE SOMESHIT blah blah #ENDIF. Fantastic, guys. Just make sure you get all of your libraries specified on the command line in the right order... Let alone the fact that when you do RTTI or exception handling the compiler gives you the distinct impression it's doing you a favor. Oh, you want a virtual method? I thought you just wanted to seem object oriented, not actually be it.

    Java was a wonderful change from all this, because it simplified and organized the source and sanitized the compilation process. Simply having array bounds checking and garbage collection (let alone the vastly superior and standardized API) made development take up to half the time it would take in C++... and I _HATE_ the VM. I could care less about it. I just find myself amused when people driving horse carts around the back woods get pissed off about the speed limit being 120mph. Our development systems are primitive! OOP or not is a drop in the bucket. The real misunderstood tradeoffs are elsewhere entirely.

  91. Pick the right tool for the right job! by tmoertel · · Score: 2

    Look, folks, object orientation is just one tool of many in the big box of software tools. Use it when appropriate, use something else when it isn't. This guy rants rants about OOP basically on three grounds, all of which are straw-man agruments:

    1. OOP doesn't live up to the hype of its most zealous proponents (What does?)
    2. When you do stupid things with OOP, you get stupid results. (What did you expect?)
    3. Contrived, obviously-false statements about OOP are not true. Examples taken from the document: "Myth: Only OOP has automatic garbage collection", "Myth: Only OO databases can store large, multimedia data", "Myth: Components can only be built with OOP", and so on. These aren't legitimate myths widely believed by folks who use OOP; these are straw men propped up so that he could knock them down.

    The reality is that OOP is a good tool for solving a lot of common problems. It's also a lousy tool for solving a lot of other common problems. When OOP isn't the right tool, don't use it.

    Just use the right tool to begin with. When it comes to programming paradigms, there are lots of tools in box:

    Use the right tool for the job. You'll be glad you did. (And you won't have to put up a web site just to rant about your bad experiences with using a hammer to place dry-wall screws.)

  92. Issue over Code Reuse by Misch · · Score: 2

    This is just my humbl opinion, but in my Software Architecture course, I've noticed that there is something more to all of this than jsut straight up "code reuse"... Architecture reuse is going to be far more important. Sure, we have those nice little design patterns that tell us how to achieve small tasks within our program, but with large-scale systems, recycling the _architecture_ is becoming more important. How do you think Microsoft made Office so rapidly? They used the same architecture, same components, jsut with a little bit of different function.

    It's one thing to recycle a few hundred LOC every now and then, but it's a whole different ballgame when you can recycle the plans for a complete system. I feel (and I may be wrong) that this just isn't as easy under the procedural system.

    --

    --You will rephrase your request for me to go to hell. Goto statements are not acceptable programming constructs
  93. A cop-out? by TDScott · · Score: 3

    Disclaimer: not all myths discussed are necessarily shared by all or even most OO proponents. They are based on "common notions" found in the business and programming world as I have observed them. I am making no claims as to the frequency of beliefs in the myths. My frequency of encounter may differ from yours. Discussing myths is not the same as "punching a straw-man", which some OO proponents claim I am doing by mentioning myths.

    So... this is based on his experiences, without research? He has based this piece of writing on merely his viewpoint? Surely, if any technical critic wishes to be taken seriously, he should back his work up with proper figures and research, rather than "myths".

    Communism also looked good in theory, but its base assumptions about human nature were flat wrong!

    Okay... he's comparing OO with Communism? I don't see the connection. Does OO make assumptions about human nature?

    This seems far too much like a rant, backed up with a few web pages... I would not take this seriously.

    1. Re:A cop-out? by pjrc · · Score: 2
      Okay... he's comparing OO with Communism? I don't see the connection. Does OO make assumptions about human nature?

      Indeed, his point is poorly made, and as nearly as I can tell goes something like this:

      • Communism seemed like a good idea, but we all know it didn't work out.
      • Communism failed because it "got bogged down in bureaucracy"
      • He personally experienced bureaucracy having to fill out too many forms to get a business license (probably not in a communist state)
      • Object methods often are implemented requiring references to other objects, which often times are built with constructors which require a large number of fields, similar to having to fill out those unpleasant gov't forms.
      Maybe I missed something, but I was under the impression that communism failed because it lacked incentives for productive behavior which ultimately resulted in a massive decline in productivity. Some people have suggested to me, also apparantly incorrectly, that communism was too suceptible to abuse of power. Because capitalism also suffers this problem, I've spent the last 15 years or so believing the fundamental problem with communism was the lack of financial incentive for productive accomplishment.

      Silly me. I learned something today. The real reason communism failed and capitalism works is because communist nations had to bear the weight of excessive bureaucracy while the government structures of the western nations were able to run mean-and-lean, with very little overhead and only minimal bureaucratic hassle.

      I tried to learn more things from Jacob's long rant about OOP, but somehow I didn't manage to come away with much insight.

  94. Re:Another reason ... by garoush · · Score: 5

    How far is "... a while back while working on an unnamed CPU project..."? If you are talking 5+ years, or even 3+ years, than you data is out of date as today's compilers are much more efficient about optimizing C++ code.

    --

    Karma stuck at 50? Add 2-5 inches.. err.. 2-5x Karmas Count to your pen1es.. err.. Karma all naturally and private
  95. Re:Wrong by cje · · Score: 2

    You are saying that every language/compiler that runs in a chip/VM is the same thing.

    so functional, OO, Imperative programing are all the same. Guau!


    No, I'm saying that code that is based on the concepts of inheritance and polymorphism in one language is still based on the concepts of inheritance and polymorphism if it is translated into another language.

    --
    We're going down, in a spiral to the ground
  96. Re:One word... by krlynch · · Score: 2

    Many cases of virtual function calls can be completely optimized away at compile/link time. Read, for example, here.

  97. oop bad? by holzp · · Score: 2

    Yeah yeah yeah, Yeah yeah yeah, Yeah yeah yeah I think I did it again, I made you believe we're more than just objects Oh baby, It might seem like some code OOPs!... I did it again, I played with your paradigm, got lost in the code....

  98. reusability... by GoNINzo · · Score: 2
    Bleh! If I hear reusability one more time, i'm going to kill someone...

    The right tool for the right job. By building such a generic tool, you ruin it's effectiveness. and the article points out that the benifits of reusability only come after years.

    But he makes a great point. You can't have all OOP and no procedural skills. and you see it time and time again. If all you know how to us is a hammer, pretty soon everything looks like a nail.

    --
    Gonzo Granzeau

    --
    Gonzo Granzeau
    "Nothing the god of biomechanics wouldn't let you into heaven for.." -Roy Batty
    1. Re:reusability... by infodragon · · Score: 2

      You are absolutly right, so for the sake of karma, I'll expand a little on what you said...

      A clearly defined and documented interface provides the integral part of any software project. With out them all the diagrams and quality control will not help when it comes to maintenance and new development.

      One thing that comes from clearly defined interfaces is extremely modular code. Modular code encourages de-coupling of components, making it easier to develop new features and fix old ones.

      Another thing that interfaces provide, if they are properly used, is a true abstraction from the implementation. So when a new programmer comes onto the scene he gets a good feel for what the module does before he gets into the implementation. If the code is really bad then it can be replaced without breaking other software, by rigidly adhering to the definition of the interface.

      Yes this is not a perfect thing but it is a wonderful start. I'm a C++ programmer with 7 years of experience. When I develop a new object or related objects I create a base class that just defines the interface. I use pure virtual functions so there is no implementation. I define what each of the methods do. Through inheritance I then implement the interface. I may write crap code for proof of concept or just a time constraint but when I go back and re-implement the clearly defined interface it does not change the behavior of code that is dependent on that interface.

      Another method I use is factories. I have objects that construct related objects and return a handle to just the interface. This way other code
      that I write is never directly accessing the implementation of the object.

      I do understand that other languages do not support some of the features that C++ does but with a little thought and design the same ideas can be used to implement strongly defined interfaces and good decoupling of modules can be achieved.

      This is a more hands on approach to software but it is something that I feel is missed by most software development. A strongly defined interface will always allow for easier development, maintenance, and addition of new features.

      --
      If at first you don't succeed, skydiving is not for you.
    2. Re:reusability... by mangino · · Score: 5

      It has been a long time since I last posted to Slashdot. I can normally restrain myself, but this is just pure and absolute BS.

      Properly implemented, code re-use can pay off immediately. I have worked in shops where every time we added a client, we needed a new copy of the code. Even though most of the processing was the same for the new client, we had to start out with a copy of the code. Code re-use would have bought us hundreds of thousands of dollars very quickly. (This did not ocurr at my current employer)

      Properly implemented abstraction and OO along with iterative design can save a large amount of money very quickly. The key is to prototype your interfaces for the application you have in mind. Once you have done that, think of a completely unrelated use of the interface and test that. If you can handle 2 or 3 different uses, you have a good interface to start with. Rinse and repeat for the rest of your system.

      People may question you immediately, however the minute somebody decides to change the system message transport from http to JMS, you should be able to convince them of the value of proper abstraction and code reuse, just change the transport class and you are done. I did this in a system where we did all of the work necessary to change the transport in less than 30 minutes. The consultant that had been working on the same problem for 3 months was absolutely amazed at quickly I made the change.

      OOP is not a cure all, however its use along with proper abstraction can lead to large savings from code-reuse in a short time.

      Mike
      --
      Mike Mangino
      Sr. Software Engineer, SubmitOrder.com

      --
      Mike Mangino
      mmangino@acm.org
  99. CmdrTaco flaunts his ignorance by Katz_is_a_moron · · Score: 2

    "The Object Oriented Hype"

    How can a paradigm that has been a foundation of successful application development for years be called hype? That's akin to calling procedural languages hype.

    "Personally, I've never been a huge fan of OOP"

    I'm not try to convert you, but have you done any serious OOP programming?

    What some people don't understand is that knowing how to program in a OO language doesn't automatically mean a person knows how to do OO programming. If a person partitions an application into objects that don't make sense (e.g., an object that should really be multiple objects), then he isn't really isn't getting the advantages offered by OOP.

    I've seen programmers try OO languages and say "it sucks". When I look at their code, I tell them their OOP sucks.

  100. My view by dbarclay10 · · Score: 2

    Now, I'll be honest. About four paragraphs into the article, I had to stop. I didn't understand it.

    I am *not* a OOP programmer. To be honest, I've never been able to understand it. The first programming language I learned was dBase(if you can call that a programming language), and I learned that when I was around 5 or 6.

    After than, I learned assembly. 16-bit, 80286-style Intel assembly.

    When I was around 16, I learned Borland Turbo Pascal. I've been using computers my entire life. I'm good. Not great, but good.

    And you know what? I've never understood OOP. I just don't "get it." Sure, I understand the theory, but when it comes to real work, I've never understood it.

    Now, that's not to say I've never used it. I've used it, and used it well. But I never knew why they had to call it "object-oriented". It always confused me. Whenever someone started talking about OOP, I'd have to leave the room. It didn't make any sense. It's like if everyone started calling the TV a "forbick". Doesn't make any sense does it? I mean, it's a TV. Why call it a forbick?

    Anyways, I'm beginning to understand a bit more. I've been playing with Python, and I think I'm starting to grasp it.

    Ah well, I'm tired and babbling :)

    Dave

    Barclay family motto:
    Aut agere aut mori.
    (Either action or death.)

    --

    Barclay family motto:
    Aut agere aut mori.
    (Either action or death.)
    1. Re:My view by baka_boy · · Score: 2

      Not to nitpick, but using that example of how Lisp is just 'syntactically' different from procedural languages shows your conditioning for them pretty strongly; the whole idea of functional programming is to reduce side effects such as variable assignment to a bare minimum, and have the program directly represent the correct solution to the problem statement. That way, you can actually divide a program into its individual algorithms, and understand them, without running around with a debugger, tracing two dozen variables at a hundred breakpoints, just to understand a single subroutine.

    2. Re:My view by BeanThere · · Score: 2

      picture the "gtk+" toolkit without all the ugly hacky typecast macros and the hacky inheritance structure

      Before anyone flames me for this comment, I just want to stress that I *LIKE* the *design* of gtk+, I think its vastly superior to the Win32 SDK "design" (in "" because Win32 doesn't look designed at all, it looks like an ugly huge blob thingy that evolved to the point it is today, and MFC is godawful too.) Yes, I've used all of them, and gtk+ is by far the cleanest, simplest, easiest-to-learn and most flexible UI toolkit. I just think gtk should have been C++, since it essentially is.

    3. Re:My view by BeanThere · · Score: 4

      "If an object is data with functions, then I've been doing object-oriented programming all my life"

      Generally when people talk about "OOP" they're referring to three general things you'll find in an OOP language:

      1. Encapsulation: This is what you've been doing, by the sounds of it. Data, along with its associated functions, is grouped into an "object" (called a "class" in C++, I think its called an "object" in pascal, IIRC.) This is called "encapsulation", since both the data and functions are organized into a single entity. This grouping is very easy to do with any imperative language (as well as assembly) and follows traditional seperation of programs into "code" and "data" sections. OOP languages just bring the concept closer to the language by providing constructs like C++'s "class". Something else the languages do is facilitate "data-hiding", by allowing you to specify with language constructs (C++'s "public" "private" and "protected") which members are for general users of the class, and which members are for the class's internal use only. Nothing special here - you can do this in C also. C++ just gives you some language constructs to enforce it at compile-time, and perhaps make things a little more organized and readable.
      2. Inheritance. OO languages typically allow these encapsulated objects to 'inherit' behaviour from other objects. This is quite powerful; with a single line of code specifying what to inherit from, your object gains a whole lot of new functionality "for free". Once again though, there is very little special here, it can all still be done with imperative languages. OO languages just, once again, make this concept more a part of the syntax and constructs of the language. Inheritance also allows you to override methods, so if the object you inherit from has a function, you can redefine that function to behave differently.
      3. Polymorphism. Also called late binding. Probably the most powerful aspect of OOP (although, yes, once again, you can hack something in a language like C that will mimick the same behaviour.) Polymorphism is like inheritance, except the version of an overridden function that gets called is determined at runtime rather than compile time, and uses a table of pointers to methods called a "virtual method table". A little difficult to explain .. if I have a generic "widget" class with a function called "Draw", then specific types of widgets (e.g. scroll bars, buttons etc) would firstly inherit from the general widget, and then override the virtual method "Draw". Now a program that handled the user interface can just have alist of pointers to generic widgets (which will in reality be scroll bars, buttons etc), and it does not have to worry about what sort of widget they are, it just has to call the "Draw" function on each of them when it needs them to be drawn to the screen, and using the vmt, the correct "Draw" will be called depending on what type of widget it is.

        Sounds like you've done mostly encapsulation, maybe a bit of inheritance is natural too. Probably not polymorphism though.

        The thing about OOP is, although it supports these concepts in the language, it doesn't automatically lead to good design, and that is the point that the author of the article this whole thread is about seems to have missed. You still have to think about your design very carefully to build good reusable components. In general it does make you think a little bit more carefully before you just start coding away, which isn't a bad thing. There is nothing you can do in C++ though that you can't do in C. C++ just lends itself more readily to expressing certain types of ideas within the language's native syntax, e.g. picture the "gtk+" toolkit without all the ugly hacky typecast macros and the hacky inheritance structure.

        Presumably there are some OO zealots out there (I personally don't know any but the article author seems to think almost every C++ programmer is an OOP zealot) but in general I think most OOP programmers are more focused on solving real-world problems than on spreading hype. For every rabid OOP zealot, there's a rabid anti-OOP zealot. This guys just one of the rabid anti-OOP zealots. When you really do speak to most people in the business, they *dont* have big issues about programming paradigms. They just use the best tool for the job and are actually mature about it.


  101. OOP is Worth It by Arandir · · Score: 2

    OOP is worth it. It is valid. It works.

    It won't work for every project, of course. It only works for projects that can be modeled as objects. Thus, most systems programming is not suited to OOP languages. But most applications programming is. Even the C and Perl programmers know this, even if they won't admit it. GTK is OO, a hackish OO but OO none the less. Use the right tool for the right job. Procedural is good for some things, functional for others. And there are plenty of projects where OO is a natural fit.

    Sure, OOP is over hyped. So what? Most things in life are. The article wasn't about the overhyping. It was a thinly veiled attack at OOP, nothing more.

    --
    A Government Is a Body of People, Usually Notably Ungoverned
  102. OOD good -- OOP breeds bad programmers by Skapare · · Score: 2

    Object Oriented Design is the great idea. It's best for larger projects, but even works on smaller ones, too. It's suitable for use regardless of what language the project will be coded in.

    Object Oriented Programming is where start to get bad. An OO language is supposed to be able to readily translate a good OO design into code to compile and run. It does that fine. The problem lies in the fact that vast numbers of programmers don't understand or even attempt to do OO design, and just dive into a project programming it in an OO language, and assume that it will be correct. Afterall, it is Object Oriented so it must be right ... NOT!

    Object Oriented Programming shares a problem with higher level languages. By making things easier to do, they make it possible for idiots to actually accomplish something which they would not have been able to do before. For some things that's fine. GUIs allow idiots to use computers. That's not all bad (we don't want to fill out their spreadsheets for them). But when things get into the realm where the person involved has to be smart enough to know about all the problems and situations, such as security, reliability, integrity, and performance, which need to be handled, then it's no time to be allowing someone who couldn't even program in a lesser language at all to be attempting this. Good programming tools should be about making it easier for good programmers to do their task correctly and quickly; not about handing the task off to someone who will just screw it up.

    --
    now we need to go OSS in diesel cars
  103. Tell us something we don't already know... by Shoeboy · · Score: 5

    Personally, I've never been a huge fan of OOP, so I tend to agree on a lot of these points.

    Taco,
    Some of us remember what slashcode looked like before pudge and friends started cleaning it up.

    Not only are you opposed to OOP, but you don't seem to be terrible wild about structured programming either. Nor do you give readibility and maintainability the time of day. Your relationship with elegant code is in the "distant admiration" category and you seem to consider sobriety an impediment to productivity.

    Not that I disagree with you on any of these points, I just wanted to mention that we allready know about them.
    --Shoeboy

  104. the big, fuzzy hairball of OOP by q000921 · · Score: 2
    OOP is not a single technique. Languages that supposedly support "OOP" differ profoundly by how much they support encapsulation, substitutability, inheritance, safety, isolation, dynamic binding, and other features considered part of "OOP". C++, for example, may have better encapsulation than Smalltalk at the level of the type system, but it allows any object to hack the bits of any other object, even accidentally, through pointer tricks. Smalltalk allows objects to be substituted for each other if they have the same methods, while C++ and Java place very tight restrictions on what can be substituted where.

    In fact, I think none of those things are what have made OOP successful. Inheritance and dynamic binding are marginally useful techniques that actually play a role in only a tiny part of most real programs, and there are excellent alternatives to them. (Of course, some methodologies, like the Eiffel/Meyer school of programming use something they call "inheritance" for expressing all sorts of concepts but the same concepts could be expressed just as easily using other constructs, so that doesn't make "inheritance" essential.)

    What has made OOP successful is that it encourages its practitioners to build abstractions and to think about how software may evolve and be reused in the future. That would have been possible in reasonable, traditional, procedural languages, but the world needed a gimmick in order to have people listen, and that gimmick was OOP.

    However, unlike many people who criticize OOP, I don't believe that "C is all you need" or something like that. I think better languages and better programming constructs are very important for building better software. It is just that the constructs central to OOP don't give you much more functionality than you would already have gotten from a decent type system and function pointers.

    But support for runtime safety, garbage collection, reflection, genericity, aspects, and other features is important and allows you to build much more complex software systems much more easily. That's, at least, my experience from using a variety of languages, procedural, functional, dynamic, and object oriented over the last 20 years.

  105. Rebutting a couple points by DeadSea · · Score: 2
    OOP is Non-Table-Frindly.
    OO systems are not very good at ad-hoc queries
    OO systems are in essence Xenophobic

    A pitfall of OOP: When all you have is hammer, everything looks like an ... object. Somebody on java.lang.help recently wanted to program a chess program with GUI. They were going to have pieces, and squares on the board. Have each piece associated with a square. It was suggested to them that the board might be best left unsubdivided into squares. A piece could just have a position on the board which would allow it to move between squares for example.

    Along the same lines programmers working with tables often try to treat each piece of data in their database as an object. In many instances it would be better to simply look as the entire database as an object and forget about the smaller objects.

    One of the reasons that OO is helpful is because you do not need to worry about the format of the data in an object. If you want to use a database or a flat file it is all the same outside the object.

    Using OOP it is much easier to adopt a new data format. There is no such thing as an OO way of storing data that perpetuates itself Xenophobically.

    The way to do something ad-hoc in OO is to subclass. Usually when you subclass you are saying that you specifically want to deal with how the data is stored and you are willng to accept the consequences. If you data is in an SQL database, nothing prevents your from using the correct tool for the job and also using SQL queries. You just run the risk of making your data unusable to your object. But again a risk that your proceedural program would face as well.

    To sum up:

    • If objects are getting in your way, make your objects bigger. Everything is still proceedural inside an object.
    • If objects are causing you to structure your data in a certain way, you can change.
    • OO doesn't prevent you from hacking. It just discourages it.
    1. Re:Rebutting a couple points by scrytch · · Score: 2

      > OO doesn't prevent you from hacking. It just discourages it.

      What utter rot. Through mere subclassing, I was able to make the very OO Perl Template Toolkit behave in radically different ways depending on properties of the Application objects in the fastcgi framework it ran in (I didn't care to take the system down to rewrite the dispatcher every time a new behavior was created). Holy cow, just try coming on a MOO sometime and claim no one can hack anything because it's OO. Most of the complaints I get about something being non-customizeable is because the relevant code has been stuck on a $*_utils object somewhere with no way of making it polymorphic.

      You people amuse me. You really do. You would deliberately throw tools out of your toolbox because your trusty jackknife can fix anything.

      --

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
  106. Re:fp by S.+Allen · · Score: 2

    best review of this "article" to date

  107. What a load of BS by BeanThere · · Score: 2

    Seriously, the way the guy goes on, you'd think OOP was the cause of all world hunger and disease.

    In my 4 years of doing comp sci at University (which included learning both OO methodologies and a wide variety of others), I can't remember ever hearing a single one of his supposed "Myth"'s. Where did he get those? Perhaps I missed all the hype, but I sure as hell have never heard anybody claiming that OO was the panacia that he seems to think people claim it is.

    OOP doesn't do or solve *anything* *for* you. It doesn't facilitate components/re-use - GOOD DESIGN facilitates reuse. It doesn't make programming easier and faster - GOOD DESIGN does. And garbage collection? Who the hell ever claimed that only OOP languages have garbage collection? Now thats garbage.

    All OOP does is provide a few extra constructs that make certain types of things more convenient. It certainly doesn't automatically make your program design a good one. That's still up to the programmer. In fact, learning to make good OO designs takes more programming experience than learning to make good imperative designs. Some software designs really *do* fit better onto a hierarchical inheritance structure.

    For goodness sake, OOP isn't trying to "compete" with your (insert your favourite paradigm here.) It's just language support for programs structured in a certain way. Choose whatever suits your needs, but for gods sake, its not a 'battle' of paradigms, they all serve different purposes. Grow up.

  108. Re:Author is a USENET troll/pest by twitter · · Score: 3
    Actually, you can just look at his pages to find gems like this:

    Actually, most GUI application programmers almost never see the code structure that makes up their screens. They simply click on a screen item, an event selection box comes up (Events like: on_click, on_exit, on_keyboard, etc.), and then a "code snippet" box comes up to edit the event code. Whether that event code is in a method or subroutine does not matter that much to the programmer. If you changed the generated code implementation from OOP to procedural and/or tables, the programmer may never even know the difference.

    This is not a programer!

    --

    Friends don't help friends install M$ junk.

  109. OO Assembler as well - so what? by Gorimek · · Score: 2

    You can also do OO programming in assembler. In fact, any OO program does get translated into assembler code before being executed.

    But what's the point?

    You can do any fancy language construct manually in lower level languages. That doesn't mean it's a good idea. If you're gonna do OO programming it makes sense to use an OO language. Let your tools work for you.

  110. Re:"Object-oriented" languages by Richy_T · · Score: 2
    Obviously, I have not made use of any object-oriented facilities,

    Not that I don't get your point but surely the fact that your Now, if you want to stick printf in there, I'm with you all the way

    Rich

  111. Poor criticism by Mr+Neutron · · Score: 5
    The linked article seems to have more to do with the "silver bullet" mentality than OOP specifically. Anybody worth listening to will tell you that it's just as easy to screw up a OOP project as it is a procedural project. Really, has anybody used "it's object-oriented" as a selling point since 1989 or so?

    In general, the criticism contained in the article is poorly founded. The author uses some nice charts, but has no citiations for them. For instance:

    The problem is that building generic abstract modules (intended for reuse in later projects) requires roughly three times the effort as a project-dedicated (regular) module. Although no references will be given here, this figure is fairly widely accepted in the industry.
    Accepted by whom? I've never heard that asserted by anyone in my academic or professional careers.

    Some of the things he calls out apply equally to procedural languages, such as:

    When a new language fad replaces OOP, how do you convert legacy Java objects into Zamma-2008 objects?
    When Pascal replaces C, how do I convert my C functions into Pascal functions? Eh?

    He makes some good points about measuring the effects of change (everybody should do that!) but I don't think this really strikes a death blow to OOP.

    Neutron

    --
    I get my kicks above the .sigline, Sunshine.
  112. oo is not for fools by jilles · · Score: 2

    In the hands of somebody that does not understand OO, an OO language can cause quite a lot of dammage. Good use of any tool requires knowledge and you don't gain knowledge by staring at a book for half an hour. This article is provocative, and rightly so. Proclaimers of OO have claimed a lot and OO turned out to fail to be a silver bullet. But guess what? There are no silver bullets.

    The truth is that OO languages are an excellent tool for structuring large, complex systems. Simply applying inheritence everywhere you can of course does not work. Using an OO language requires you think differently about how you structure your programs. Some people get this, some never will.

    Of course OO has its limitations and there are many research initiatives to work around those limitations or provide alternatives. Falling back to procedural programming is really no option for anything but the most simple stuff. The article points out that you don't need an OO language to do things like components among others. That is true, but it is so much more convenient with a language that supports the concepts you are working with.

    Another disturbing statement: "OOP eliminates the complexity of "case" or "switch" statements".

    Read Martin Fowlers book on refactoring, it describes how to convert a switch statement into an inheritance based solution (the state pattern). Bottom line, if you understand OO, you know you don't need switch statements. And if you worry about performance, read Fowler's chapter on this topic and you'll see it is not an issue.

    --

    Jilles
  113. counter argument: hasn't really been tried by peter303 · · Score: 2

    The same argument as with uptopias, socialist or
    otherwise: many detractors haven't really implemented
    a full OOP project cycle through maintenance and
    re-use with a decent OOP (C++ sucks).

  114. Re:Author is a USENET troll/pest by Hard_Code · · Score: 2

    Slashdot poster: "Well, we've been trolled by the best son"
    Slashdot moderator: "But dad, you we're the best"
    Slashdot poster: (with a stern look) "We've been *trolled* by the *best*

    (adapted from Simpsons, can't find the exact quote)

    --

    It's 10 PM. Do you know if you're un-American?
  115. OOP...in BASIC? by cr0sh · · Score: 2

    Please - someone show me an example of this - and not in VB.

    Show me an OOP'ed "Hello World" BASIC program, using a circa 1980 or so version of BASIC...

    Can this really be done (and would it be at all readable)?

    Worldcom - Generation Duh!

    --
    Reason is the Path to God - Anon
    1. Re:OOP...in BASIC? by Richy_T · · Score: 2
      You could write an OO basic but you have to ask what the benefit would be since BASIC is supposed to be a gentle introduction to programming. OOP should be coming in around about the time you start looking at real languages anyway.

      After all, Javascript is weakly OO and that's about as close to basic as you can get

      Rich

    2. Re:OOP...in BASIC? by cr0sh · · Score: 2

      Cool for QB 4.5 - but I am looking for something much older - like with the line numbers, and only GOSUBs and such (no CALL statements)...

      Maybe it can't be done with that old of BASIC?

      Worldcom - Generation Duh!

      --
      Reason is the Path to God - Anon
    3. Re:OOP...in BASIC? by cr0sh · · Score: 2

      More for my own amusement than anything else - It would be a hoot to see an OOP-like piece of code running on a TRS-80 CoCo...

      Worldcom - Generation Duh!

      --
      Reason is the Path to God - Anon
    4. Re:OOP...in BASIC? by cr0sh · · Score: 2

      Unfortunately this relies on CALLed type subroutines - I am thinking older style BASIC, with line numbers, gosubs, etc - no CALL statements...

      Still a pretty cool example...

      Worldcom - Generation Duh!

      --
      Reason is the Path to God - Anon
    5. Re:OOP...in BASIC? by Daniel · · Score: 2

      I don't know about BASIC, but it can be done in POSIX sh. A very cute hack, if also completely useless.

      Daniel

      --
      Hurry up and jump on the individualist bandwagon!
  116. GUI's vs GUIs by kyz · · Score: 2

    I really want to take that guy and slap him about the face, while explaining that "GUI's" means "GUI is" or "belonging to the [single] GUI". It is not the plural of "GUI". Fool!

    --
    Does my bum look big in this?
  117. Re:Another reason ... by uksv29 · · Score: 2

    Your posting shows why it is best to use conventional procedural programming for low level I/O and performance sensitive applications - an extremely interesting read.

    In short, keep the code small, minimise calls and locate all associated parts of the code together as much as possible. It is possible for the compiler to help but when you link together lots of classes from different files (code segments) it is impossible to do it efficiently.

    I spend a lot of my time writing 'Low Level' code, keeping the cache hits up and the pipeline full can make a massive difference to the program performance.

  118. Re:Wrong by elflord · · Score: 2
    Of course it "supports" them. It's just not as easy as it is in other languages. As has been pointed out before, creative use of function pointers in C can be used to implement polymorphism and "dynamic binding."

    If you want to look at it that way, I suppose assembly language is "object oriented". It's important to distinguish between language features to support a concept, and the existence of idioms to do the same. The more complex the idioms, the more desirable it becomes to use a language that provides the functionality in the semantics of the language. That's why not many people write OO code in assembly.

    Surely the output C code was no less "object-oriented" than the C++ code it was generated from.

    I bet you wouldn't even want to write it or maintain it though.

  119. Re:"Object-oriented" languages (oops) by Richy_T · · Score: 2
    Forgot the angles

    Obviously, I have not made use of any object-oriented facilities,

    Not that I don't get your point but surely the fact that your << operator is not shifting bits left indicates that you've used *some* object orientated feature.

    Now, if you want to stick printf in there, I'm with you all the way

    Rich

  120. Nothing new by Hard_Code · · Score: 2

    You know, the only people I've ever seen claim that OOP is so marvelous and is such a panacea, are rabid people like this, who compare it to communism. Really, who is this guy arguing to? Managers? What is he trying to prove? Who really believes OOP==GUI? Or that an OOP product is necessarily better than anything else? I might have believed that someone believed this maybe 15 years ago...but not now.

    He's right - OOP is more of an organizational philosophy. In fact you can apply OOP concepts to languages that don't inherently support OOP. And (surprise!) you can apply procedural concepts to OOP languages (duh). OOP is merely a convenient way of thinking about things. Of course it has its flaws, not the least of which is the restrictions of inheritence (is-a/has-a) and the overhead of thinking out and abstracting the problem. But people who use OOP languages without thinking through their problems because they think it's magically going to solve it deserve to get burned (and I guess that's who this article is directed at). But it's just one way, among others, to go about modeling and solving your problem.

    Next issue: "Expose: High Level Languages - They're Not All They're Cracked Up To Be! (plus, they're communist)"

    --

    It's 10 PM. Do you know if you're un-American?
  121. Another reason ... by taniwha · · Score: 4
    (for the record I first wrote smalltalk code in the 70's, I regularly code in C++ ...)

    I'm a sometimes chip designer, sometimes programmer ... a while back while working on an unnamed CPU project I did some low level performance analysis on a number of well known programs (maybe even the browser you're using now) basicly we were taking very long instruction/data traces and then modelling them against various potential CPU pipeline/tlb/cache architectures - we were looking for things that would help guide us to a better architecture for our CPU.

    I found that quite early on I could figure out which language something was coded in from the cooked numbers pretty easily - OO (ie C++) coded stuff always had a really sucky CPI (clocks per instruction - a measure of architectural efficiency that includes pipe breaks, stalls and cache misses) - I spent some time looking at this (since it seemed that C++ code would probably become more common in our CPU's lifetime) - basicly C++ code sucked because it took more icache hits (because the coding style encourages lots of subroutine calls which tend to spread over the cache more filling the I$ quickly) and it took more pipe breaks (also due to the subrotine calls and returns - it turned out that some code generators did stuff that broke CPU's return stack caches causing many more mispredicts) and finally virtual method dispatches (basicly load a pointer, save the pc on the stack and jump to the new pointer) tended to cause double pipe stalls that couldn't be predicted well at all even though these weren't done much they were a real killer (if you've one a bit of modern CPU architecture you learn that with long pipes you live or die on your branch predictor's hit rate - these were very bad news)

    In short C++ and more genrally OO result in code and coding styles that tend to make code that makes modern CPU's run less efficiently.

    Anyway - you often hear about 'efficiency of programmers' etc etc for OO - I thought I'd add a data point from the other end of the spectrum.

    1. Re:Another reason ... by taniwha · · Score: 2

      2-3 years

    2. Re:Another reason ... by Hard_Code · · Score: 2
      In short C++ and more genrally OO result in code and coding styles that tend to make code that makes modern CPU's run less efficiently.

      On the contrary, what if I think the modern CPU generally makes object oriented code run less efficiently? I mean, does your computer work for you or do you work for it? Maybe CPUs just need to be redesigned so they run high level languages more efficiently. I think you have to #undef ASSEMBLER=GOOD.
      --

      It's 10 PM. Do you know if you're un-American?
    3. Re:Another reason ... by kaisyain · · Score: 2

      They can't be optimized away?

      You might want to check out:

      Urs Holzle and David Ungar. Optimizing dynamically-dispatched calls with run-time type feedback. In PLDI '94 Conference Proceedings.

      Urs Holzle, Craig Chambers, and David Ungar. Optimizing Dynamically-Typed Object-Oriented Languages with Polymorphic Inline Caches. In ECOOP '91 Conference Proceedings.

      Craig Chambers and David Ungar. Making Pure Object-Oriented Languages Practical. OOPSLA '91 Conference Proceedings.

      Craig Chambers, David Ungar, and Elgin Lee. And Efficient Implementation of SELF, a Dynamically-Typed Object-Oriented Language Based on Prototypes. In OOPSLA '89 Conference Proceedings.

      Also of interest from the same authors is "Do Object-Oriented Languages need special hardware support?" in which they find that "in summary, our data show that execution behavior is more a function of compiler technology than of the source language characteristics."

      The SELF compiler, which by now is very dated, required three to five RISC instructions to perform the dispatch test. It also eliminated "more than 75% of all dispach tests, i.e., less than one in four source-level message sends actually involves runtime dispatch overhead."

      And in SELF, every method is virtual.

      So, I reiterate: It's a compiler issue.

  122. Communism? by ragnar · · Score: 2
    He compares OOP to Communism. Give me a break. This is really a matter of perception. He sees it as beaurocratic to have a series of steps before calling a final proceedure. To me this looks orderly and increases the odds that my superclasses or logic wrappers can catch sequence errors.

    The athor actually makes a few good arguments, but it takes some effort to get past laughable comparisons like OOP and Communism. Oh well, I don't mind being a Java programmer, comrade.

    --
    -- Solaris Central - http://w
  123. Is C# the answer? by peter303 · · Score: 2

    C# is the first MicroSoft development product I've
    found interesting. (I've been programming five
    years longer than MS has been in existance.)
    (MS was originally a development products
    house before it got into OS and Apps in the 1980s.)

    There are languages that are theoretically nicer
    like SmallTalk and Eiffel, but not as widespread
    or efficient. There are languages very kludgy
    such as C++ or a little bit kludgy like Java.
    C# larns the best from the C family and is likely
    to widespread and efficient.

  124. The most important OOP benefits by CharlieG · · Score: 2

    I really think that the most important OOP benefits of OOP in order are:

    1)Information Hiding
    and
    2) Polymorphism

    For instance, were I work, we have standardized on certain method names. Want an object to populate itself from the database? Call it's GetData method. Want it to save itself? Call PutData. We've also standardized that each object tells IT'S children to populate/save THEMSELVES. Want to save your whole data tree? Tell the root node "PutData", and your whole tree will walk itself and save.

    No object has to know how to save it's children, it just says to the child "Save Yourself".

    We get programmers up to speed on new projects QUICKLY, because the know the basic methods of all our classes.

    Can you do this in a procedural language? Of course you can, but it's easier in an OOPL.

    --
    -- 73 de KG2V For the Children - RKBA! "You are what you do when it counts" - the Masso
  125. C++ is *NOT* OO! by Eric+Green · · Score: 2
    C++ is syntactic glop on top of "C". Object Oriented programming can be done in any modern language. I regularly write object-oriented "C" code -- when I am programming, I naturally write things as "objects" (structs) whose members are operated upon by the routines mentioned in a particular .h file (the "methods" that go with that "object"). So if I have a struct netstream { stuff } ; in a file named net.h, I also list the routines that operate upon stuff of type 'netstream' (and implement them in a net.c file too, of course). This way I know all routines that operate upon data of that type, and in the rest of the program can create and destroy netstreams and do various operations upon them without having to track down code scattered all over the landscape.

    I think that most of the criticisms that have been aimed at object oriented programming are in fact aimed at particular programming languages and implementations. Object oriented programming has nothing to do with any particular idea of "classes" or "inheritance" or with any particular programming language. I can write object-oriented code in assembly language -- and have done so. There are things that are much nicer when language support exists -- inheritance is not easy to do in "C", for example, while in Python it's as natural as breathing -- but that doesn't make them impossible, merely more difficult.

    Finally: I recently was project lead on a large project written mostly in Python. I can attest that an object oriented paradigm saved us a ton of programming time and coding time. Encapsulating generic database table access into a 'dbaccess' class, then subclassing our various tables using that class, for example, saved us a ton of programming time. There are some of our classes that consist of nothing more than the import of 'dbaccess' and the subclassing of 'dbaccess' in a class whose only (non-dbaccess) members are the data type descriptor strings for that table. Being able to say "d=Destination(destid); tape=d.FindFirstTape() ; if t.is_recycled() ... " is not just the natural result of object oriented programming -- it also allowed my team to write a major application in an amazingly small amount of time.

    My basic conclusion: Object oriented programming is not a buzzword or a programming language. It is simply how you build big programs -- no matter what language you're building them in.

    -E

    --
    Send mail here if you want to reach me.
  126. "Object-oriented" languages by cje · · Score: 2

    If you want to look at it that way, I suppose assembly language is "object oriented".

    There really is no such thing as an "object-oriented language", if your definition is "a language you can write object-oriented code with." As an adjective in that context, "object-oriented" is really only meaningful when it's applied to code. For example, I claim that the following program is legal C++ code:

    #include <iostream>
    int main( void ) {
    cout << "Hello, world!" << endl;
    return 0;
    }


    However, I wouldn't dream of claiming that the program is "object-oriented" simply because C++ is perceived to be an "object-oriented" language. Obviously, I have not made use of any object-oriented facilities, so there is no way that I can make this claim. However, when I write a GTK+ program in C, and I call gtk_widget_set_usize() with arbitrary widget types, including some that I have created myself by inheriting built-in widget types, I can (correctly) claim that I am writing OO code, even though C is not perceived to be an "object-oriented" language.

    The useful working definition for "object-oriented language" must remain what it always has been, namely, "a language that supplies direct, language-level support for OO concepts." That does not mean that you're required to write OO code in that language, nor does it mean that you cannot write OO code in other languages that do not meet that definition.

    --
    We're going down, in a spiral to the ground
  127. No Magic Bullet. by maddboyy · · Score: 3

    This article can be applied to any kind of programming paradigm. Basically, the author concludes that OOP isn't any good because some developers and managers aren't applying it correctly. Well, that's the case for procedural programming, declaritive, functional, etc. Yes, OOP will not solve the problem of rushed projects, poor management, or stupid programmers; neither will any other programming style though.

    Programmers just need to be familiar with multiple programming practices and languages. Programmers need to know when just hammering out some _properly_ planned procedural code will fit the case better than some _properly_ planned OO code. There is no magic bullet and because of this, I think it's a bit pointless to say that one programming style is leaps and bounds better or worse than another.

    I really wish the author had the confidence in the claims to actually site some hard facts and not some made up claims. Most of the article just seems like old rehashed FUD from the dawn of the OOP movement. The author mentions all of these failed business apps and blaims OOP for their problems. I guess IBM, Oracle, NASA, and some of the other big software shops are a bunch of idiots for doing any OOP. But of course this guy must be an expert on software design practices and that's why he has a Bell Labs URL.

  128. I am that "troll" by Tablizer · · Score: 2

    Welcome!

    I am the author of that page.

    Rather than do a summary dismisal, how
    about specifics. Better yet, meet
    the "biz app" challenge listed there.

    IOW, put your code where your mouth is.

    Nobody has found any objective proof
    or metrics which show OO better in
    the stated niche.

    Less lines of code? NOPE!
    Less change points? NOPE!
    Better "grouping" NOPE!

    (Often it trades one perfectly valid
    grouping for another perfectly valid
    grouping. IOW, zero sum benies.)

    If it is 50 percent better, then proof
    would be easy. If it is 10 percent better,
    then personal differences are more
    significant than averages.

    Anybody want to race to the finish?

  129. I smell burnt Taco... by the+red+pen · · Score: 2
    Shoeboy, will you be grillin' up that Sacred Cow? I'd like cheese on mine...

    tee hee hee

  130. OOP can be helpful by Vassily+Overveight · · Score: 2

    I think the usefulness - or lack thereof - of OOP depends a lot on one's personal learning/working style. Sort of like some people are perfectly fine with abstract mathematics, while others need to relate math to the physical world in order to understand what's going on. Personally, I find it helpful to create objects that possess properties and accessors to get at them. It not only makes what I'm creating more 'real', but it divides the application into nice self-contained chunks that can be dealth with separately.

    --

    "If I have seen further than other men, it is by stepping on their glasses." - Michael Swaine

  131. Re:Author is a USENET troll/pest by FatHogByTheAss · · Score: 2
    No doubt. He is a well known troll on comp.lang.perl.misc. When he showed up there the first time, he was pissed that Perl wasn't Visual Basic, then he went away for a while. When he showed up again, he was pissed that Perl wasn't COBOL (seriously). The truth is that he has escaped from the accounting department, and fancies himself an expert on whatever topic he read about last. However, it doesn't surprise me that the moronators that moronate /. thought his rantings worthy of their own ariticle.

    --

    --

    --
    You sure got a purty mouth...

  132. If your non-oop coding sucks, by GameGuy · · Score: 2

    it's still gonna suck if you use OOP.

    OOP has it's place, like everything else. Tools should be used when the best fit - ever try to drive a nail with a wrench? Anyone selling a one tool that does it all..well...I think I just answered that..

    On the other hand, saying OOP has no value is just narrow minded.

    --
    The Game Guy
  133. Re:Real world objects, procedural objects by aardvarkjoe · · Score: 2

    "a chunk of code that performs some task?" We got those -- them's a relatively unknown C contruct, called a -- dagnabbit, what's it called ... oh, yeah -- function. Yeah, you can make an object out of just about everything, if you feel like it ... but that doesn't make it the best way to go. I absolutely cannot see how simply surrounding functions with an object-oriented architecture is helpful. That's what I was trying to point out.

    --

    How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
  134. my own 2 cents by segmond · · Score: 2

    I am not a huge OOP fan, but I firmly do not believe it is hype, yes, it has been OVER HYPED, but when you take the hype out, it is still worth it. OOP is not the solution to everything.

    I was weaned on C and assembly. I learned to write structure code, C and assembly fits fine perfectly, I can sit down and hack C freely without thinking of the problem ahead. Doing so with OOP approach is next to impossible, OOP makes you work, I hate it most of the time, and that is the reason why most people hate OOP, if you have the hacker mentality, you will hate OOP approach.

    But, even with the hacker mentaility, OOP can still be good, anyone here who has done GUI programing with C, C++, Python or Java knows that language that totally dominates is the languages with support for OOP not C. If you have done programming with CORBA, you will appreciate OOP just as well. Look at Orbix for example, the fastest CORBA ORB that I know, the dirtiest to hack for, look at other ORBs supporting C++, not the fastest in terms of execution speed, but much much painless to code for.

    Some people might want to argue about speed, but in this age we live, it is no longer about the speed of execution, but of development, at least in my case.

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  135. It all depends on how you view OOP by garoush · · Score: 2

    If you take OOP as a "silver bullet" solution for your development problems, than yes, you have fooled yourself. What a lot of people missed out about OOP is the fact that OOP does nothing but "unifies" common programming practices and provides a common "language" and communication gateway for developers to use when they are working on their projects.

    Without OOP, we could all be talking about MVC (Model/View/Controller), call-backs, iterates, etc. in a completely different language and yet not understand each other which result into communication breakdown.

    For those who are not familiar with OOP my suggestion is to read the "Design Patterns" book. The book doesn't talk about anything new or revolutionary. On the contrary, all the stuff in the book (and most other OOP books) are things that were covered over 30+ years ago. All what the book does is "unifies" those practices so that the next time when two developers are working on a call-back design, they don't just give it their own invented "cool" name or "cool" implementation.

    Folks, OOP is no different than what you would find when you talk to an electrician (or any other well establish engineering field). In those fields there are "standard" language, process, and practices that get carried out and communicated. It is time for the software filed to standardize too.

    Finally, regarding the payback of using OOP that the article pointes out -- there are countless research and study that show that on medium to large projects, OOP is the way to go.

    --

    Karma stuck at 50? Add 2-5 inches.. err.. 2-5x Karmas Count to your pen1es.. err.. Karma all naturally and private
  136. Hmm... by cr0sh · · Score: 2

    One thing that bothered me was his tax example program. He states that:

    We are assuming that Tax may handle other entities besides people, so we are making it a separate class instead of a method of Person.

    Now, I am not an OOP programmer by any means. But wouldn't you do some form of inheritance of the base class Tax, forming a class Person_Tax (which might have specifics to people, but inherits other Tax items), then create an object method in Person based on this class?

    I know my terminology may be screwed up, but I know that you don't need a whole seperate class in this example - you are just ordering and reusing components through inheritance. The power from this comes when you change, say, the Tax class - everything trickles down, and updates all other uses of the class and objects created from the class - so you don't have to change things in a billion different areas in your code, like you may have to in a procedural language (now, with good design and attention, you would black box a procedure with arguments you could pass in telling it what to do, like Function CalcTax(type, unit, var1, var2) - so that tax = CalcTax('Person', 'John Doe', var1, var2) is different from tax = CalcTax('Corp', 'JD, Inc.', var1, var2) - and this could be extended for various types, and modified if needed, affecting all areas that called this routine to calculate tax - however, this has to be the only routine used to calculate tax)...

    Worldcom - Generation Duh!

    --
    Reason is the Path to God - Anon
  137. Thanks for the admission. EVERYBODY ELSE! by addison · · Score: 2
    Before you go replying....

    http://pub1.ezboard.com/fobjectorienteddevelopment languagewars

    Trust me. you WANT to read through that.

    Trust me.

    You'll be rehashing the same things over and over - read that first, and then decide if it is a "fair challenge" (minor note - most of the people there have been "discussing" this for 2-4 years with him).

    Addison

  138. OO Design Techniques - OpenSource and more... by Rotten · · Score: 2

    OOP is always what comes after an OO Design.
    Yes, OO Design is far superior than other Design techniques, but sometimes is also harder. Why? Because you have to give your designers the WHOLE PICTURE since the BEGGINING OF THE PROJECT.
    The Designer comes to play a key role here.
    In my poor experience (counted in years, not decades ;)...non OO Design Techniques actually gave shorter design times, but when the design team was gone (working in the next project) coders have to start to work out ugly hacks in order to make the system work like the customer wanted.
    Whit OO Design, you can present your customer a nice graphical interpretation of the system behavior BEFORE EVEN IMPLEMENTING A LINE OF CODE. And yes, my mom can understand those UML diagrams...it's easy.

    At the implementation level, OOP and NON-OOP are good in their own category. But wait! A programming languaje is as good as the programmer using it.
    I've seen nasty things using OOP and real good things using plain old C.

    So, to this point, we can see that OOP is very design dependant.
    The rehusability grail is very design dependient. I can make a "CAR" class, or I can make a "VEHICLE" class. That's up to the designer. But when the same group of programmers/designers/software engineers have to write a "BUS" class, because the "CAR" is quite different...well, REUSABILITY my ass. Stop everything and start over again. (up to some level, the CAR experience will be usefull, but not transparently and automagically reusable).

    So, I won't blame OOP, I tend to blame OO Designers. And yes, I think that most commercial projects (small to medium) don't get benefits in using the OO combo.

    OO Techniques (Design and Coding) could be a big benefit to the OpenSource Community.
    I remember www.theClassRoom.org, nice idea.
    Collect classes from opensource projects and present them to the Community for reusing.

    Have you ever seen a image bank? Well, I think of many good uses for a class bank.
    Search, read license, copy, paste, use, extend, submit to the community. The real Open Source spirit.

  139. Suspect rhetoric by hyacinthus · · Score: 2

    I happen mostly to agree with the thesis of this article, that OOP has been applied indiscriminately as a programmer's panacea. The head of development at my previous job was a tremendous proponent of OOP, and he urged us all to read DESIGN PATTERNS and write up detailed class hierarchies. If there were any savings in effort and reduction in complexity, I didn't see them; instead, I saw a proliferation of classes and a disposition to spend more time drawing up nice-looking diagrams than in grappling with real problems.

    But I don't care for some of the rhetorical tricks this article uses. Graphs without units or cited source, e.g. the "productivity comparison" which laughably charts "results" versus "time" for OOP technique and the highly specific category of "other". The bandying-about of general claims, with the excuse, "Sorry, we lost the references." The scarcity of citation throughout the document (and _no_, a URL link to another website does not count as another citation; I'm talking about citation from _real_ sources with good credentials.) Belabored, if not ludicrous, analogies (OOP and communism??) And of course, the obligatory venom towards academia.

    One day, I hope, "computer science" will not be an oxymoron. But mostly I see stuff like this article--intelligent to a degree, propounding arguments which merit some consideration, but in the end, just as much a "religious" document as the OOP texts the author disparages.

    hyacinthus.

  140. Where OO is good. by rkent · · Score: 2
    First of all, I laughed out loud when the article pointed out the futility of a lot of OO "training" programs, like modeling heirarchies of shapes ("SQUARE is a subclass of RECTANGLE..."). I mean, how often have you ever needed to CODE that?! So, good point there.

    But, that does kind of relate to the domain where OO is maybe best: GUI programming. This is a point acknowledged in the article, so I won't try to use it as a counterargument. Overall, that page does a pretty good job of claiming that OOP is overhyped, and not perfect for every situation. The author's not saying it sux0rs.

    However, I think there is one important domain that was missed: database interaction. The author makes the point that a lot of seemingly OOP-related problems, like employee types, etc, are maintained by accountants in database relations, and not by coders in their programs. BUT, there are some great frameworks for interacting with database rows & relations as Objects! Here I'm mostly thinking of Apple's EnterpriseObjects, but please enlighten me about your favorite one.

    In my experience, using code-level Objects to access database rows instead of raw SQL can be a helluva timesaver in many situations. And, to free engineers from controlling the data schema, EO even comes with a data modelor that can automatically generate Obj-C or Java classes to manipulate your database data.

    IMHO, than rocks. I've written server scripts with raw SQL statements, and trust me, this is much easier. Even if we don't reuse it for 30 years. The main problem I see is that EnterpriseObjects in particular has like 6 billion layers of abstraction, so the performance is never quite what you'd like. It seems like there'd be some kind of compromise, though.

  141. Do we need an addition to the moderation system? by puppetluva · · Score: 2

    Maybe we need a way to mark a top-level post as "flame-bait" now.

  142. Author is a USENET troll/pest by h_jurvanen · · Score: 5
    For a long time now USENET groups like comp.object have been tormented by the author of that article with his constant barrage of FUD and inability to construct meaningful arguments. For an idea of what I'm talking about, check out his posting history.

    Herbie J.

  143. Polymorphism by slamb · · Score: 3

    The author doesn't describe in depth what I consider one of the greatest advantages of object oriented programming -- polymorphism. Polymorphism is great because it allows you to invoke different methods for the same operation based on the derived class.

    That makes more sense with a real example. I'm working on a set of classes that has a Stream abstraction. Derived classes must provide ways to do raw reads and writes, close the stream, and a few other things. (Preferably, they also provide some way to open the stream -- but that's not a virtual function.) The stream class itself provides buffered IO and some convenience functions for writing stuff in network order, a nice gets function, etc.

    That allows me to have the same easy IO operations on top of many different kinds of streams:

    • OSStream - what the operating system considers a stream. Can attach to a given fd, etc.
    • FileStream - derived from OSStream, adds the ability to open a named object. (kind of a misnomer, could be a FIFO or whatever.)
    • StreamSocket - also derived from OSStream, blends with a lot of socket functionality.
    • PGLargeObjectStream - a PostgreSQL BLOB (binary large object). Basically, like a file but stored in a PostgreSQL database instead of using an inode. Handy because filesystems have limited number of inodes, not good for lots and lots of small files.
    • SSLStream - a SSL connection, requires another open Stream (probably a StreamSocket) to connect.

    Each one of these provides the same basic abilities -- reading/writing, seeking/telling (where applicable), closing, etc...but they do it in different ways. I need abstract read/write code so I can put shared higher-level code on top of it. Otherwise, I'd have to reimplement the higher-level code for each one. That would suck.

    This doesn't even necessarily need an object-oriented language, just an OO concept. OpenSSL, for example, has a set of C functions that do a lot of the same things I'm talking about. It does it by providing a struct with function pointers...basically, a virtual function table. It's definitely not as pretty (I wish they would have just done it right and used C++) but it does work.

    This is just one advantage of object-oriented programming, but I think it's a very significant one. Worthwhile by itself.

  144. Re:Anonymous hack berates OOP by ichimunki · · Score: 2

    I have to think that some of the moderators around here are on crack (as in why is my parent post either flamebait or a troll?). I posted very early on, with a succint summation of what a load of crap this article was-- all of my hunches were proven true as I read the comments. The guy who wrote the article apparently frequently complains about this stuff on Usenet. He is apparently widely considered a flake for it. In his article, which I read before posting, and suspect the moderators did not do before moderating me down, he comes across as someone who has lost project bids to people who were more buzzword compliant than he is. And rightfully so since he appears to want to code in Fortran and something he calls "table oriented programming". His article completely overlooks functional and logical design as alternate paradigms, additionally he has added no real world examples (his charts are completely fictitious since as he says, "no studies have been done") to back up his claims either way.

    In fact he does compare OOP to communism. And rather poorly since his complaints about communism all seem to be derived from problems he has with American democratic capitalism and it's overwhelming bureaucracy. The article is lame. Slashdot putting flamebait like this on the front page is semi-lame. It did engender one of the better discussions Slashdot has had in my recent memory, which makes it forgivable in my book.

    --
    I do not have a signature
  145. Real world objects, procedural objects by Eric+Green · · Score: 2
    One thing that Python makes easy is the concept of a procedural object -- a chunk of code that performs some task. For example, in BRU Professional the tape switcher (that switches tapes in a tape loader as you proceed in a network backup) is a procedural object. The high level backup/restore/verify code that actually manages tapes initializes the tape switcher with a list of what slots in the tape changer to go to for which volume in the backup, then passes this tape switcher object down to the lowlevel code that actually touches the hardware. The lowlevel code then calls the tape switcher object's "load a volume" method whenever it needs to change tapes.

    I can't think of anything more procedural than an actual tape backup, but even there many things can be easily abstracted out as objects -- not just the high level stuff like "drive" and "tape", but also lower-level procedural items such as changing tapes.

    -E

    --
    Send mail here if you want to reach me.
  146. delaying gratification (hacking, not spanking) by Sebastopol · · Score: 2

    OO isn't fun for boys because it requires too much foreplay. 99% of 'em just wanna charge of to the clitoris and hack hack hack.

    The way I sees it, OO philosophy splits effort 80/20: 80% on planning, documenting, philosohpy, interface, roadmap (compatbility fwd/bckwd)etc. --20% is actually writing code.

    Granted one could argue that any good coding effort requires the above, however on projects I've work (C/x86-asm), 30% is spent deciding what to do, and 70% of the time is spent designing and coding simultaneously. Which can work, b/c procedural coding is immediately gratifying, whereas intelligent OO requires much more foreplay, er, planning.


    ---

    --
    https://www.accountkiller.com/removal-requested
  147. OOP *is* really the next level by Adam+Wiggins · · Score: 3

    I fought it for many years, and finally gave in. Now I wonder how I ever got by without it.

    There are applications - small ones - for which OOP is not appropriate. Code which generates web pages, for example, is generately best written in a procedural language. The vast majority of applications, however, are easier to extend and maintain (although not necessarily write, at least until you've been doing it for quite a while) if written with OO.

    And of course, you don't need an OO language to use OO. The Linux kernel is very OO, and it's written in C.

    FWIW, the examples given in this article are terrible. Not only are they not very relevant, but they are badly written. If someone I was working with wrote OO code like that, I'd seriously question their ability as a programmer.

  148. Re:the key phrase is: properly implemented by HiyaPower · · Score: 2

    What you say is quite true and I could not agree more. I have seen a great many things butchered because of the mindset that is used. To make programs work properly with oop and/or databases work properly with relational methods imply thinking of things as the object with a set of qualities, attributes, & etc. first, and then only after that, deciding what they mean. Thinking is a different paradigm than coding (sorry to say) and is not easily taught.

  149. Re:The King of Argument By Authority (Addison) by BlackStar · · Score: 4
    I roundly disagree with the arguments presented against OOP, on the basis that the author's own references cite the advantages of it, as well as the disadvantages. The consensus on the reference *academic paper* is that it had advantages, but is not necessarily "revolutionary". Indeed, OOP codifies much of what *can* be done with good programming practice in procedural or even functional programming.

    My experience in systems design is that OOP shows benefit when you know it, and with larger *REAL* systems. Networked apps, distributed apps, and yes, even large business apps. I've been involved in an IS project written completely in C, using good, structured programming techniques. At a different company, we were building a similar application, using C but applying a more data-centric approach, close to OOP but not there yet. It was much quicker to build, and easier to enhance. If I took a crack at the domain yet again with OOP and C++/Java, I know it could be improved yet again.

    The issue though, is that if it's one guy, building a one-shot fire and forget app, don't bother. Code it however you want. If you have a significant project with multiple team members, OOP acts as a common framework and a basis for communication. It draws some borders and sets some guidelines and methods to give a common frame of reference. It's possible, but more difficult to do that with procedural code in *most* cases.

    Obviously though, the proof, as the author says, is in the pudding. Millions upon millions of development dollars is OBVIOUSLY being wasted by the industry as it moves to use OOP methodologies and tools. Not just as dictated by PHBs, but also as dictated in start-ups by lead programmers.

    Quote from a pundit who knows the industry better than most of us, Robert Cringely, from a slashdot interview no less:

    Something else that has changed a lot is how software is written. OOP has paid off more than we even know, so there are a lot of chances to make businesses out of selling cogs that fit into other people's machines. Your driver question, for example, wouldn't have even made sense a decade ago.

    Hmm. More than one company now. There's a benefit. Predefined interfaces and component technologies. Can you do that in procedural approaches, yes. Is it easier and more natural and efficient in OOP, yes.

    And finally, as I don't want to get too long, let's take another /. post, a reply from John Carmack.

    First of all, the fact that none of our deployed games used OOP does not mean that I don't think there are benefits to it. In the early days, there were portability, performance, and bloat problems with it, so we never chose to deploy with it. However, all of the tools for DOOM and Quake were developed in Obejctive-C on NEXTSTEP. Q3 also came fairly close to have a JVM instead of the QVM interpreter, but it didn't quite fit my needs. I'm still not a huge C++ fan, but anyone that will flat out deny the benefits of OOP for some specific classes of problems like UI programming and some game logic is bordering on being a luddite. I still don't think it is beneficial everywhere, but, if anything, I think we are behind the curve on making the transition.

    Hmm. Use the best fitting tool. But even a die-hard success phenomenon like John Carmack seems to think OOP is good for things link UI AND game logic. Not everywhere. No argument from me.

    Jeez, I think he essentially can be construed as having called the author of the original post a luddite.

    I tend to agree.

  150. Implementation and interface by Eric+Green · · Score: 2

    In my view, the advantage of writing things in an object-oriented manner is not that you can change the implementation without changing the interface. The advantage is that if you ever do have to add things to the interface (e.g., if you find that your nice foobar class needs a new blurbfoo attribute) it's easy to find all the functions you need to touch in order to add that new blurbfoo attribute -- because they're all there as part of that class (if you've done your job right).

    --
    Send mail here if you want to reach me.
  151. Re:insults != wrong by pjrc · · Score: 2
    Tabilzer writes:
    >BTW, where are your 3 examples?
    >Where is one?
    >What, no proof?
    >Ah, poor widdle kid.

    Why don't you dig up some of those references you accidentally lost?

  152. Failure to Understand by smack.addict · · Score: 2
    Critics of OOP fail to truly understand what it is that OOP offers. OOP does not offer quicker time to market. It offers easier maintainability, and maintenance is where most corporate money is spent. But it only offers that maintainability if the programmers in question actually follow good OO practices--in other words, they have to be disciplined.

    Most OO horror stories come from a lack of discipline. No matter what programming language you use, if you do not have a solid OO design, you have failed to do proper OO programming. It does not matter what programming language you are using.

    The result of proper OO development--and unlike the author of the article, I have seen successful OO projects--is a system that is easier for people who had nothing to do with the original to come in a evolve the system. And that is worth a lot to companies.

  153. A wise man I knwo said.... by catseye_95051 · · Score: 2

    "C++ makes good programmers better, and bad programmers obvious."