Re: Not fully OO ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig Allen

    Re: Not fully OO ?

    It is clear to me that Python is a multiparadigmed object oriented
    language. It is clearly possible to write procedural code... that is,
    Python does not force object oriented syntax or concepts on you and
    insist you define everything in such a structure. Is the OO it allows
    full OO, I think so, and the only way to argue otherwise I think is to
    point out that the "main" function is just the module level itself,
    and is not part of an object... which is just the sort of pedantic
    things purists like to hang their hat on.

    personally I am very much the sort that believe in "trust the
    programmer" and likes languages that provide a freedom to use various
    complementary paradigms, in the style of C++. Compared to that, it's
    clear that Python is quite object oriented even in the sense of
    drawing you to build things in object oriented ways... just not
    strictly requiring it. Which is good, it allows some interesting
    patterns which play quite well with object oriented desirgn (i.e.
    module as singleton)... in fact, that plays so well as a singleton,
    some would say the module is just an object anyway, and indeed, the
    intepreter tends to agree.

    So python may turn out to be pure OO, where Objects SIMULATE
    procedural programming paradigms and allow that paradigm as a result,
    on top of OO.

    cheers.
  • Tim Rowe

    #2
    Re: Not fully OO ?

    2008/9/23 Craig Allen <callen314@gmai l.com>:
    So python may turn out to be pure OO
    I think that's the sort of thing the pedants would hang that hats on,
    too. Python isn't *pure* OO, in that it lets the programmers do non-OO
    if they want to, but it is *fully* OO in that it includes everything
    required to do OO. But maybe the original blogger meant by "fully OO"
    what I mean by "Pure OO"?

    The question I usually ask is "Does this language help me get the job
    done?" Python often does. That's all that really matters, isn't it?

    --
    Tim Rowe

    Comment

    • Craig Allen

      #3
      Re: Not fully OO ?

      if they want to, but it is *fully* OO in that it includes everything
      required to do OO. But maybe the original blogger meant by "fully OO"
      what I mean by "Pure OO"?
      it seems to me this is what was meant... pure OO, AND forced to use
      it.

      My personal feeling is that python is multiparadigmed and I'm more
      than fine with that.

      BUT, I am going to hold onto what I've noticed which is that Python
      seems to use OO deeply, well into the interpreter, and that the
      procedural styles available at the Python source level pretty much are
      built on top of this OO model, given you accept a module as an object,
      which it seems to be within the source code... but in the end, it's
      just words and the most important thing is that python is a tool you
      can use to make a computer do what you want, and whatever you call it
      may just be a distraction. cheers.

      Comment

      • Lawrence D'Oliveiro

        #4
        Re: Not fully OO ?

        In message
        <24ac4a18-049f-4ae0-892a-d3fc84995c9d@a1 8g2000pra.googl egroups.com>, Craig
        Allen wrote:
        It is clearly possible to write procedural code... that is,
        Python does not force object oriented syntax or concepts on you ...
        Object orientation IS procedural.

        Comment

        • James Mills

          #5
          Re: Not fully OO ?

          On Fri, Sep 26, 2008 at 8:20 AM, Lawrence D'Oliveiro
          <ldo@geek-central.gen.new _zealandwrote:
          Object orientation IS procedural.
          Correction: OOP is Imperative.

          --JamesMills

          --
          --
          -- "Problems are solved by method"

          Comment

          • Patrick Mullen

            #6
            Re: Not fully OO ?

            Depending on the scale of the website I am making, how much I care
            about editing it in the future, and how much I just want to get
            something up, I will occasionally use php. And I am a self confessed
            php hater :) But it's generally the fastest way I know to get
            something up. So even terrible languages can have their uses!

            Comment

            • Bruno Desthuilliers

              #7
              Re: Not fully OO ?

              Patrick Mullen a écrit :
              Depending on the scale of the website I am making, how much I care
              about editing it in the future, and how much I just want to get
              something up, I will occasionally use php. And I am a self confessed
              php hater :) But it's generally the fastest way I know to get
              something up. So even terrible languages can have their uses!
              Sorry but I fail to see how it relates to the current thread ???

              Comment

              • Steven D'Aprano

                #8
                Re: Not fully OO ?

                On Fri, 26 Sep 2008 17:00:59 +0200, Bruno Desthuilliers wrote:
                Patrick Mullen a écrit :
                >Depending on the scale of the website I am making, how much I care
                >about editing it in the future, and how much I just want to get
                >something up, I will occasionally use php. And I am a self confessed
                >php hater :) But it's generally the fastest way I know to get
                >something up. So even terrible languages can have their uses!
                >
                Sorry but I fail to see how it relates to the current thread ???
                I think Patrick is responding to a comment from Tino Wildenhain:

                [quote]
                Well then it still depends on the perception of "job done". For example
                PHP programmers would bet their soul that their language of choice is
                exactly the right one to "get the job done."
                [end quote]

                Patrick, you will cause much less confusion if you quote relevant parts
                of the text you are replying too.


                --
                Steven

                Comment

                • Tim Rowe

                  #9
                  Re: Not fully OO ?

                  2008/9/26 Tino Wildenhain <tino@wildenhai n.de>:
                  >The question I usually ask is "Does this language help me get the job
                  >done?" Python often does. That's all that really matters, isn't it?
                  >
                  Well then it still depends on the perception of "job done". For example
                  PHP programmers would bet their soul that their language of choice is
                  exactly the right one to "get the job done." :-)
                  You and me would indeed see a different picture on the level of doneness
                  of such jobs ;-)
                  Well, I did say "Often". Before now I've struggled for ages to write a
                  Python program to do a job, then when I've tried C# all the problems
                  have fallen away and the job was done in an hour or so. But other
                  times it has been the other way around; I've done stuff in Python that
                  I wouldn't know where to begin with in other languages. One of my
                  constant refrains is that *no* tool is ideal for *all* jobs!

                  --
                  Tim Rowe

                  Comment

                  • Aaron \Castironpi\ Brady

                    #10
                    Re: Not fully OO ?

                    On Sep 26, 11:48 am, "Tim Rowe" <digi...@gmail. comwrote:
                    2008/9/26 Tino Wildenhain <t...@wildenhai n.de>:
                    >
                    The question I usually ask is "Does this language help me get the job
                    done?" Python often does. That's all that really matters, isn't it?
                    >
                    Well then it still depends on the perception of "job done". For example
                    PHP programmers would bet their soul that their language of choice is
                    exactly the right one to "get the job done." :-)
                    You and me would indeed see a different picture on the level of doneness
                    of such jobs ;-)
                    >
                    Well, I did say "Often". Before now I've struggled for ages to write a
                    Python program to do a job, then when I've tried C# all the problems
                    have fallen away and the job was done in an hour or so. But other
                    times it has been the other way around; I've done stuff in Python that
                    I wouldn't know where to begin with in other languages. One of my
                    constant refrains is that *no* tool is ideal for *all* jobs!
                    >
                    --
                    Tim Rowe
                    I thought procedural and imperative were the same.

                    "Sorry, but you forgot to phrase your expression in the form of a
                    command."
                    I'll take 'modules' for $500, Alex.

                    Comment

                    • Aaron \Castironpi\ Brady

                      #11
                      Re: Not fully OO ?

                      On Sep 26, 11:48 am, "Tim Rowe" <digi...@gmail. comwrote:
                      2008/9/26 Tino Wildenhain <t...@wildenhai n.de>:
                      >
                      The question I usually ask is "Does this language help me get the job
                      done?" Python often does. That's all that really matters, isn't it?
                      >
                      Well then it still depends on the perception of "job done". For example
                      PHP programmers would bet their soul that their language of choice is
                      exactly the right one to "get the job done." :-)
                      You and me would indeed see a different picture on the level of doneness
                      of such jobs ;-)
                      >
                      Well, I did say "Often". Before now I've struggled for ages to write a
                      Python program to do a job, then when I've tried C# all the problems
                      What problems?
                      have fallen away and the job
                      What job?
                      was done in an hour or so. But other
                      times it has been the other way around; I've done stuff in Python that
                      I wouldn't know where to begin with in other languages. One of my
                      constant refrains is that *no* tool is ideal for *all* jobs!
                      >
                      --
                      Tim Rowe
                      If you have wxFormBuilder and the win32 library, it's pretty fast.

                      Python's philosophy is to make common things easy and everything
                      possible.

                      Comment

                      • Tim Rowe

                        #12
                        Re: Not fully OO ?

                        2008/9/26 Bruno Desthuilliers <bdesth.quelque chose@free.quel quepart.fr>:
                        Not to start a troll, but from what I've seen of C# so far I do find this a
                        bit surprising and really suspect more of a library issue than a language
                        one. Care to tell more about the problem and solution ?
                        >
                        (NB : I wouldn't even asked if you had mentionned say Erlang or Prolog or
                        OCaml - well, some mostly different language - instead of C#)
                        IIRC it was library issues -- for one thing I still find it a lot
                        harder to manage an MS Windows GUI under Python than I do under .NET
                        (I've never succeeded in getting Iron Python to run properly). In one
                        sense you could argue that that's not a language issue, and you'd be
                        right: there's nothing in the syntax or semantics of either language
                        that makes it so. But in another sense I'd say it is a language issue
                        (and of course I think I'm right!) because Python aims to be platform
                        independent, and whilst that means gains in portability it means that
                        in return it loses the ease-of-programming of a tightly integrated
                        platform.

                        --
                        Tim Rowe

                        Comment

                        • Tim Rowe

                          #13
                          Re: Not fully OO ?

                          2008/9/26 Aaron Castironpi Brady <castironpi@gma il.com>:
                          If you have wxFormBuilder and the win32 library, it's pretty fast.
                          Speed has never been an issue for me with Python. For my masters
                          degree I did a project that involved a lot of number crunching, and in
                          my proposal I wrote that I'd use Python for most of the code and C for
                          any parts that were unacceptably slow. In practice, not only did I
                          never need to replace any parts with C, I never even needed to use
                          numpy; it was quite fast enough as it was.
                          Python's philosophy is to make common things easy and everything
                          possible.
                          But what's common for one person may be uncommon for another. And
                          sometimes "possible" isn't enough, or we'd all be using INTERCAL!

                          Another, quite different example to the one I was referring to earlier
                          is the fact that I often work with safety critical systems. I don't
                          think formal proof of program behaviour would be at all
                          straightforward in Python (or C# for that matter, and although Spec#
                          gets closer, it really needs a language like Spark Ada).

                          --
                          Tim Rowe

                          Comment

                          • Aaron \Castironpi\ Brady

                            #14
                            Re: Not fully OO ?

                            On Sep 26, 6:40 pm, "Tim Rowe" <digi...@gmail. comwrote:
                            2008/9/26 Aaron Castironpi Brady <castiro...@gma il.com>:
                            >
                            If you have wxFormBuilder and the win32 library, it's pretty fast.
                            >
                            Speed has never been an issue for me with Python. For my masters
                            degree I did a project that involved a lot of number crunching, and in
                            my proposal I wrote that I'd use Python for most of the code and C for
                            any parts that were unacceptably slow. In practice, not only did I
                            never need to replace any parts with C, I never even needed to use
                            numpy; it was quite fast enough as it was.
                            >
                            Python's philosophy is to make common things easy and everything
                            possible.
                            >
                            But what's common for one person may be uncommon for another. And
                            sometimes "possible" isn't enough, or we'd all be using INTERCAL!
                            >
                            Another, quite different example to the one I was referring to earlier
                            is the fact that I often work with safety critical systems. I don't
                            think formal proof of program behaviour would be at all
                            straightforward in Python (or C# for that matter, and although Spec#
                            gets closer, it really needs a language like Spark Ada).
                            >
                            --
                            Tim Rowe
                            No. I understand that formal proof systems, as well as automated
                            theorem provers, have been difficult to develop. When I took ML, the
                            homeworks were to prove the correctness of an interpretation of a
                            program, and the unique existence of a meaning by induction.

                            But I, and I imagine I'm not the only one, would love to know the
                            example that C# developed faster than Python. I suppose the fact that
                            the line of wx specification that has two identifiers where C# has one
                            is more of a drain on programmer resources than may commonly be
                            recognized--- not the same as the cost of one extra word in a paper or
                            in an editorial. Similarly, maybe the program that has one extra
                            identifier in a line takes a lot more time to develop. Perhaps it's
                            the "7 +/- 1" trend in attention span that makes the difference large
                            in that case. 8 identifiers would in that theory be a big deal, so
                            the example in C# could make the case for it.

                            Comment

                            • Tim Rowe

                              #15
                              Re: Not fully OO ?

                              2008/9/27 Aaron Castironpi Brady <castironpi@gma il.com>:
                              But I, and I imagine I'm not the only one, would love to know the
                              example that C# developed faster than Python. I suppose the fact that
                              the line of wx specification that has two identifiers where C# has one
                              is more of a drain on programmer resources than may commonly be
                              recognized--- not the same as the cost of one extra word in a paper or
                              in an editorial. Similarly, maybe the program that has one extra
                              identifier in a line takes a lot more time to develop.
                              But I didn't use wx -- that's rather the point. Long before the days
                              of Python, I kept wanting to use Modula2 but kept getting driven back
                              to C because in Modula2 I kept having to write stuff that was already
                              in C libraries. Modula2 was a far better language, but C usually was
                              far more productive because of what went around it. C#'s tight
                              integration with .net and VS mean that it's not a question of one
                              identifier instead of two, it's *zero* identifiers instead of two
                              because the tool does it all for me. Does that mean that C# is a
                              better language than Python? No, of course not. Does it mean that what
                              I was doing was not possible in Python? No, of course not. Does it
                              mean that C# was more productive than Python for me doing that
                              particular job? Yes it does. (FWIW, I also found the .net XML handling
                              easier to cope with on that same job).

                              One day Iron Python plus the VS integration might wean me off C# but
                              last time I looked it wasn't close. Maybe I should take another look
                              and see how it's coming on.

                              --
                              Tim Rowe

                              Comment

                              Working...