Can a low-level programmer learn OOP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wayne Brehaut

    #16
    Re: Can a low-level programmer learn OOP?

    On Sat, 14 Jul 2007 06:01:56 +0200, Bruno Desthuilliers
    <bdesth.quelque chose@free.quel quepart.frwrote :
    >Chris Carlen a écrit :
    >Hi:
    >>
    > From what I've read of OOP, I don't get it. I have also found some
    >articles profoundly critical of OOP. I tend to relate to these articles.
    >>
    === 8< ===
    >>
    >Hence, being a hardware designer rather than a computer scientist, I am
    >conditioned to think like a machine. I think this is the main reason
    >why OOP has always repelled me.
    >
    >OTOH, OO is about machines - at least as conceveid by Alan Key, who
    >invented the term and most of the concept. According to him, each object
    >is a (simulation of) a small machine.
    Oh you young'uns, not versed in The Ancient Lore, but filled with
    self-serving propaganda from Xerox PARC, Alan Kay, and Smalltalk
    adherents everywhere!

    As a few more enlightened have noted in more than one thread here, the
    Mother of All OOP was Simula (then known as SIMULA 67). All Alan Kay
    did was define "OOPL", but then didn't notice (apparently--though this
    may have been a "convenient oversight") that Simula satisfied all the
    criteria so was actually the first OOPL--and at least 10 years earlier
    than Smalltalk!

    So Kay actually invented NONE of the concepts that make a PL an OOPL.
    He only stated the concepts concisely and named the result OOP, and
    invented yet another implementation of the concepts-- based on a
    LISP-like functional syntax instead of an Algol-60 procedural syntax,
    and using message-passing for communication amongst objects (and
    assumed a GUI-based IDE) (and introduced some new terminology,
    especially use of the term "method" to distinguish class and instance
    procedures and functions, which Simula hadn't done) .

    As Randy Gest notes on http://www.smalltalk.org/alankay.html, "The
    major ideas in Smalltalk are generally credited to Alan Kay with many
    roots in Simula, LISP and SketchPad." Too many seem to assume that
    some of these other "features" of Smalltalk are part of the definition
    of an OOP, and so are misled into believing the claim that it was the
    first OOPL. Or they claim that certain deficiencies in Simula's object
    model--as compared to Smalltalk's--somehow disqualifies it as a "true
    OOPL", even though it satisfies all the criteria as stated by Kay in
    his definition. See http://en.wikipedia.org/wiki/Simula and related
    pages, and "The History of Programming Languages I (HOPL I)", for
    more details.

    Under a claim of Academic Impunity (or was that "Immunity") , here's
    another historical tid-bit. In a previous empolyment we once had a
    faculty applicant from CalTech who knew we were using Simula as our
    introductory and core language in our CS program, so he visited Xerox
    PARC before coming for his inteview. His estimate of Alan Kay and
    Smalltalk at that time (early 80s) was that "They wanted to implement
    Simula but didn't understand it--so they invented Smalltalk and now
    don't understand _it_!"

    wwwayne

    === 8< ===

    Comment

    • Aahz

      #17
      Re: Can a low-level programmer learn OOP?

      In article <f787ul0npv@new s4.newsguy.com> ,
      Chris Carlen <crcarleRemoveT his@BOGUSsandia .govwrote:
      >
      >From what I've read of OOP, I don't get it.
      For that matter, even using OOP a bit with C++ and Perl, I didn't get it
      until I learned Python.
      >The problem for me is that I've programmed extensively in C and .asm on
      >PC DOS way back in 1988.
      Newbie. ;-)

      (I started with BASIC in 1976.)
      >Form 2: Use Python and PySerial and TkInter or wxWidgets.
      >
      >Pro: Cross-platform goal will likely be achieved fully. Have a
      >programmer nearby with extensive experience who can help.
      >Con: Must learn new language and library. Must possibly learn a
      >completely new way of thinking (OOP) not just a new language syntax.
      >This might be difficult.
      My experience is that learning GUI programming is difficult. Moreover,
      GUI programming in C involves a lot of boilerplate that can be automated
      more easily with Python. So I think this will be a better solution.

      Note very very carefully that Python does not require an OOP style of
      programming, but it will almost certainly be the case that you just
      naturally start using OOP techniques as you learn Python.
      --
      Aahz (aahz@pythoncra ft.com) <* http://www.pythoncraft.com/

      I support the RKAB

      Comment

      • Tony23

        #18
        Re: Can a low-level programmer learn OOP?

        Chris Carlen wrote:
        John Nagle wrote:
        >Chris Carlen wrote:[edit]
        >>Hence, being a hardware designer rather than a computer scientist, I
        >>am conditioned to think like a machine. I think this is the main
        >>reason why OOP has always repelled me.
        >>
        > Why?
        >
        When pointers were first explined to me, I went "Ok." And rather
        quickly ideas lit up in my head about what I could do with them.
        >
        When I read what OOP is, that doesn't happen. All I think is "what's
        the point of this?" "What can this do for me that I can do already with
        the procedural way of thinking?" And if it can't do anything new, then
        why rearrange my thinking to a new terminology? It's results that
        matter, not the paradigm.
        I have been programming since 1978. I started off with BASIC, learned
        Assembly and Pascal, and much later eventually moved on to Javascript,
        Perl, and PHP. All of my work was done procedurally.

        Recently, I have been working on a very large project involving a lot of
        OO-Javascript. For what we are doing on the project, OO makes sense. I
        really didn't get OOP until working on this project - probably because I
        never did anything that really needed it.

        I have found myself leaning more toward the OO paradigm since doing
        this, after 25+ years of procedural programming, and now I find myself
        doing more work with OO concepts, and getting things done even faster,
        and with less work, than I used to.

        But I still have a problem with STRICT OOP - which is why I like Python.
        Use OO where it's useful, use procedural when that works best.

        I suspect that the reason it isn't clicking for you is twofold: 1) You
        don't do anything currently that has an obvious need for OOP, and 2) You
        haven't done anything with OOP.

        A couple ideas:

        1) Maybe you can try building a relatively trivial program that would
        more naturally use an OO methodology - perhaps a simple videogame like
        Pac-man? The 'monsters' would be objects, with properties such as color,
        X-position, Y-position, etc. - make yourself work in OO terms

        2) This may seem silly, but download & play with "Scratch"
        (http://scratch.mit.edu) - it's basically an introduction to programming
        for kids, but it's completely OO, and super easy to use. It might be
        useful to help you to see the 'grand view' better.

        3) Give in to the dark side :)

        Good luck - after so much time invested in one way of thinking, it's not
        easy to change.

        Comment

        • Chris Carlen

          #19
          Re: Can a low-level programmer learn OOP?

          Aahz wrote:
          In article <f787ul0npv@new s4.newsguy.com> ,
          Chris Carlen <crcarleRemoveT his@BOGUSsandia .govwrote:
          >>From what I've read of OOP, I don't get it.
          >
          For that matter, even using OOP a bit with C++ and Perl, I didn't get it
          until I learned Python.
          >
          >>The problem for me is that I've programmed extensively in C and .asm on
          >>PC DOS way back in 1988.
          >
          Newbie. ;-)
          >
          (I started with BASIC in 1976.)
          Heh heh, I actually first programmed when the RadioShack TRS-80 came
          out. I think I saw it first in 1978 when I was 11. I would hang out in
          the store for hours writing crude video games.
          My experience is that learning GUI programming is difficult. Moreover,
          GUI programming in C involves a lot of boilerplate that can be automated
          more easily with Python. So I think this will be a better solution.
          >
          Note very very carefully that Python does not require an OOP style of
          programming, but it will almost certainly be the case that you just
          naturally start using OOP techniques as you learn Python.

          Thanks for the input!


          --
          Good day!

          _______________ _______________ __________
          Christopher R. Carlen
          Principal Laser&Electroni cs Technologist
          Sandia National Laboratories CA USA
          crcarleRemoveTh is@BOGUSsandia. gov
          NOTE, delete texts: "RemoveThis " and
          "BOGUS" from email address to reply.

          Comment

          • Neil Cerutti

            #20
            Re: Can a low-level programmer learn OOP?

            On 2007-07-13, Wayne Brehaut <wbrehaut@mcsne t.cawrote:
            So Kay actually invented NONE of the concepts that make a PL an
            OOPL. He only stated the concepts concisely and named the
            result OOP,
            Naming and categorizing something shouldn't be underestimated as
            an accomplishment, though. The exercise can have profound
            results. For example, consider "marriage." ;)
            Under a claim of Academic Impunity (or was that "Immunity") ,
            here's another historical tid-bit. In a previous empolyment we
            once had a faculty applicant from CalTech who knew we were
            using Simula as our introductory and core language in our CS
            program, so he visited Xerox PARC before coming for his
            inteview. His estimate of Alan Kay and Smalltalk at that time
            (early 80s) was that "They wanted to implement Simula but
            didn't understand it--so they invented Smalltalk and now don't
            understand _it_!"
            Heh, heh. Thanks for the intersting info.

            --
            Neil Cerutti

            Comment

            • Steve Holden

              #21
              Re: Can a low-level programmer learn OOP?

              Aahz wrote:
              In article <f787ul0npv@new s4.newsguy.com> ,
              Chris Carlen <crcarleRemoveT his@BOGUSsandia .govwrote:
              >>From what I've read of OOP, I don't get it.
              >
              For that matter, even using OOP a bit with C++ and Perl, I didn't get it
              until I learned Python.
              >
              >The problem for me is that I've programmed extensively in C and .asm on
              >PC DOS way back in 1988.
              >
              Newbie. ;-)
              >
              (I started with BASIC in 1976.)
              >
              Newbie ;-)

              (I started with Algol 60 in 1967).
              >Form 2: Use Python and PySerial and TkInter or wxWidgets.
              >>
              >Pro: Cross-platform goal will likely be achieved fully. Have a
              >programmer nearby with extensive experience who can help.
              >Con: Must learn new language and library. Must possibly learn a
              >completely new way of thinking (OOP) not just a new language syntax.
              >This might be difficult.
              >
              My experience is that learning GUI programming is difficult. Moreover,
              GUI programming in C involves a lot of boilerplate that can be automated
              more easily with Python. So I think this will be a better solution.
              >
              I used to write in C for the SunView platform (back in the days when the
              GUI was integrated into the kernel as the only way to get acceptable
              speed on the display). From what I remember, "Hello World" took about 40
              lines.

              The immense (relatively speaking: this was 1985) size of the libraries
              required was one of the primary justifications for implementing shared
              libraries.
              Note very very carefully that Python does not require an OOP style of
              programming, but it will almost certainly be the case that you just
              naturally start using OOP techniques as you learn Python.
              That's very true. I still use a lot of (perhaps too much) procedural
              coding, but driving the object-oriented libraries is a great way for a
              noob to get started in OOP.

              regards
              Steve
              --
              Steve Holden +1 571 484 6266 +1 800 494 3119
              Holden Web LLC/Ltd http://www.holdenweb.com
              Skype: holdenweb http://del.icio.us/steve.holden
              --------------- Asciimercial ------------------
              Get on the web: Blog, lens and tag the Internet
              Many services currently offer free registration
              ----------- Thank You for Reading -------------

              Comment

              • =?ISO-8859-1?Q?BJ=F6rn_Lindqvist?=

                #22
                Re: Can a low-level programmer learn OOP?

                On 7/13/07, John Nagle <nagle@animats. comwrote:
                You can sometimes get better performance in C++ than in C, because C++
                has "inline". Inline expansion happens before optimization, so you
                can have abstractions that cost nothing.
                C99 has that too.
                Python is a relatively easy language, easier than C++, Java,
                or even Perl. It's quite forgiving. The main implementation,
                CPython, is about 60x slower than C, though, so if you're trying
                to implement, say, a rapidly changing digital oscilloscope display,
                the result may be sluggish.
                But if the data for that oscilloscope comes from an external device
                connected via a serial port, execution speed won't matter.


                --
                mvh Björn

                Comment

                • Alex Martelli

                  #23
                  Re: Can a low-level programmer learn OOP?

                  Chris Carlen <crcarleRemoveT his@BOGUSsandia .govwrote:
                  From what I've read of OOP, I don't get it. I have also found some
                  articles profoundly critical of OOP. I tend to relate to these articles.
                  OOP can be abused (particularly with deep or intricate inheritance
                  structures). But the base concept is simple and clear: you can bundle
                  state and behavior into a stateful "black box" (of which you may make as
                  many instances, with independent state but equal behavior, as you need).
                  Hence, being a hardware designer rather than a computer scientist, I am
                  conditioned to think like a machine. I think this is the main reason
                  why OOP has always repelled me.
                  I'm an MS in EE (minoring in computer engineering) by training (over a
                  quarter century ago:-); I "slid" into programming kind of inexhorably
                  (fate obviously wanted me to:-) but paradigms such as OOP (and
                  functional programming, but that's another subject) always made sense to
                  me *in direct analogy to my main discipline*. A JK flip-flop and a D
                  flip-flop are objects with 1-bit states and different behavior; I may
                  put in my circuit as many (e.g.) J-K flip-flops as I need, and each will
                  have separate state, even though each will have identical behavior (how
                  it responds to signals on the J and K lines). I don't need to think
                  about how a J-K flip-flop is *made*, inside; I use it as a basic
                  component in designing richer circuits (well, I did back when I DID
                  design circuits, but I haven't _totally_ forgotten:-). I do know how to
                  make one in terms of transistors, should I ever need to (well, maybe I'd
                  have to look it up, but I _used_ to know:-), but such a need is unlikely
                  to arise, because it's likely to be there as a basic component in
                  whatever design library I'm supposed to use for this IC.

                  Components much richer than J-K flip-flops are obviously more common
                  nowadays, but remember my real-world experience designing chips is from
                  the early '80s;-). Nevertheless the concept of a "bundle of state and
                  behavior" is still there -- and a direct, immediate analogy to OOP.
                  (Functional programming, OTOH, is analogous to stateless input-output
                  transformation circuits, an even more basic concept in HW design:-). If
                  anything, it's the concept of "procedural programming" that has no
                  direct equivalent in HW design (unless you consider microcode "HW", and,
                  personally, I don't;-). [[Fortunately as a part of the CE minor I did
                  learn Fortran, Lisp and Pascal, and a few machine-languages too, so I
                  wasn't totally blown away when I found myself earning a living by
                  programming rather than by designing chips, but that's another
                  story:-)]]


                  Alex

                  Comment

                  • James Stroud

                    #24
                    Re: Can a low-level programmer learn OOP?

                    Chris Carlen wrote:
                    Hi:
                    >
                    From what I've read of OOP, I don't get it. I have also found some
                    articles profoundly critical of OOP.
                    I've also found articles critical of Darwinism--but we can chalk that up
                    to religious zealotry can't we?

                    Any gui more complicated than a few entry fields and some checkbuttons
                    is going to lend itself to OOP--so if you want to do GUI, learn OOP. The
                    time you spend learning OOP will be about 1/10th the time required to
                    debug a modestly complicated gui. This is especially true of guis that
                    require real-time feedback behavior.

                    If you just want to enter some values and set some flags and then hit
                    "go", you could always program the GUI in HTML and have a cgi script
                    process the result. This has a lot of benefits that are frequently
                    overlooked but tend to be less fun than using a bona-fide toolkit like
                    WX or QT.

                    James

                    Comment

                    • Hendrik van Rooyen

                      #25
                      Re: Can a low-level programmer learn OOP?

                      "Aahz" <aahz@pyt...aft .comwrote:
                      Newbie. ;-)
                      >
                      (I started with BASIC in 1976.)
                      >
                      *grinz @ Newbie*

                      I was writing COBOL and NEAT/3 in 1968...

                      - Hendrik

                      Comment

                      • Michele Simionato

                        #26
                        Re: Can a low-level programmer learn OOP?

                        On Jul 14, 8:49 am, James Stroud <jstr...@mbi.uc la.eduwrote:
                        >
                        Any gui more complicated than a few entry fields and some checkbuttons
                        is going to lend itself to OOP--so if you want to do GUI, learn OOP.
                        Yep, there is nothing to be added to that. Except maybe that if you
                        don't care
                        too much about the look&feel you may consider starting with Tkinter.
                        Pros:

                        1. it is part of the standard library, and you already have it;
                        2. it is possibly the easiest/simplest GUI out there;
                        3. it runs pretty much everywhere with minimal fuss.

                        Michele Simionato

                        Comment

                        • John J. Lee

                          #27
                          Re: Can a low-level programmer learn OOP?

                          [Chris Carlen]
                          From what I've read of OOP, I don't get it. I have also found some
                          articles profoundly critical of OOP. I tend to relate to these
                          articles.
                          If you want to know the truth, and opt to neither trust a friend or
                          colleague, nor spend the time to try it yourself, here's a third way:

                          Compile Qt (a toolkit like wx or Tk) and watch the list of source file
                          names scroll past. Beautiful! Perhaps there's some better way of
                          doing GUIs, but watching that list of source files, one realises that
                          that's an academic question: practically, OOP fits GUIs -- and much of
                          the other code in Qt -- so well, and so much effort has been put into
                          these GUI toolkit libraries, that one would be a fool not to use them
                          right now. A somewhat separate issue: You'd also be a fool not to
                          apply OOP to the GUI code *you* write *using* one of those OOP GUI
                          toolkits. Though you won't learn that all at once or without
                          conscious effort, that's not an obstacle with Python -- you can start
                          small.

                          Of course there's some level of experience / project size / project
                          longevity / number of people involved below which dashing it off using
                          what you know right now will be quicker, but the break-even point is
                          not far off in your case, I think.


                          [chris]
                          However, those articles were no more objective than the descriptions
                          of OOP I've read in making a case. Ie., what objective
                          data/studies/research indicates that a particular problem can be
                          solved more quickly by the programmer, or that the solution is more
                          efficient in execution time/memory usage when implemented via OOP
                          vs. procedural programming?
                          [bruno]
                          None. Definitively. wrt/ developper time and memory, it's mostly a
                          matter of fit-your-brains. If it does, you'll find it easier, else
                          [...]

                          How do we have confidence that that's true without doing experiments?
                          AFAIK, only a few such experiments have been done (not counting
                          research that does not meet basic standards of competence or is not
                          peer-reviewed).

                          I think some programming techniques are simply better than others for
                          certain tasks, even when including the variation in people's abilities
                          (but excluding the cost of people learning those techniques, which can
                          of course be significant). Of course, measurement is tricky because
                          of differences between programmers, but it's not impossible.


                          John

                          Comment

                          • John J. Lee

                            #28
                            Re: Can a low-level programmer learn OOP?

                            aahz@pythoncraf t.com (Aahz) writes:
                            [...]
                            Note very very carefully that Python does not require an OOP style of
                            programming,
                            agree

                            but it will almost certainly be the case that you just
                            naturally start using OOP techniques as you learn Python.
                            There's some truth to this. But stagnation is also very easy to
                            achieve, without conscious effort to improve.

                            Also, reading OOP books (and this list) is still beneficial, both
                            before and after you've understood each concept: before because it
                            helps to learn new concepts at a faster rate, and to learn concepts
                            you'd otherwise miss; after because it helps "clean up" and extend
                            your understanding and because it teaches you standard names for
                            things, helping communication.


                            John

                            Comment

                            • Rustom Mody

                              #29
                              Re: Can a low-level programmer learn OOP?

                              On 7/14/07, Alex Martelli <aleax@mac.comw rote:
                              >
                              OOP can be abused (particularly with deep or intricate inheritance
                              structures). But the base concept is simple and clear: you can bundle
                              state and behavior into a stateful "black box" (of which you may make as
                              many instances, with independent state but equal behavior, as you need).
                              >
                              Many years ago (86??) Wegner wrote a paper in OOPSLA called Dimensions
                              of Object Orientation in which he called the 'base concept' of 'bundle
                              of state and behavior' as 'object based' programming and
                              'object-oriented' as object-based + inheritance.

                              What Alex is saying is (in effect) that object-based is simple and
                              clear (and useful) whereas the object-orientation is subject to abuse.

                              This anyway is my experience: C++ programmers are distinctly poorer
                              programmers than C programmers -- for some strange reason closeness to
                              the machine has a salutary effect whereas the encouragment of
                              uselessly over-engineered programs makes worse programmers.

                              GUI is one of those cases wherein inheritance actually helps people
                              produce better code but this is something of an exception.

                              And even here one of the most widely used popularisers of GUIs has
                              been VB which was (at least initially) not object-oriented. VB shows
                              that language orientation -- tailoring 'the language' of drag-n-drop
                              to GUI-building and not just GUI-use -- wins over OOP.
                              Ruby/Rails is another example of language-oriented programming though
                              I feel it goes too far in (de)capitalizin g, pluralizing,
                              (de)hyphenizing etc towards 'readability'.
                              [Sorry if this offends some people -- just my view!]

                              And this makes me wonder: It seems that Tkinter, wxpython, pygtk etc
                              are so much more popular among pythonistas than glade, dabo etc.

                              Why is this?

                              Comment

                              • Wayne Brehaut

                                #30
                                Re: Can a low-level programmer learn OOP?

                                On Fri, 13 Jul 2007 20:37:04 -0400, Steve Holden <steve@holdenwe b.com>
                                wrote:
                                >Aahz wrote:
                                >In article <f787ul0npv@new s4.newsguy.com> ,
                                >Chris Carlen <crcarleRemoveT his@BOGUSsandia .govwrote:
                                >>>From what I've read of OOP, I don't get it.
                                >>
                                >For that matter, even using OOP a bit with C++ and Perl, I didn't get it
                                >until I learned Python.
                                >>
                                >>The problem for me is that I've programmed extensively in C and .asm on
                                >>PC DOS way back in 1988.
                                >>
                                >Newbie. ;-)
                                >>
                                >(I started with BASIC in 1976.)
                                >>
                                >Newbie ;-)
                                >
                                >(I started with Algol 60 in 1967).
                                Newbie ;-)

                                (I started with Royal McBee LGP 30 machine language (hex input) in
                                1958, and their ACT IV assembler later! Then FORTRAN IV in 1965. By
                                1967 I too was using (Burroughs) Algol-60, and 10 years later upgraded
                                to (DEC-10) Simula-67.)

                                Going---going---
                                >>Form 2: Use Python and PySerial and TkInter or wxWidgets.
                                >>>
                                >>Pro: Cross-platform goal will likely be achieved fully. Have a
                                >>programmer nearby with extensive experience who can help.
                                >>Con: Must learn new language and library. Must possibly learn a
                                >>completely new way of thinking (OOP) not just a new language syntax.
                                >>This might be difficult.
                                >>
                                >My experience is that learning GUI programming is difficult. Moreover,
                                >GUI programming in C involves a lot of boilerplate that can be automated
                                >more easily with Python. So I think this will be a better solution.
                                >>
                                >I used to write in C for the SunView platform (back in the days when the
                                >GUI was integrated into the kernel as the only way to get acceptable
                                >speed on the display). From what I remember, "Hello World" took about 40
                                >lines.
                                >
                                >The immense (relatively speaking: this was 1985) size of the libraries
                                >required was one of the primary justifications for implementing shared
                                >libraries.
                                >
                                >Note very very carefully that Python does not require an OOP style of
                                >programming, but it will almost certainly be the case that you just
                                >naturally start using OOP techniques as you learn Python.
                                >
                                >That's very true. I still use a lot of (perhaps too much) procedural
                                >coding, but driving the object-oriented libraries is a great way for a
                                >noob to get started in OOP.
                                >
                                >regards
                                Steve

                                Comment

                                Working...