Slashdot Mirror


The Post-OOP Paradigm

Kallahar writes "American Scientist has an article up about Computing Science: The Post-OOP Paradigm. The article has a great overview of how OOP works, and then goes on to a brief outline of the possible successors to OOP such as Aspect, Pattern, and Extreme Programming. Also a pretty picture of OOP Spaghetti."

64 of 363 comments (clear)

  1. Analysis by ChaoticChaos · · Score: 2, Insightful

    How could Aspect, Pattern, and Extreme Programming replace OOP? That's ludicrous.

    Aspect programming doesn't have inheritance (that I am aware of) so it is a weaker model than OO. Although we should "...favor composition over inheritance", it doesn't mean we should do away with it! Also, where the polymorphic method behavior of Aspect?

    Pattern design's foundation rests on OO. Take away OO and Pattern can't exist.

    Extreme Programming has nothing to do with any of the above. It's not even an architecture. It lives under the misguided notion that since team-analysis works well, team-programming must work well too. ;-)

    1. Re: Analysis by jdgeorge · · Score: 4, Interesting

      Please read the article before you post.

      The article states:
      Most of the post-OOP initiatives do not aim to supplant object-oriented programming; they seek to refine or improve or reinvigorate it. A case in point is aspect-oriented programming, or AOP.

    2. Re:Analysis by FortKnox · · Score: 2, Interesting

      Beat me to the punch. I had the exact same notion. Aspect is a new idea that is going around. Patterns are basically a 'way to code' OOP (being general, here). And putting XP makes me think the author of the article or the submitter has absolutely no idea what they are talking about (site is /.'ed so I can't tell you which).

      Tablizer, however, has ideas to an alternative to OOP that are quite interesting.

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    3. Re:Analysis by Uber+Banker · · Score: 2, Insightful

      Totally agree...

      OO is a concept, not an implementation... as is XP... they are not mutually exclusive (and concepts/languages are often complimentary) so how can one replace the other? Is this supposed to be a flamebait article?

      SMALLTALK FOREVER! man, i hate C++, but still use it every day... POOP surely is a misguided notion :)

    4. Re:Analysis by syle · · Score: 4, Interesting
      Aspect programming doesn't have inheritance (that I am aware of) so it is a weaker model than OO

      This is meaningless logic. You might as well say, "A motorcycle is worse than a car because it doesn't have four wheels." No. If it had 4 wheels, it would BE a car. A paradigm that competes with OO is not weaker just by virtue of not BEING OO.

      --

      /syle

    5. Re:Analysis by haystor · · Score: 2, Interesting

      Or another way of looking at this is that the GoF had a limited imagination and didn't describe any patterns that don't involve OO. This can actually contribute to the problem by naming some OO patterns when there are tons of ways to do things non-OO that work perfectly well.

      --
      t
    6. Re:Analysis by ChaoticChaos · · Score: 2, Funny

      You'd have one helluva time rewriting Strategy Pattern in COBOL. I'd like to see that. I'd pay money to see that. ;-)

      How about Bridge? That's meaningless in a non-polymorphic language like COBOL.

    7. Re: Analysis by Chasuk · · Score: 3, Funny

      I believe ChaoticChaos was responding to this: ... the possible successors to OOP

      This was contained in the body of the submission, which certainly would imply that the submitter hadn't read the article, either. ;-)

    8. Re:Analysis by listen · · Score: 2, Informative

      Which industry?
      Most commercial code now is written in C++, followed by Java, and then sadly VB.
      To be honest, for most of the work they do they are better off. For most of that they would be even better off in a higher level language like Python (if addicted to OO-procedural), Lisp or
      Haskell.

      C is unfortunately considered backwards by a lot of code grinders. It gets most use in the embedded systems and OSS worlds....

    9. Re:Analysis by archeopterix · · Score: 2, Interesting
      How could OO replace assembly? That's ludicrous. OO doesn't have goto and self-modifying code (that I am aware of) so it is a weaker model than assembly.
      A better analogy would be OO vs structural programming. OO didn't replace it - you still have the ifs, whiles & one entry point per procedure (ok, it's usually called method in OO).

      Similarly Aspect, Pattern and XP won't probably replace OOP but rather extend it, if any of them really catch on. Perhaps the functional approach will replace OO at some point in time, but I'd rather bet on some form of OO/functional mix. Python already is a bit like that - it has the functional tools like lambda, filter, map and reduce plus of course objects.

  2. OOP is frequently the wrong answer by joe+cow · · Score: 5, Insightful
    I don't think OOP is dead. Certainly these languages don't have the foundation necessary to overtake OOP's good features: inheritance, (and thus code reuse) and methods.

    However most OOP programmers try to over-OO everything. This is a problem from day one - their instructors show them how to make an object and how cool it is to have the object do something on its own. Thereafter, the students objectize everything. This leads to situations where you've got horribly bloated code that runs slow as hell.

    It's this kind of instruction that leads to programmers writing whole object-oriented interfaces to things that can be very easily manipulated without all the overhead. For example I had a consultant working (briefly) with me who wrote several thousand lines of code that would edit colon delimited files (like /etc/passwd, for example) when a simple strtok in C or split() in perl would have done the trick in a few lines, without all that code to debug.

    People need to always take a step back and see if the language contstructs they plan to use are appropriate for the task at hand. More often than not, they'll find that they higher level languages are too much. Don't write a C program when you can write it in shell. Don't write daemonizing code in your app if it can run from /etc/inittab. Don't write a scheduler when you can do it in cron. And never write OO when procedural programming can do the same trick in less space.

    1. Re:OOP is frequently the wrong answer by yuri · · Score: 5, Insightful

      That's not OO programming, thats a useless programmer, who wastes more time and creates more bugs than a perl programmer just made redundant.

      A good OO design would of encapsulated the functionality in a small class. not thousands of lines, just a few more.

    2. Re:OOP is frequently the wrong answer by miyako · · Score: 3, Insightful
      I couldn't agree more, as someone who is currently attending a university, and has several years of programming experience, I have seen this several times.
      I'm not sure if the problem stems from instructors reluctance to admit that there is "too much of a good thing", or if it stems from students having never been introduced to anything else.
      One big problem I have seen in my own classes is that you have a class full of students, and maybe 1 or 2 of them have any programming experience at all. They go in and are instructed on basic logic and then given a class on Java and the wonder of OOP and they never learn anything else.
      We then have (and this problem is not isolated to just the tech industry) a sea of mindless drones being pushed out into the real world and solving all the problems exactly the way they were instructed to without an ounce of actual though or insite.
      You combine that with these new paradigms that basically become buzzwords and you have a bunch of people with no real idea what they are doing getting caught up in the "next big thing" without any idea of when to use what.

      you know you have a problem when someone in your 300 level programming class asks "what's slashdot?"

      --
      Famous Last Words: "hmm...wikipedia says it's edible"
    3. Re:OOP is frequently the wrong answer by Billly+Gates · · Score: 2, Insightful
      Unfortunatly company standards get in the way of writing things in langauges like Perl.

      I use to work for a company were only c++ and java could be used. This includes unix scripting. Its the standard and managment actually thought having programmers like yours writting thousands of lines of code was saving them due to support costs. Incredible. I wonder if standards obbsessions are hurting IT more then helping it.

    4. Re:OOP is frequently the wrong answer by wickedhobo · · Score: 2, Funny

      You insensitive clod. Stop treating me like an object!

      --

      --Stupidity is Self Curing!
    5. Re:OOP is frequently the wrong answer by enjo13 · · Score: 3, Interesting

      Wrong wrong wrong.

      What you are identifying is misuse of an OO language, not an inherent shortcoming in an OO system.

      Your StrTok is an interesting example. StrTok is not part of any language (true, it's part of the C Standard Library but not an inherent part of the language itself). Thus, if you had to write the tokenizer yourself I would expect basically similiar amounts of C code when compared with the C++ equivalent. The properly modelled OO system would have slightly more code to deal with the class related 'stuff', but in the end they are basically equivalent.

      Your initial example of 'students (who) objectize everything' is also flawed. Part of the trick to OO programming is that you must place more emphasis on arriving at proper abstractions. In general a properly abstracted system will require quite a bit less work than the equivalent procedural one. The resulting program MIGHT be slower, but that's more of a language reality than paradigm shortcoming. Properly designed and abstracted OO systems are easy to maintain and much more accomodating of change when compared with similiarly designed procedural systems.

      I completely agree that we should always strive to use the tool that gives us the best results. One inherent problem is that we have to answer 2 questions, however. Is this the right tool for NOW... AND is this the right tool to help me design the system that I may need in the future.

      Some times the answer is obvious. I'll generally write a shell script of some kind to deal with daily admin types of tasks (IE: Sed to split delimited files for other procesing), but most of my product development tasks require me to look to future flexibility. I find that higher level languages, and OO languages in particular, allow me to design proper systems that can handle the addition of new features and new concepts much better than lower level counter-parts.

      NOTE: This is not a discussion of the relative merits of C++ vs. C. Before people start blasting into this saying 'I can design any system in C that you can in C++..' and I would agree. It's certainly more cumbersome, but at some point expressive languages (like C) are able to be utilized using new paradigms (like OO). In other words, C CAN be a OO language if you use it like one.

      --
      Turn s60 photos into awesome videos with mScrapbook for all S60 3rd edition phones!
    6. Re:OOP is frequently the wrong answer by Arandir · · Score: 2, Interesting

      Don't lay this sin solely at OOP's door. We learned it from Structured Programmers, and are smugly pleased that Generic Programmers are knee deep in this iniquity as well.

      Any formalized process can be taken to an extreme. And you yourself are arguing for a formalized process as well: "And never write OO when procedural programming can do the same trick in less space." Sometimes it might actually make sense to write it in OO, because other things may be more important than less space! Programming isn't a field of morality where you must choose a particular code of ethics to abide by no matter what.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    7. Re:OOP is frequently the wrong answer by renehollan · · Score: 2, Interesting
      Sometimes I see things where all classes inherit from an "object" class, which inherits from a "structure" class, which inherits from a "somebytes" class et cetera ad inifitum

      That's not necessarily a bad thing: it may be indicative of an attempt to generate automatic serializers/deserialiers for objects by providing sufficient compile-time type meta-information.

      Unfortunately, the resulting code gets littered with the helper classes and remnants of the hierarchy you describe. A traditional (or non-traditional) IDL representation with a pre-processing step that generates class declarations and marshelling code (or tables) tends to be a bit cleaner, though then you run into the issue of having to program in "yet another language".

      --
      You could've hired me.
    8. Re:OOP is frequently the wrong answer by Bodrius · · Score: 2, Insightful

      I don't think OOP is dead. Certainly these languages don't have the foundation necessary to overtake OOP's good features: inheritance, (and thus code reuse) and methods.

      I'm confused... Languages?

      The article discusses paradigms, approaches to programming. And then makes sure to clarify that modern "paradigm shifts", unlike the drastic jump to structured programming, are complementary to OOP rather than replacements.

      Besides that, I don't think inheritance and code re-use are the "good features" of OOP.

      Sure, they're great, but I think they're overrated when taken as the main goal of OOP, and lead to the typical problems people complain about: confusing, multiple-layer hierarchies with ridiculous levels of abstraction in an attempt to reuse, or make reusable, the most lines of code.

      IMNSHO, the main "good feature" of OOP is that it can make a program semantically clear: use the language of the problem to code the solution. This makes extension, and code re-use easier, but first of all leads to a cleaner program that is more likely to solve the problem.

      However most OOP programmers try to over-OO everything.

      That is true, and there's also a similar sin: over-design everything. In OOP sometimes it's not easy to differentiate, but there IS a difference.

      The problem is that it's not easy to see where you're over-doing it, and it's very easy, and common, to regret not going far enough a few days later.

      XP has a refreshing, if a bit anal (in theory), approach to this.

      For example I had a consultant working (briefly) with me who wrote several thousand lines of code that would edit colon delimited files (like /etc/passwd, for example) when a simple strtok in C or split() in perl would have done the trick in a few lines, without all that code to debug.

      Well, that description may be fair or unfair to the consultant depending on the project.

      A custom tokenizer that is more flexible and powerful than the ones provided by the language (and yet is not a regex engine with all the overhead it implies) seems to be a common need.

      On the other hand, it's not like there's plenty of libraries and available components if you really needed something like that.

      And 99.99% of the time you don't (which is why languages include simple, more efficient tokenizers).

      It's this kind of instruction that leads to programmers writing whole object-oriented interfaces to things that can be very easily manipulated without all the overhead.

      No. What makes programmers write OO APIs to non-OO low-level procedures that can be used without the overhead, is that they know you'll need to use them from within some other, probably OO-ed, project soon and reimplementing them is silly.

      At least that's the good reason to write OO APIs to your utility libraries.

      More often than not, they'll find that they higher level languages are too much.

      Funny, I would think higher-level languages tend to be "much less" due to abstraction, and therefore it's rare for them to become "too much".

      Often it becomes "too much" because you're reinventing the wheel: the string tokenizer example. If the project was not to actually build a string tokenizer, and one is building a string tokenizer as a sub-project to meet the actual goal, it's a good idea to check whether you really don't have one laying around somewhere.

      Other times it becomes too much because, as you mention, you're OO-ing or designing too much, and end up with an algorithm that is too general (and requires general tools).

      How this relates to the "high level language" per se, I don't know. I would think you could be equally stupid and try to reinvent the wheel with assembler. But you do have a point that OO programmers seem more vulnerable to this.

      --
      Freedom is the freedom to say 2+2=4, everything else follows...
  3. Refinements, not successors by f97tosc · · Score: 2, Insightful

    It does not make sense to say that these other ideas are succeeding/ replacing OOP. I don't think that people practicing for example Extreme Programing have stopped using objects, or that they promote the use of global variables.

    Rather, there are refinements and additions to OOP, and they cover subjects that have not been addressed before. It is not that they address the same issues with a new set of solutions.

    Tor

  4. OOP Spaghetti ... by DogIsMyCoprocessor · · Score: 3, Funny

    not to be confused with this flavor of spaghetti.

    --

    "And this is my boy, Sherman. Speak, Sherman." "Hello." "Good boy."

    1. Re:OOP Spaghetti ... by 4of12 · · Score: 2, Funny

      I daresay that OOP can make a plate of spaghetti look relatively uncomplicated.

      The spaghetti analogy to OOP works better if the spaghetti is overcooked, so that pulling a single strand causes an enormous giant squid-like multi-noodle to emerge from the depths.

      To make the analogy really complete, though, you would need to mix in some other topologically-interesting pasta shapes, maybe even a few Klein bottles.

      To top it off, when you dredge up a strand of spaghetti with a fork, if you started to pull out a re-instantiation of self connected to a fork pulling out a noodle, then that would start to mimic what you can find in OO code.

      --
      "Provided by the management for your protection."
  5. OOP is always has its place by stonebeat.org · · Score: 2, Insightful

    I dont understand why people think Pure Object Oriented Databases will replace Relational Databases or ORDB. All type Pure OODB, ORDB, RDBMS all will have there place.
    Same thing with OOP, there are tasks which lends themselves better to OOP vs functional programming, and vice versa.
    Every technique will have its place.
    We have the same mix-conception about XML replacing everything else. e.g.
    <actor name="Martin" show="Simpsons">
    <sprach volume="high">ha ha!</sprach>
    </actor>

  6. In other words... by Anonymous Coward · · Score: 2, Insightful

    ...doing your design on the fly? Which is what everyone does anyway? Why is this something new? If you read any coding manual, they try to impress on you that you should plan your design from the start, then code it. Reason being that in the long run, less time is used. Well they'd only mention this if the "wrong" way was to just hash it out as you code. So if planning your design is the opposite of just figuring it out as you go along, then isn't "Extreme" programming the opposite of planning it beforehand? Which is what everyone does anyway? And this guy thinks he came up with something new?

    When I hear about "extreme" programming, I envision some guy coding while skiing down a steep mountain (which has no snow, BTW).

  7. Broken OOP Model by Titusdot+Groan · · Score: 5, Insightful
    I might be a bit more inclined to believe the article if the example given wasn't one of the standard OOP pitfalls -- implementing object properties using inheritance.

    A real shape library would have methods like isConvex() and numberOfSides() instead of implementing the number of sides as an infinite number of subclasses (triangle, quadrilateral, etc.)

    Perhaps these guys should have read Antipatterns or Pitfalls of Object Oriented Development instead of wasting their time with this article.

    1. Re:Broken OOP Model by zipwow · · Score: 2, Insightful

      Amen!

      This very example tends to lend credibility to the group describedin the article as "craft" programmers.

      Showing that slate isn't the proper material by building a wall and seeing it fall sounds like a good proof until the stonemason comes and says, "don't stack it against the grain... see?" and builds one that stands just fine.

      -Zipwow

      --
      I don't know which is more depressing, that 2/3 didn't care enough to vote, or that 1/2 of those that did are crazy.
  8. Faulty assumption by PD · · Score: 5, Interesting

    The example that is brought up with all the shapes turns out to have a fault. Inheritence might not be a good way to model those relationships.

    So, all this article has done is show that the P-OOP thing is better than a octopus inheritance tree. Of course it is. Inheritence tends to get used way too much anyway.

    Consider the famous example that we have all seen: an employee class is derived from a person class. That example appears in countless books, and probably countless systems in actual production today. But is it correct? The challenge of designing a system is to make it flexible enough to stand in the future.

    Suppose we have a person who is an employee and a student at the same time. Should we use multiple inheritence? That would be screwy, and also not natural to implement in a language like Java. It turns out that breaking the problem apart into an inheritence type arrangement isn't the best or most flexible way to approach the problem.

    In short, the article has made a good case why inheritence is sometimes not the right tool to use. But remember that OOP is three things: 1) inheritence 2) encapsulation and 3) polymorphism. And a language like C++ (and Java soon) has the notion of *generic programming* which the article didn't talk about.

  9. Aspect complements OOP by SideshowBob · · Score: 4, Informative

    Of the 3 'paradigms' mentioned as alternatives to OOP, only aspect oriented programming is even on the same order as OOP. Patterns are a design methodology and XP is a workflow.

    Aspect is best used in conjunction with OOP. In fact I would say that anyone that uses Objective-C's categories has been doing aspect all along.

    1. Re:Aspect complements OOP by AtATaddict · · Score: 2, Insightful

      There is a language which allows for this kind of "access qualifier". It's called Eiffel. In the classic example, only the TELLER and BANK classes have access to the balance feature of the ACCOUNT class.

      class ACCOUNT
      feature { TELLER }
      balance: INTEGER
      end

      -- this causes problems:

      class ROBBER
      feature
      stash: INTEGER
      do_something(acc: ACCOUNT) is
      do
      stash := stash + acc.balance
      end
      end

  10. I agree. by Cthefuture · · Score: 2, Interesting

    I would even argue that you don't really need inheritance. In theory it's good, but as with over-OO'ing everything it quickly becomes complicated. And the more complicated it is the more spaghetti-like it feels and the less likely a programmer will reuse the code.

    I've seen some very complex software written in functional languages that was very easy to follow even though the had no real OO concepts (usually some sort of module system and the equivalent of C's structs).

    Sometimes the most straightforward approach is the clearest and OO is anything but straightforward when you think about all the layers that go into it. Now, I'm not saying OO is all bad, it has good features. I feel a powerful programming language should strike a balance between the different programming methodologies.

    In the past I have made some comments on what I think plain old C could become if it incorporated some modulization features.

    --
    The ratio of people to cake is too big
    1. Re:I agree. by johannesg · · Score: 2, Insightful
      You don't really need a compiler either, but it is bloody convenient not having to write your own hex codes...

      The truth is of course that crap programmers will write crap programs in any language, while good programmers will do a good job no matter what tools he has available. In the end it always comes down to people.

    2. Re:I agree. by Arandir · · Score: 3, Interesting

      I would even argue that you don't really need inheritance.

      Consider a simple GUI. In this GUI you have a button, a checkbox, a label and an edit box. All of these things are widgets. Does it not make sense to use a base widget class instead of rewriting all the common related functionality they all have? Now add a radio button. It's related to a checkbox. Perhaps it also makes sense to have the checkbox and radio button share a common ancestor as well.

      I can hear people say "that's what functions are for!". True, that is what they are for. But if a function is only useful for a widget related structure, doesn't it make sense to encapsulate that function with that structure?

      No, you don't need inheritance. But sometimes it's damned useful.

      I've seen some very complex software written in functional languages that was very easy to follow even though the had no real OO concepts

      So have I. But no one here is arguing that OOP is the only appropriate paradigm for all problem domains.

      In the past I have made some comments on what I think plain old C could become if it incorporated some modulization features.

      Be careful with this. If you don't watch yourself it could end up becoming Objective C :-)

      --
      A Government Is a Body of People, Usually Notably Ungoverned
  11. Thanks a bunch, a-holes by stratjakt · · Score: 4, Funny

    I told my manager in a design meeting that we should do all new development using POOP techniques and POOP tools and POOP constructs. Now I'm unemployed like the rest of you.

    --
    I don't need no instructions to know how to rock!!!!
  12. True of most fresh programmers by Gorimek · · Score: 4, Insightful

    There is some truth to that, I'm sure, but I'm not aware that programmers schooled in any other methodology are perfect programmers straight out of school. It's a tough craft, and it takes a few years of being an idiot until you start producing really good code, regardless of methodology.

  13. Silver bullets by p3d0 · · Score: 3, Interesting
    I agree with Fred Brookes' comment that better languages can only help with accidental complexity, but can't remove the essential complexity of the problems we're trying to solve.

    Where I disagree is on the relative proportions of these two things. I firmly believe that we're still at the point where well over half of what a programmer does fight with tools, rather than solve new problems. I'd go so far as to say I think it's about 90% accidental complexity, which implies that the ideal programming language could allow a given development team to produce systems that are ten times more elaborate/powerful/complex/etc than today's.

    So I think the language designers still have a lot of work ahead of them.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  14. Offtopic post about terminology by ergo98 · · Score: 3, Insightful
    What's with the sheep like herding when someone coins a term and everyone rushes to look enlightened?

    Everywhere I turn right now someone is yapping about "Patterns": No longer is it simply standard best practices, but rather now it's the new age "Patterns". No longer do you do code maintenance: Now you "Refactor". No longer do you wing it, now you do "Agile Development". It almost makes the speaker sound ridiculously naive hanging onto whatever terminology they hear, as if it's something new when it's merely renaming existing techniques and standards.

    I need to get back to working on my dinner heating patterns.
    • Put Boston Market chicken in microwave.
    • Turn on on "Reheat" mode
    • Remove and eat
    1. Re:Offtopic post about terminology by outsider007 · · Score: 2, Funny

      sheep-like herding is rather cumbersome to say. I propose what we come up with a nifty term that means sheep-like herding so we can talk about it and sound smart.

      something like about shepherding?

      --
      If you mod me down the terrorists will have won
    2. Re:Offtopic post about terminology by Blakis · · Score: 4, Informative

      Refactoring is not the same thing as code maintenance. It's actually more akin to code meddling, but done in well-defined, discrete steps, coupled with unit tests so as to minimize the risk.

  15. Don't believe the hype by MeerCat · · Score: 3, Insightful

    First: yeah, right because XP (et al) re-writes OO: pair programming, early delivery, RAD, iterative development etc are different ways of running a life cycle, not different ways of structuring your model of a domain.

    Second: this reminds of when the K boys did a big rant about "I prove OO is flawed because if you have a class Person and derive from it Customer and Staff classes then you break stuff when a staff member quits his job and walks into the shop and buys stuff as you need to get the object to mutate classes". They claimed to instead invent "OO++" (they called it that). The correct OO answer is that you've got a poor design, you need to revisit it (and aspects or attributes or roles as concepts may help you think about this), but that doesn't break or replace OO (ie straw man argument).

    Now meta-programming, such as the (now rather old but still a head-fuck for those who program in one language only) Meta Object Protocol is the direction that I see code structure moving: more Lisp-like structures and flexibility to change your object protocol on the fly, losing strong typing as a fundamental mechanism for OO, these are ways to let you manipulate the larger level structure of your code whilst keeping the lowest level of syntax constant . You let people write their OO code as they like, but as an over-coordinator you can suddenly change the way inheritance works, or the way method-dispatch works to get different effects. It's what I like about Perl (which is making me realise what all those Lisp hackers were raving about for so long, but I prefer the pragmatic approach of perl over the rather purist lisp).

    --
    T

    --
    I spent a lot of money on booze, birds and fast cars. The rest I just squandered. - George Best
    1. Re:Don't believe the hype by MeerCat · · Score: 2, Interesting

      The Kx guys? Promoting OO++? I'd like to see where. The Kx guys are as anti-OO as any professional can be these days without risking being laughed at by the uninformed community (that thinks OO is a silver bullet).

      This was back when Arthur was working at UBS in New York - maybe 6 or 7 years ago, and had a core K development team of a dozen or so. They were very anti-OO, but lost quite a lot of credibility through putting up straw man OO arguments and knocking them down - such as the example I gave above, and claiming these proved the "fundamental flaws of the OO approach". It was one of the core team who then showed another solution, and claimed this as his new technique to be called "OO++".

      Don't get me wrong, I quite like some features of K, and I had quite a bit of respect for Arthur and some of the K internals... it was just some of the hype and deliberate obfuscation of arguments from the crowd that was sour.

      --
      T

      --
      I spent a lot of money on booze, birds and fast cars. The rest I just squandered. - George Best
  16. Embarassing by Tomster · · Score: 4, Interesting

    There are so many obvious glaring problems with this article I'm surprised it got published. XP as a "replacement" for OOP? Goodness, one is a methodology for building software, the other is a programming mechanism. Patterns? They are applicable in areas other than OOP. Like... architecture for instance . AOP? That's just a fancy way of inserting code into a class. Same principle as using #define in C or C++, though certainly more powerful.

    Most of the 'problems' of OOP are the same as the 'problems' with older languages and practices. Simply put, once you weed out the people who aren't very good at design or programming, the lazy, the stress-cases under schedule pressure, etc. etc., you have a small group of people left who are building "good" software. (Measured by the quality of the code itself, not the success of the product.)

    One of the biggest impediments to good software IMO is that the current crop of languages and tools don't punish laziness up-front. Using a magic number (or string) in a dozen places? No compiler will complain. Got a method that is calling myFoo.getList().calculateMarbleSize().insertInto( table )? No problem! Got a class that's importing classes from two dozen packages? Hey, it compiles, it must be good.

    All of these examples are well-understood problems which can be avoided or fixed with very little effort. But until we have languages and tools that actively encourage good practices, we'll keep writing crap.

    (Insert a rant about methodologies here -- I'm not going to go on anymore.)

    -Thomas

  17. I disagree. by SatanicPuppy · · Score: 3, Interesting

    What you're saying is that "Bad OOP (pOOP) is not the answer" which I agree with.

    However, the idea behind object oriented programming is to break repeated tasks down to a general algorythm that can be reused at 1000 different places in the code without having to write 1000 different, but similar, pieces of code. This is always a good idea.

    Bad OOP is when some jackass writes a 600 line "Swiss-Army Object" and insists on including it everywhere instead of doing any new coding.

    --
    ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
  18. Wrong by Anonymous Coward · · Score: 2, Insightful

    And never write OO when procedural programming can do the same trick in less space.

    Half the point of OO programming is so that later on you can change functionality easily, or expand the use in certain directions. One should always program in an object-oriented way (within anything other than a tiny application) for a few reasons.

    Firstly it can save an awful lot of time later on - I make an effort to have a sensible OO design to all programs I write, and although this may increase the time it takes to write the functionality the first time around, the amount of time I frequently save down the track when I need to expand the application more than makes up for it.

    Secondly, it is just good programming practice. If you are writing an OO program, you shouldn't leave chunks of procedural code lying around, because it is neither neat, nor consistant. If you are speaking in French, you don't throw in German verbs because they are faster to say...
    Now obviously there are always exceptions to the rule - although the only two I can think of is when speed is crucial (although with modern compilers the overhead of OOP seems to be extremely small), or when it is an extremely tiny application (but that goes without saying).

  19. Re:Declarative languages by iggymanz · · Score: 3, Insightful

    well, I heard this 20 years ago (about Prolog, Haskell, Smalltalk, LISP, etc). I really don't think in the commercial world any well designed language is going to be popular. Sorry (and I truly am). The future will continue to be half baked, bug generating, hard to maintain semi-OO languages such as C++ and Java and Microsoft's VB

  20. on the definition of *need* by zipwow · · Score: 3, Insightful

    Some people using OO incorrectly does not mean that the entire concept is in error (insert baby_bathwater.comment).

    The statment "... OO is anything but straightforward when you think about all the layers that go into it." is a hint at the underlying problem, I think. If you have to think about the layers, your model has some problems.

    The functional system you describe with the module system sounds like it is building some very nice layers. I'm not saying it can't be done without OO.

    What I am saying is that OO (and OO languages like Java) encourage you to do it "the right way". You can write spaghetti code in Java, but it takes some doing. You have to sprinkle a lot of static keywords around, and make a lot of classes that don't make sense.

    Coversely, to write clean, modularized code in most fuctional languages, you have to be more "disciplined" and stay out of things that you shouldn't be in.

    I suppose, in conclusion, I would say that OO leads to very clean, straightforward code when the concepts are well understood and applied. Understanding and applying these concepts is not a simple task, however, and I'll admit that in the time I've been doing it (~7 years) I don't have it cold.

    Just my $.02

    -Zipwow

    --
    I don't know which is more depressing, that 2/3 didn't care enough to vote, or that 1/2 of those that did are crazy.
    1. Re:on the definition of *need* by Anonymous Coward · · Score: 2, Insightful
      You can write spaghetti code in Java, but it takes some doing.

      This concept is a complete fallacy. No, it does NOT take more effort to write bad code. In any language. Including the hallowed Java. Yes, even Java makes it extremely easy for you to write something so fucked up, no one will be willing to touch it with a 10 foot pole. The level of skill involved in writing well designed code in ANY language is roughly the same; ie. you have to operate at a level where the language used makes little difference. IOW, it's all in the design, stupid.

  21. OOP Spaghetti and Object Taxonomies by RoninM · · Score: 2, Insightful
    What's the appeal of the OOP Spaghetti diagram? It illustrates a design problem, not a limitation of the model. The problems that diagram shows can be solved quite admirably in current OO languages. A few immediate solutions:

    #1. Observe that there's no benefit in Convex and Simple inheriting from Polygon. They are abstract classes of polygons classes for which instances cannot reasonably be constructed (because polygons need a number of sides) and, presumably, cannot implement many of the base operations of Polygon that they're inheriting. Thus, the hierarchy can be simplified by making Convex and Simple interfaces.

    #2. Another solution to the above observation is to make Convex and Simple mix-ins (if your OOP language supports them).

    #3. Don't try to account for two separate properties in a single taxonomy. Make either the number of sides or the type of polygon an instance attribute, rather than part of its type. For instance, we might decide that all polygons, regardless of number of sides, have the same basic set of operations, and so only work with Convex and Simple classes.

    Another distinct problem with the diagram is that it mixes what we assume to be instances (a star) with what we assume are classes (Pentagon). From what I've seen, the article deals with class-based OOP, so this is an odd confusion. In fact, the problem it illustrates is perhaps mitigated, if not eliminated, in moving to a prototype-based system.

    --
    If a corporation is a personhood, is owning stock slavery?
    1. Re:OOP Spaghetti and Object Taxonomies by Twylite · · Score: 2, Insightful

      Correct answer: #4: There is no absolute taxonomy. Every class hierarchy must be designed with due consideration for the application, that is, the manner in which it is to be used. Speculating about possibly representations is meaningless without such a context.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
  22. XP as a way of programming by ctrimble · · Score: 5, Informative
    There are a fair number of posts talking about how XP is a methodology or a workflow, and not actually a programming paradigm. To a large degree I agree with these posters, and it could very well be the case that it was the intent of the writer of the article to present XP as such. However, there are aspects of XP that are nearly "paradigmatic".

    XP is heavily influenced by TDD -- Test Driven Development. The idea is that you only write code when you have a failing test. You write the test, it fails, you write the code to make the test pass. Then you go back to the requirements, write another test specified by the requirements, run it, it fails, so you write the code to fix it. Repeat until all tests (unit and functional) pass. When all your functional tests pass, you've met the requirements for the app (because the functional tests represent the use cases) and you're done.

    Coding in this fashion does two things. It ensures that you've got a safety net at all times, and it forces your code to be loosely coupled and modular. Because you have 100% coverage, you're not afraid to change the code, because if you break something, you'll get a failing test. If you make a change and all your tests pass, you have the confidence that you didn't inadvertently break something in your code.

    Additionally, your code needs to be modular and loosely coupled because it's tough to test if it isn't. If you have a God Class with lots of dependencies, you won't be able to unit test it because of all the dependencies. That's to say, you won't be able to test it as a unit. If you have a method that's doing lots of things, you'll have to write lots of tests to verify every path of execution. So instead, you're strongly encouraged to write simple methods that do one thing well for ease of testing.

    A real OO guru knows all sorts of things about coupling and cohesion and patterns and when to use composition and when to use inheritance. They always obey the Law of Demeter and consistently separate the implementation from the interface. And to be able to do this, they've got a dog's life of OO experience under their belt. Here's the kicker. The XP evangelists say that using XP and TDD, in particular, gives you the benefits of all this experience as an emergent property of the methodology.

    You obey the Law of Demeter because testing a class that breaks it isn't a unit test -- it's a subsystem test. You use interfaces because it allows you to substitute mock objects for the objects that your object under test interacts with. You use composition and inheritance appropriately because your tests will fail if you don't. Oh, and by the way, if you start with inheritance and move to composition, it's not a problem because all your tests will insure you don't leave something broken.

    The point is that a programmer really only needs to learn how to write good tests in order to be a good programmer. TDD gives you all the stuff that you would normally have to have gained through experience.

    So, that's why I think it's similar to AOP. They both produce higher quality and more maintainable software. However, TDD is a social solution, while AOP is a technical one. And, as long as I'm on my soapbox, I'll just mention that many patterns are compensations for things that more powerful languages do easily. For example, lisp's map procedure is an example of Visitor. Generally, languages that support higher order functions, or that treat functions as first class types, don't require as much pattern silly-walking. Also, AOP is old. Lisp has had it for a long time. In fact, the main architect of AspectJ, Gregor Kiczales, worked on the Common Lisp Object System (CLOS) with Richard Gabriel. Plus ca change, plus ca meme chose, innit. Here's a link to some thoughtful writings on the subject.

    One other point -- for those inclined towards genetic programming. I think that the XP TDD way of programming suffers from the same problems as the hill climbing algorithm. It tends to produce quality, but I think it's easy to get stuck at a local minimum.

    1. Re:XP as a way of programming by russh347 · · Score: 3, Insightful

      The point is that a programmer really only needs to learn how to write good tests in order to be a good programmer. TDD gives you all the stuff that you would normally have to have gained through experience.


      I have to disagree. It's unlikely that a programmer who can write good test won't write good code. TDD isn't about traditional testing. Its about expressing design through testing. In that environment, if you are writing good tests it means that you have correctly and completely expressed the design in a way that can be automatically validated. Also, implementation of the tests depends on virtually all the skills required to write good code. If you can write good tests for TDD, then you can also write good code.

      All of the skills for writing good tests and writing good code are gained through experience. TDD is not a substitute for experience, it is a method for exploiting experience.


      One other point -- for those inclined towards genetic programming. I think that the XP TDD way of programming suffers from the same problems as the hill climbing algorithm. It tends to produce quality, but I think it's easy to get stuck at a local minimum.


      Every development methodology has a tendency to get stuck at a local optimum.

      There are techniques in evolutionary computation to get out of a local optimum (adaptive mutation rates, forking, migration, restarts, ...).

      XP provides a low risk way to do the same. Sweeping design changes that would ordinarily force a project manager to mainline prozac can be handled with very little risk. I've seen it done... I've done it myself.
  23. stupid managers and stupid HR by f00zbll · · Score: 2, Interesting
    That is the biggest cause of spaghetti code. how many good teams have been ruined because the management thinks "We need 30 bodies!". Or HR's "that person doesn't exist, so just hire this guy. He only wants half the salary of the other guy."

    Until management and HR get it through their head that programming is about hiring the "right people", building software will still be spaghetti. Crappy programmers who can't think beyond the line they are currently typing is the main cause of a lot of problems. In the worse cases, it's programmers who refuse to listen and understand the functional requirements before they code. Not enough programmers take a humble approach and take time to listen closely and think ahead.

    Not everyone can and even the best programmers can't think of everything. It's all about finding the right balance to build a team that compliments each other.

    1. Re:stupid managers and stupid HR by jjohnson · · Score: 3, Interesting

      As a manager at a manufacturer, I'll let you in on a little secret: This is true in all areas of business, not just IT. A good inventory manager is worth his weight in gold (and ours is quite fat...); a lousy inventory manager will drag the whole damn company down.

      I have to say that, after a few years of reading Slashdot, it seems like programmers have a perpetual thirtysomething syndrome going on--the perception that our problems are somehow unique. They're not. Reread the Hacker FAQ for Managers, and every time the word "hacker", "coder", or "programmer" appears, mentally substitute "employee" and see if you don't get a general management guide that makes sense.

      --
      Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
    2. Re:Re:stupid managers and stupid HR by f00zbll · · Score: 2, Insightful

      exactly, the problem isn't unique. Just people with Phd's think some stupid concept will solve a human problem.

  24. Programs don't change, only languages by TheEnigma · · Score: 2, Interesting
    Has anybody mentioned that all of this talk of languages and programming models is purely for the sake of forcing programmings to adopt good practices, mostly by restricting their freedom to screw themselves?

    Let's remember that, once you compile a program, you are left with the same thing no matter what language you used: instructions and data. Because all you really have to work with is memory and processors (and I/O, but you can treat that like the other two).

    I am far more interested in the progress of automating the development of programs than in the formalization of How Not to Do Stupid Things (TM). I choose languages and tools which save me time and repetition, because tedious (and mindless) repetition is a sure way to increase the probability of human error. Silly ideas of aesthetics and tradition are of no use to me.

    Perhaps the new frontier of programming is not the language, but the development environment. Then again, that's really what a language is: an environment for managing the production of machine code. But environments are more than languages now, so why not exert some serious effort, and do some serious studies, of the impact of the whole environment?

    --

    My blog: The Bored Astronaut

    --

    Stand back. I've got a brain and I'm not afraid to use it.

  25. Evolved OOP by LionKimbro · · Score: 2, Interesting

    There is plenty of room for OOP to evolve.

    Go in the pattern direction, and add language support to make good practice easy.

    C# has already started this process, by including event schemes and automatic get/setters.

    Now what we need is language support to be able to remap functions from member objects.
    That frees you up from having to inherit when you don't want to, and allows you to make really good
    cuts of functionality cheaply.

    There are so many good object structures that are just totally impractical to write, because 99% of your code would look like:

    ThisObject::MethodA(all-the-params) { return mySubObject::MethodA( all-the-params ); }

    If you could remap quickly and easily, we'd be in the Haranya Loka of design.

  26. No silver f-ing bullet, people! by Xenophon+Fenderson, · · Score: 5, Interesting

    It pisses me off every time somebody comes along and thinks they can shoe-horn all possible solutions to all possible problems into a single programming style. So for everybody who's a newbie, let me impart a little wisdom to you so you don't have to learn it the hard way.

    There is no silver bullet, no magical solution, no instantaneous makes-my-problem-go-away widget that is all things to all problems.

    Use the right tool for the right job. Sometimes, a functional style is useful (especially when one's teaching programming language concepts and higher-order mathematics). Sometimes, procedural tools with abstract data types are useful. And sometimes, functional, procedural, and object-oriented styles can work together to solve a problem (such as the machine simulator I'm writing in Lisp).

    Rant mode off.

    --
    I'm proud of my Northern Tibetian Heritage
    1. Re:No silver f-ing bullet, people! by Anonymous+Brave+Guy · · Score: 2, Funny
      There is no silver bullet, no magical solution, no instantaneous makes-my-problem-go-away widget that is all things to all problems.

      Of course there is. In fact, a new entry for the JCP to create a class AnythingDoer is being worked on as I write. From J2SE 1.6 onwards, you will be able to write a program to do anything you want as follows.

      public class WholeProgram
      {
      public static void main(String[] args)
      {
      AnythingDoer omnipotent = new AnthingDoer();
      System.exit(omnipotent.doEverythingINeed()); }
      }

      At that point, functional programmers will be feeling small and insignificant, finally realising the underwhelming lack of power that their tools really don't possess, and the need for any sort of formal training for pogrammers will be resolved once and for all.

      For example, if you had no idea how to get /. to indent your sample code sensibly, you could just call that method and it would cause some helpful soul to reply and end months of frustration. :-)

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  27. How often is code actually re-used? by Benm78 · · Score: 2, Interesting

    Often, I wonder how often code is actually re-used, and adapted later on.

    Both conditions will have to be met to make the big idea behing OOP work. I'm sort-of an P/R fan and programmer, and I see no reason to assume that OO as a whole has been a good thing.

    Lets just get rid of it, never speak the words or acronym again, and revert to P/R programming. If someone could think up a great acronym for this process, I am convinced corporate management is quite willing to accept it.

  28. Boost falls to Greenspun's Tenth Law by Anonymous Coward · · Score: 2, Insightful

    Greenspun's Tenth Rule of Programming: "Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."

  29. Re: Give them a hammer and.... by glenebob · · Score: 2, Interesting

    Hammers pound? I don't think so. Hammers don't do anything.
    You soon learn that it should be:

    Worker.UseTool(Hammer, Nail);

    Then you realize that OOP is just a nice way to organize things, and that it's all just a prettier procedural anyway.

  30. Revolution = coming around again by Anonymous+Brave+Guy · · Score: 2, Informative

    At the risk of stating the obvious, the ability to do generic programming (in the sense of working with arbitrary interfaces without needing the inheritance/OOP angle to specify that they're met) has been around for decades in many languages.

    There's nothing inherently special about generic code. From a certain point of view, the very fact that generic algorithms and data structures are regarded as anything but the obvious default is just indicative of a flaw in the underlying models of languages that need templates etc.

    I appreciate your enthusiasm, and generic programming is a fine idea, but if you think things like the STL and expression templates are original, you need to read up on things like functional programming, where vastly more powerful versions of the same concepts are routine. These libraries are very useful tools for languages that don't support the concepts natively, without a doubt, but magical they ain't.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  31. type inference from Haskell by axxackall · · Score: 2, Interesting
    Also a pretty picture of OOP Spaghetti

    The "spaghetti" problem of multiple inheritance or of even multiple taxonomies is not really a problem in languages supporting type inference (I am sure about Haskell, perhaps OCAML as well).

    I don't think OOP is a problem. In fact, OOP is a useful paradigm. The problem is that OOP should not be the only useful paradigm to be used. Type constructors, recursion, constraint programming, pattern matching, and of course type inference are other useful ones.

    But what's even more important, OOP paradigm should be mixed with very dangerous paradigms, such as distructive assignment. Do you want your code being capable to change itself in an arbitrary way? No one loves buffer overflow. But why most of programmers are ok with destructive assignment? Variable value is a part of the (run-time) program code, it should not be modified - only created.

    Interestingly, while mathematically educated programmers do already (how many decades) know that the future is for FP, programmers without good math background keep re-inventing the wheel involving structured programming, OOP, AOP (what next? TOP as taxonomy-oriented programming?) - all what was already existed in FP (and/or LP). How many more billions they will flush to toilet before realizing that?

    --

    Less is more !
  32. Re:In Defense of VB by HBPiper · · Score: 2, Informative

    There is a need for VB. VB is a great way to prototype a new product interface or set one up for a one shot tool. If you want the project to be truly useful however, you need to consider OOP or structured programming techniques during the design. I don't know how many times I have been handed somebody's little "VB" tool that has become indispensable to company operations, but needs "one more feature" and found out that code reuse to this person means yet another copy of the same 20 lines of code attached to every frickin object in the project. There in lies the inherent danger of VB. Anyone can learn enough to be dangerous. But when they start drowning, they call for the software guys to bail them out, and then the finger pointing begins.

    --
    "I went on a diet, swore off drinking and heavy eating. And in fourteen days, I had lost exactly two weeks. Joe E. Lewis
  33. Why FP isn't much used in reality by Anonymous+Brave+Guy · · Score: 2, Insightful
    But why most of programmers are ok with destructive assignment? Variable value is a part of the (run-time) program code, it should not be modified - only created.

    I'm all for a more declarative programming style where it's appropriate, but some data structures and algorithms are simply much more efficient if you change them in-place.

    #include <std_iteration_vs_recursion_arguments.h>

    Interestingly, while mathematically educated programmers do already (how many decades) know that the future is for FP ...

    Lots of pretentious academics who like to think they're clever because it justifies their existence will tell the journeyman programmers of the world that the tools they use suck, functional programming is technically superior, etc. But while theory is all very well if you live in an ivory tower, in the real world, we have to write the code that gets the job done.

    If functional programming and such were so much better than procedural, OO, etc. in practice then the professional development industry would be using them as a matter of routine. As it stands, there are at least two very good reasons this is not the case: FP doesn't have critical mass (small installed base, small code base of libraries, limited number of programmers familiar with it) and the FP model has its own problems, which don't much show up in theory labs (hence most academics' ignorance of them, or willingness to overlook them) but bite you in seconds in the real world (hence many informed and highly mathematically educated programmers still reject FP for their work).

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.