The Gist of Object Oriented Programming

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Schwab

    #31
    Re: The Gist of Object Oriented Programming

    Jeff Schwab wrote:[color=blue]
    > David Harmon wrote:
    >[color=green]
    >> On Tue, 20 Apr 2004 07:23:23 -0400 in comp.lang.c++, Jeff Schwab
    >> <jeffplus@comca st.net> wrote,
    >>[color=darkred]
    >>> "A technique using elements of software to represent concepts, and
    >>> the ways those concepts relate to each other."[/color]
    >>
    >>
    >>
    >> It might almost be more useful to shorten it to "A technique."
    >>
    >> I mean, as long as you are not going to say _which_ technique(s) and
    >> what any of the benefits of those techniques are. (That is what we mean
    >> by "content free".)
    >>[/color]
    >
    > I believe the essence of OOP is representing concepts and relationships
    > in software. I got that into a sentence. Explaining further would
    > require (I think) a lot more text.[/color]

    Before someone points out that the definition technically isn't a
    sentence, please prefix it with "Object-oriented programming is."

    Comment

    • E. Robert Tisdale

      #32
      Re: The Gist of Object Oriented Programming

      Roger Smythe wrote:
      [color=blue]
      > A means for the progressive decomposition a problem space into increasingly simpler component parts
      > such that these component parts represent higher levels of conceptual abstraction, and are
      > completely independent of each other except for their well-defined interfaces.
      >
      > This was an attempt to explain the gist of OOP to programmers accustomed to the
      > structured programming paradigm. I tried to explain OOP in terms of ideals that can
      > be striven for, even though these ideals may never be perfectly achieved in real systems.
      >
      > Does anyone have any ideas on how to improve this explanation?
      > The goal is to provide the gist of the benefits of OOP to structured
      > programmers in no more than a single short paragraph.[/color]

      The phrase "objected oriented" was coined by Alan Kay




      to describe his new programming language Smalltalk.
      The first Object Oriented Programming language was Simula



      The objects to which something is oriented are *data* objects.
      The idea is that, when you call a function,
      the function that is actually applied to the object
      depends upon the *type* of the object.

      In the stongest sense, this means that the object must be inspected
      in real-time to determine the actual type of the object.
      This is called variously "real-time polymorphism", "dynamic binding",
      "dynamic dispatch", etc. The data object contains a tag
      or a pointer to a virtual function table (jump table)
      which depends only upon the actual type of the object.

      More generally, the term "object oriented" is used
      as a synonym for good programming practice.
      If you ask an object oriented programmer to define object oriented.
      they will probably begin by describing an Abstract Data Type (ADT)
      so, evidently, for most object oriented programmers,
      it is about implementing ADTs.
      Note that C++ allows programmers to implement ADTs
      that do *not* rely on real-time polymorphism.

      Comment

      • puppet_sock@hotmail.com

        #33
        Re: The Gist of Object Oriented Programming

        "Roger Smythe" <Roger314159@ho tmail.com> wrote in message news:<8Qygc.484 76$K_.1103429@b gtnsc05-news.ops.worldn et.att.net>...
        [OOP sound bite snipped][color=blue]
        > This was an attempt to explain the gist of OOP to programmers
        > accustomed to the
        > structured programming paradigm.
        > I tried to explain OOP in terms of ideals that can
        > be striven for, even though these ideals may never be
        > perfectly achieved in real systems.[/color]
        [snip]

        Instead of trying to capsulize a definition, why don't you actually
        discuss the things that make OOP what it is? For example, talk about
        things like encapsulation, abstraction, polymorphism, and inheritance.
        Then talk about what those things do for the designer, what the
        costs are, what some pitfalls are, etc. Then give some examples of
        good OOP, and possibly some examples of bad OOP and why it's bad.

        Generally, I'd go on the premise that the people who are comming
        to you wanting to know "what is OOP?" are already of the opinion
        that it is at least worth understanding. You don't need to do
        any opinion creation or conversion of religions. I wouldn't bother
        to try to boil it down to one or two sentences.
        Socks

        Comment

        • Peter Olcott

          #34
          Re: The Gist of Object Oriented Programming

          > "How much better" is higly dependent on the problem being solved, some[color=blue]
          > problems lend themselves to an OO solution and can show a dramatic
          > reduction in code size (and its attendent increase in ease of
          > understanding and ease of modification,) while for others OO simply
          > isn't a tool that can be used. The primary way the code is better has
          > already been stated, reduction in code duplication. A little more
          > generally, OOP helps reduce what Brooks called "accedental complexity".[/color]

          Although your first point is good, your second point is better.
          The "accidental complexity" is reduced specifically because
          an OOP language is capable of user defined data types that
          much more closely correspond to the real world objects that
          they are modeling. Also another crucial point of OOP is that
          is can provide much better "black box" containment (typically
          referred to as encapsulation). This can as much as completely
          eliminate side-effects from changes made to code.


          Comment

          • Peter Olcott

            #35
            Re: The Gist of Object Oriented Programming

            > How about:[color=blue]
            >
            > "A technique using elements of software to represent concepts from the
            > real world, and the ways those concepts relate to each other."[/color]

            I like that. That does seem like an improvement some of what I said.
            Let's see if I can improve your version a little more.

            The means to create custom user defined data types to model real
            world objects, with behavior and relationships that correspond
            to their real world counter-parts.


            Comment

            • Peter Olcott

              #36
              Re: The Gist of Object Oriented Programming

              > "A technique using elements of software to represent concepts, and the[color=blue]
              > ways those concepts relate to each other."[/color]

              No, the real-world is crucial. It provides the ready-made system design.


              Comment

              • Peter Olcott

                #37
                Re: The Gist of Object Oriented Programming

                > The "gist", as you put it, is that the shorter and more generalized you make[color=blue]
                > your statement, the more meaningless it will be. Meaningless slogans only work
                > if you're a politician or a third-rate marketeer trying to sell a commodity to
                > the lowest common denominator.
                >
                > Claudio Puviani
                >[/color]
                The goal of this thread is to derive, not, a defitnion of OOP, but, the
                most imporant benefits of OOP, to answer the question:
                Why should I bother to learn OOP when I already am an expert in "C"?

                The mechisms of OOP will never convince anyone. Only the benefits
                will change minds. As it is it took management a full-decade to even
                begin to seriously consider OOP. (1985 to 1995).


                Comment

                • Peter Olcott

                  #38
                  Re: The Gist of Object Oriented Programming

                  > Instead of trying to capsulize a definition, why don't you actually[color=blue]
                  > discuss the things that make OOP what it is? For example, talk about[/color]

                  Because I can't complete my sentence before the people walk off.
                  One must start with "what's in it for me" or one loses most of the
                  audience.
                  [color=blue]
                  > things like encapsulation, abstraction, polymorphism, and inheritance.
                  > Then talk about what those things do for the designer, what the
                  > costs are, what some pitfalls are, etc. Then give some examples of
                  > good OOP, and possibly some examples of bad OOP and why it's bad.
                  >
                  > Generally, I'd go on the premise that the people who are comming
                  > to you wanting to know "what is OOP?" are already of the opinion[/color]

                  My target audience is those that have already decided that it is
                  not worth their time.
                  [color=blue]
                  > that it is at least worth understanding. You don't need to do
                  > any opinion creation or conversion of religions. I wouldn't bother
                  > to try to boil it down to one or two sentences.
                  > Socks[/color]


                  Comment

                  • Claudio Puviani

                    #39
                    Re: The Gist of Object Oriented Programming

                    "Peter Olcott" <olcott@worldne t.att.net> wrote[color=blue][color=green]
                    > > The "gist", as you put it, is that the shorter and more generalized you[/color][/color]
                    make[color=blue][color=green]
                    > > your statement, the more meaningless it will be. Meaningless slogans only[/color][/color]
                    work[color=blue][color=green]
                    > > if you're a politician or a third-rate marketeer trying to sell a commodity[/color][/color]
                    to[color=blue][color=green]
                    > > the lowest common denominator.
                    > >
                    > > Claudio Puviani
                    > >[/color]
                    > The goal of this thread is to derive, not, a defitnion of OOP, but, the
                    > most imporant benefits of OOP, to answer the question:
                    > Why should I bother to learn OOP when I already am an expert in "C"?
                    >
                    > The mechisms of OOP will never convince anyone. Only the benefits
                    > will change minds. As it is it took management a full-decade to even
                    > begin to seriously consider OOP. (1985 to 1995).[/color]

                    I don't know where you've been for the past 15-20 years, but minds have been
                    changed in vast numbers without there being a cutesy, amorphous slogan to sway
                    them. You may not be used to dealing with the professional programmers you
                    claim to want to address, but this is a crowd that's persuaded by technical
                    information, not by vague and nebulous statements of "benefits". They're smart
                    enough to figure out the potential benefits on their own if they're given
                    information instead of platitudes.

                    Claudio Puviani


                    Comment

                    • Claudio Puviani

                      #40
                      Re: The Gist of Object Oriented Programming

                      "Peter Olcott" <olcott@worldne t.att.net> wrote[color=blue][color=green]
                      > > How about:
                      > >
                      > > "A technique using elements of software to represent concepts from the
                      > > real world, and the ways those concepts relate to each other."[/color]
                      >
                      > I like that. That does seem like an improvement some of what I said.
                      > Let's see if I can improve your version a little more.
                      >
                      > The means to create custom user defined data types to model real
                      > world objects, with behavior and relationships that correspond
                      > to their real world counter-parts.[/color]

                      It's generally accepted that, except in rare instance, trying to duplicate
                      "real world" objects in software is an almost sure recipe for disaster. It's
                      concepts that are modeled, and sometimes, the distillation of a real world
                      entity into its meaningful concepts leaves little of the original image. For
                      example, in systems programming, you don't model keyboard matrices and disks,
                      you model streams and file systems. To quote John Lakos, "modeling real world
                      objects leads to unwanted coupling and circular dependencies that turn testing
                      and maintenance into a nightmare, so we never do it" ('we' refering to software
                      engineers).

                      I doubt you'll find any books beyond the introductory level that condone
                      directly translating real world entities into software. The only place that's
                      still done is in the analysis phases where you're trying to model the domain,
                      not design the software.

                      Claudio Puviani


                      Comment

                      • Jeff Schwab

                        #41
                        Re: The Gist of Object Oriented Programming

                        Peter Olcott wrote:[color=blue][color=green]
                        >>How about:
                        >>
                        >>"A technique using elements of software to represent concepts from the
                        >>real world, and the ways those concepts relate to each other."[/color]
                        >
                        >
                        > I like that. That does seem like an improvement some of what I said.
                        > Let's see if I can improve your version a little more.
                        >
                        > The means to create custom user defined data types to model real
                        > world objects, with behavior and relationships that correspond
                        > to their real world counter-parts.[/color]

                        That's not bad, if your target audience already understands what data
                        types are.

                        Comment

                        • Mark A. Gibbs

                          #42
                          Re: The Gist of Object Oriented Programming


                          Claudio Puviani wrote:[color=blue]
                          >
                          > I don't know where you've been for the past 15-20 years, but minds have been
                          > changed in vast numbers without there being a cutesy, amorphous slogan to sway
                          > them. You may not be used to dealing with the professional programmers you
                          > claim to want to address, but this is a crowd that's persuaded by technical
                          > information, not by vague and nebulous statements of "benefits". They're smart
                          > enough to figure out the potential benefits on their own if they're given
                          > information instead of platitudes.[/color]

                          Not that I disagree with your point, nor do I have anything against you
                          personally Mr. Puviani, but you must not be used to dealing with people.
                          For sure a rational and objective discussion will convince a group of
                          knowlegable and open-minded people. But those kinds of people are very
                          rare. More often you'll get people that are looking for easy solutions -
                          consciously or otherwise - either programmers looking to do less work or
                          managers looking to increase "productivi ty". In the rare case that I
                          have encountered somebody willing and eager to do real work, they are
                          either uninterested in learning or unable to grasp the deeper issues
                          behind a topic at first.

                          Programmers are no less susceptible to hype than the general populace.
                          If anything, they're probably just more wary of it simply because
                          there's so much of it in this field, and they've either been burned many
                          times or have seen too many others burned.

                          Besides, it is a lot easier to memorize a 3 sentence paragraph than an
                          entire book, but if you can relate the entire book to that 3 sentence
                          paragraph, you're well on your way to memorizing the book.

                          I don't doubt that a platitude will satisfy far more people than it will
                          annoy. History and statistics are on my side there. The only issues for
                          a responsible mass-market educator, then, become finding a good
                          "executive summary" or catchphrase, and clearly conveying to the
                          audience the highlights and limitations of it by demonstrating it
                          action. By that metric, the OP is off to a good start by coming here
                          (well, maybe not specifically *here*) and asking for help.

                          If you or some of the other posters in this thread are the type that
                          gets annoyed by "executive briefs" such as the OP's, that's fine - it
                          tells me that you've moved on to a more critical stance on OO, which is
                          obviously a step up from blind acceptance of application of dogma, which
                          is Good. But chastising those that have not reached that stage (ie, the
                          "lowest common denominator"), or those attempting to reach an audience
                          not yet there (ie, "politician "s or "third-rate marketeer"s), benefits
                          no-one. I cannot see it would improve the comp.lang.c++ community either.

                          And for the record, I disagree with Jeff Schwab's criticism of defining
                          of OO using its own terms. Presumably, shortly after you give the
                          definition, you define the terms (in the process of explaining OO). And
                          when you are done, you can reiterate the original definition with the
                          (now charged) terms. Now the "platitude" becomes a checklist of the most
                          important concepts and mechanisms in OO. I would recommend that to the OP.

                          mark

                          Comment

                          • Jeff Schwab

                            #43
                            Re: The Gist of Object Oriented Programming

                            Mark A. Gibbs wrote:
                            [color=blue]
                            > And for the record, I disagree with Jeff Schwab's criticism of defining
                            > of OO using its own terms. Presumably, shortly after you give the
                            > definition, you define the terms (in the process of explaining OO). And
                            > when you are done, you can reiterate the original definition with the
                            > (now charged) terms. Now the "platitude" becomes a checklist of the most
                            > important concepts and mechanisms in OO. I would recommend that to the OP.[/color]

                            If the effort is to gain the reader's interest as quickly as possible,
                            why do you think he or she will keep reading past an opening sentence
                            full of unfamiliar and as-yet meaningless technical terms?

                            Comment

                            • Daniel T.

                              #44
                              Re: The Gist of Object Oriented Programming

                              "Peter Olcott" <olcott@worldne t.att.net> wrote:
                              [color=blue][color=green][color=darkred]
                              > > > Basically encapsulation can completely eliminate the problem of
                              > > > side-effects
                              > > > in code maintenance. You chnage the internal workings of one class, and
                              > > > this
                              > > > does not effect anything else, anywhere else. Besides this encapsulating
                              > > > functionality and its required data into classes, can divide up a problem
                              > > > so that solving a really big problem merely involves solving a few small
                              > > > problems.[/color]
                              > >
                              > > Functional programming completly eliminates the problem of side-effects,
                              > > OOP does not.[/color]
                              >
                              > Because OOP provides the means to make every bit of all of the data
                              > local to specific objects, whereas structured programming does not
                              > provide this means, you are incorrect.[/color]

                              You might want to look into Functional (not structured) programming
                              before continuing with this...

                              Comment

                              • Peter Olcott

                                #45
                                Re: The Gist of Object Oriented Programming

                                > > > Functional programming completly eliminates the problem of side-effects,[color=blue][color=green][color=darkred]
                                > > > OOP does not.[/color]
                                > >
                                > > Because OOP provides the means to make every bit of all of the data
                                > > local to specific objects, whereas structured programming does not
                                > > provide this means, you are incorrect.[/color]
                                >
                                > You might want to look into Functional (not structured) programming
                                > before continuing with this...[/color]

                                So somebody overloaded the term "functional programming" to mean
                                something other than {functional decomposition}? I would consider this
                                an error if they did. Just like the error of the term "worthless" meaning
                                something other than {worth less}. Something that is "worthless" is not
                                {worth less} it is {worth nothing}. I consider this to be an error by
                                whomever starting this term.


                                Comment

                                Working...