Prothon Prototypes vs Python Classes

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

    Syntax counts (was Re: Prothon Prototypes vs Python Classes)

    In article <8ef9bea6.04032 82102.632ae427@ posting.google. com>,
    Hung Jung Lu <hungjunglu@yah oo.com> wrote:[color=blue]
    >
    >I often don't know how to take it when I see people talking about OOP
    >by using definitions like: polymorphism, data hiding, etc. As if these
    >definitions were something of utmost importance. To me, OOP is just a
    >tool for factorizing code, just like using for-loops and using
    >functions to factor out repetitive code. Polymorphism, data hiding,
    >etc. are all secondary features: code factorization is the heart and
    >soul of OOP. Class-based OOP is a way of factorizing. Prototype-based
    >is just another way of factorizing, which seems to be more elegant:
    >instead of two concepts (classes and instances), you unify them and
    >have only one concept (objects). Moreover, in a prototype-based
    >language like Io, even scopes and objects are unified.[/color]

    Seems to me that Lisp is the counter-datapoint that disproves, not your
    thesis at the theoretical level, but the ways in which your thesis gets
    applied in practice. From my POV, Python demonstrates that syntax
    counts and that using different syntactical forms for different kinds of
    factorization makes people enormously productive.

    So saying "just factorization" misses the point IMO. Factorization
    needs to be elegantly defined and easy mechanisms for applying it
    created. What you call the secondary features are the user interfaces
    for factorization and they are a necessary component for the successful
    use of factorization.
    --
    Aahz (aahz@pythoncra ft.com) <*> http://www.pythoncraft.com/

    "usenet imitates usenet" --Darkhawk

    Comment

    • Markus Wankus

      Re: [OT] Top posting is a PITA [was : Prothon Prototypes vs PythonClasses]

      Right. So if we'd all just settle on top-posting things wouldn't be so
      bad after all. It's all you bottom-posters that are screwing things up
      for the rest of us. ;o)

      Markus.

      Stephen Horne wrote:
      [color=blue]
      > This is actually better than top-posting. At least the reading
      > direction is _consistently_ upwards, rather than requiring people to
      > leap forwards and back through the post in a desperate attempt to find
      > the clues they need.
      >[/color]
      [color=blue]
      > On Wed, 31 Mar 2004 02:31:08 -0800, Michael
      > <mogmios@mlug.m issouri.edu> wrote:
      >
      >[color=green]
      >>top.
      >>to
      >>bottom
      >>read
      >>to
      >>learn
      >>to
      >>you
      >>forcing
      >>be
      >>would
      >>this
      >>No,[/color][/color]

      Comment

      • Markus Wankus

        Re: [OT] Top posting is a PITA [was : Prothon Prototypes vs PythonClasses]

        Amen! Well said, Mr. Baumann.

        R Baumann wrote:
        [color=blue]
        > I belong to several newsgroups, some prefer top-posting, and some prefer
        > bottom posting. A few posters will spend the time to intersperse their
        > replies. And a few will even split a post into additional posts to reply
        > specifically to each question or comment that was made in a previous
        > post(pretty anal). Personally, I don't care how you post, it doesn't
        > irritate me a bit whether the post is top or bottom, replies interspersed,
        > or broken into multiple posts. My only real irritation, is the people that
        > feel that they have to include all the prior postings in the thread in their
        > post. I know what the thread's about, and if I want to see the previous
        > posts, I know how to go back and look at them. I'm just interested in the
        > answer(s). Period.
        >
        > My point being?...There' s no "correct" way to reply to a post. Out of
        > courtesy, one follows the "standard" of the newsgroup one is participating
        > in. Complaining whether one top posts or bottom posts is just a waste of
        > time, and you, me, we, all know it. We just don't have anything better to
        > do but bitch, right?
        >
        > This particular silly argument always has the same effect; it gets us
        > off-topic from the original post, and for those of us trying to follow that
        > topic, this is more irritating than whether one is "posting in the approved
        > manner". This thread was renamed to a different subject, but that was a
        > half-dozen rants later in the thread than it needed to be.
        >
        > Get my point? Naw, too much to expect. I've wasted both your time and my
        > time with my own rant against your rants. :-)
        >
        >
        > A lot of you guys seem far more interested in starting arguments and keeping
        > them running, than you are discussing the pros and cons of Python and
        > providing helpful answers. Rein in your egos, no one, and I include myself,
        > has anything helpful to contribute in this kind of "dust-up".
        >
        >
        >[/color]

        Comment

        • has

          Re: Prothon Prototypes vs Python Classes

          Joe Mason <joe@notcharles .ca> wrote in message news:<slrnc6e2s m.fhj.joe@gate. notcharles.ca>. ..[color=blue]
          > In article <69cbbef2.04032 80928.438d194f@ posting.google. com>, has wrote:[color=green]
          > > # Library pseudocode
          > >
          > > _fooRegistry = []
          > >
          > > obj _Foo: # prototype object
          > > # Foo's code goes here
          > >
          > > def Foo(): # constructor function
          > > newFoo = _Foo.copy()
          > > _fooRegistry.ap pend(newFoo)
          > > return newFoo
          > >
          > >
          > > Dirt simple with not an ounce of class metaprogramming in sight.[/color]
          >
          > Is Foo() the standard syntax for making a new _Foo object? If this is a
          > new wrapper you just created, then it's no different than adding a
          > register() method - the user has to know that something different is
          > being done.
          >
          > If Foo() is the standard syntax, and you're just overriding the
          > implementation here, does that get inherited? If so, this missed the
          > condition that only some of the descendants should get added to the
          > registry. If not - well, inheriting the constructor seems like the more
          > useful behaviour in general, so why not?[/color]

          Don't think you've quite got the point of prototype-based OO yet.
          There's no real 'standard syntax' for making objects; nor is there any
          inheritance, classes, metaclasses, or instances. To create a new
          object from scratch, execute the code that defines it. Alternatively,
          duplicate an existing object.

          Think of prototype-based languages as taking the more traditional,
          two-tier class-based OO system and lopping off the entire upper tier.
          The result is a much simpler, more direct, less formal and more
          flexible approach to OO programming. If you're used to class-based
          programming you may find the lack of predefined rules and formal
          convention and ceremony a bit offputting. I expect Java programmers
          feel the same when they first encounter Python's type system. Devise
          rules to suit yourself, abstract away as little or as much as you
          like. Can be quite refreshing getting right down to basics like this,
          even if it's a little scary at first. :)

          Comment

          • Michael

            Re: [OT] Top posting is a PITA [was : Prothon Prototypes vs PythonClasses]

            [color=blue]
            >This is actually better than top-posting. At least the reading
            >direction is _consistently_ upwards, rather than requiring people to
            >leap forwards and back through the post in a desperate attempt to find
            >the clues they need.
            >[/color]
            That'd get really interesting when posting code examples. Why on Earth
            would you leap forwards and back through a top post to find anything?
            You start reading at the top and read until you run into the quoted
            text. You only read the quoted text if you're curious to see which
            specific message this message was in reply to. Top-posting should
            require you to scroll your screen less. I think if I started posting
            bottom-top text as you say you like better than top-posting then I'd
            rightly be killed by the list Gods.

            Comment

            • Michael

              Re: [OT] Top posting is a PITA

              [color=blue]
              >I find it surprising to see programmers arguing for top-posting. They
              >are arguing that exchanging the single author's time and brain cycles
              >for the time and cycles of many readers is a good trade-off. Perhaps
              >they just feel their time is infinitely more valuable than anyone
              >else's. I'm sure every top-poster present can think of vendors who
              >work from the point of view that their time and effort is more
              >valuable than the user's. The result of this philosophy is alienating
              >to users of software AND articles.
              >
              >[/color]
              I follow more than 300 mailing lists on a regular basis (I get around 3
              gigs of mail a day just from these lists) and I much prefer people that
              top-post. I can click through messages with interesting topics and skim
              the relevant text without having to scroll anything down. So IMO it's
              more about saving the readers effort than saving the poster effort.

              Of course the only people I really hate are those that quote text
              without quoting it.. so it's all on the same level and you can't tell
              what they wrote from what others have written. THAT drives me nuts.

              Comment

              • Ben Finney

                Re: [OT] Top posting is a PITA [was : Prothon Prototypes vs Python Classes]

                On Wed, 31 Mar 2004 15:08:38 -0800, Michael wrote:[color=blue]
                > Why on Earth would you leap forwards and back through a top post to
                > find anything?[/color]

                Why on Earth would to include the quoted material if it's irrelevant to
                your post?
                [color=blue]
                > You start reading at the top and read until you run into the quoted
                > text. You only read the quoted text if you're curious to see which
                > specific message this message was in reply to.[/color]

                That information is already provided in the message headers
                (specifically, the "References :" header on Usenet posts, the
                "In-Reply-To:" header on emails).
                [color=blue]
                > Top-posting should require you to scroll your screen less. I think if
                > I started posting bottom-top text as you say you like better than
                > top-posting then I'd rightly be killed by the list Gods.[/color]

                If you only include the stuff you actually want to be read, then your
                post is able to be read once, in a single direction.

                Quote only the part of the original message you are replying to.

                Reply below each part you're responding to, in chronological order.

                Anything else is confusing and irritating for anyone who has learned to
                read any human writing system.

                --
                \ "It takes a big man to cry, but it takes a bigger man to laugh |
                `\ at that man." -- Jack Handey |
                _o__) |
                Ben Finney <http://bignose.squidly .org/>

                Comment

                • Stephen Horne

                  Re: [OT] Top posting is a PITA [was : Prothon Prototypes vs Python Classes]

                  On Wed, 31 Mar 2004 15:08:38 -0800, Michael
                  <mogmios@mlug.m issouri.edu> wrote:
                  [color=blue]
                  >[color=green]
                  >>This is actually better than top-posting. At least the reading
                  >>direction is _consistently_ upwards, rather than requiring people to
                  >>leap forwards and back through the post in a desperate attempt to find
                  >>the clues they need.
                  >>[/color]
                  >That'd get really interesting when posting code examples. Why on Earth
                  >would you leap forwards and back through a top post to find anything?
                  >You start reading at the top and read until you run into the quoted
                  >text.[/color]

                  Rubish. You read the top post until you don't know what it's talking
                  about, and then you have to read stuff in the quoted text to find the
                  context, then you return to the top until you hit the next problem,
                  and then you're back to the quoted text again and so on.

                  [color=blue]
                  > You only read the quoted text if you're curious to see which
                  >specific message this message was in reply to.[/color]

                  My memory isn't that good that I can remember everything about some
                  post written days ago just from identifying which particular one it
                  was. Even if I did, I won't necessarily understand the logical
                  connections between parts of the reply and parts of the replied-to
                  message unless they are ordered such that each piece of the reply
                  follows a quote identifying the specific thing it is replying to.


                  --
                  Steve Horne

                  steve at ninereeds dot fsnet dot co dot uk

                  Comment

                  • Joe Mason

                    Re: Prothon Prototypes vs Python Classes

                    In article <69cbbef2.04033 11324.32837704@ posting.google. com>, has wrote:[color=blue]
                    > Joe Mason <joe@notcharles .ca> wrote in message news:<slrnc6e2s m.fhj.joe@gate. notcharles.ca>. ..[color=green]
                    >> In article <69cbbef2.04032 80928.438d194f@ posting.google. com>, has wrote:[color=darkred]
                    >> > # Library pseudocode
                    >> >
                    >> > _fooRegistry = []
                    >> >
                    >> > obj _Foo: # prototype object
                    >> > # Foo's code goes here
                    >> >
                    >> > def Foo(): # constructor function
                    >> > newFoo = _Foo.copy()
                    >> > _fooRegistry.ap pend(newFoo)
                    >> > return newFoo
                    >> >
                    >> >
                    >> > Dirt simple with not an ounce of class metaprogramming in sight.[/color]
                    >>
                    >> Is Foo() the standard syntax for making a new _Foo object? If this is a
                    >> new wrapper you just created, then it's no different than adding a
                    >> register() method - the user has to know that something different is
                    >> being done.
                    >>
                    >> If Foo() is the standard syntax, and you're just overriding the
                    >> implementation here, does that get inherited? If so, this missed the
                    >> condition that only some of the descendants should get added to the
                    >> registry. If not - well, inheriting the constructor seems like the more
                    >> useful behaviour in general, so why not?[/color]
                    >
                    > Don't think you've quite got the point of prototype-based OO yet.
                    > There's no real 'standard syntax' for making objects; nor is there any
                    > inheritance, classes, metaclasses, or instances. To create a new
                    > object from scratch, execute the code that defines it. Alternatively,
                    > duplicate an existing object.[/color]

                    There certainly is a standard syntax for making objects. I need to know
                    how to "duplicate an existing object". Is it "obj.dup()" ?
                    "obj.clone( )"? "duplicate obj"? Most probably, the language (or
                    standard library) defines one of these, and I expect most objects to be
                    duplicated in the same way.

                    If I want to duplicate an object and add it to a registry, I can
                    obviously say "obj2 = obj.dup(); registery.appen d(obj2)". But if I were
                    designing a library defining objects of this type which were *always*
                    intended to be added the registry, it would be preferable for the
                    standard "obj.dup()" syntax to do this automatically as well, so the
                    user doesn't need to know about the extra registry step.

                    Whether it's "the point" of prototype-based OO or not, such hiding of
                    complexity is a valuable thing for the language to do. If it turns out
                    that you just can't do this because it's not part of the philosophy,
                    then the philosophy is lacking. (Unless you can give me an equivalent
                    procedure which is covered by the philosophy, and demonstrate that it's
                    just as good.)


                    In the example you gave, the way to make this object was "Foo()".
                    Because we're talking about several different languages here, which have
                    syntax which are mild variations on each other, it can be confusing to
                    tell what exactly a bit of posted code is referring to. That's why I
                    asked (rhetorically) if "Foo()" was the standard way to create an
                    object. I assume you're talking about Prothon, in which it *is*. In
                    that case, my second question stands - how do you inherit the behaviour
                    of adding to the registry, without rewriting the "_fooRegistry.a ppend()"
                    line for each cloned object?

                    Joe

                    Comment

                    • Jacek Generowicz

                      Re: [OT] Top posting is a PITA [was : Prothon Prototypes vs Python Classes]

                      Markus Wankus <markus_wankusG ETRIDOFALLCAPS@ hotmail.com> writes:
                      [color=blue]
                      > Right. So if we'd all just settle on top-posting things wouldn't be
                      > so bad after all. It's all you bottom-posters that are screwing
                      > things up for the rest of us. ;o)[/color]

                      Did you actually _understand_ what he wrote? Yes, I did notice the
                      smiley, but I also noticed the apparent complete failure to get the
                      point. Complete failure to get the point, I find, is often strongly
                      correlated to top-posting.

                      Even if _everyone_ top-posts, then the reading direction is still
                      inconsisitent and requires the reader to jump back and-forth, to
                      understand what is going on.

                      Please _think_ about it. It really doesn't take very much thought to
                      understand that top-posting sucks, but it does require some. More than
                      top-posters seem to be able to muster, it seems.

                      Comment

                      • Jacek Generowicz

                        Re: [OT] Top posting is a PITA

                        Michael <mogmios@mlug.m issouri.edu> writes:
                        [color=blue]
                        > I follow more than 300 mailing lists on a regular basis (I get around
                        > 3 gigs of mail a day just from these lists)[/color]

                        Given the time this must leave you to read, understand, and
                        thoughtfully reply to any given article ... I'll let you draw your own
                        conclusions about what effect this might have on the quality of your
                        contributions.
                        [color=blue]
                        > and I much prefer people that top-post.[/color]

                        .... yup, if you are really not interested in _understanding_ what is
                        going on, then top-posting is for you.
                        [color=blue]
                        > Of course the only people I really hate are those that quote text
                        > without quoting it.. so it's all on the same level and you can't tell
                        > what they wrote from what others have written.[/color]

                        They should be tortured without remorse.

                        Comment

                        • Jacek Generowicz

                          Re: [OT] Top posting is a PITA

                          "John Roth" <newsgroups@jhr othjr.com> writes:
                          [color=blue]
                          > AFAIC, it doesn't matter whether you put your response at the
                          > top or bottom; what matters to me is whether I can find what
                          > you're talking about quickly. That means ruthless pruning of the
                          > post so that old stuff gets deleted.[/color]

                          Look, y'all, email and usenet aren't all that dissimilar, in this
                          respect, from face-to-face conversation which has been
                          interrupted. Imagine you pick up a conversation whith someone, which
                          was interrupted a few minutes, hours, or days before.

                          Do you go up to your interlocutor, say whatever you wanted to say
                          next, and then recite (both sides of) the whole conversation you had
                          before? No.

                          Do you _first_ repeat (both sides of) the whole conversation you had
                          before, and at the very end (ten minutes later, or so) say whatever it
                          is that you wanted to say? No. Does your interlocutor then repeat
                          everything both of you have said so far once again, before adding his
                          new contribution? No.

                          Or, do you, re-establish context by saying something like "Concerning
                          your point about fubaring the frobnicators", and then make your point
                          ("I would never fubar a frobnicator, without barzotting it first") ?

                          Then, maybe you wish to make a second point ... in which case you
                          would establish the relevant context again ("As for what you said
                          about pinging a pong"), and make your next point, relevant to the
                          context you just established ("When pinging a pong, you must take care
                          to pang it first").


                          I find that people who do not make the effort to quote the relevant
                          part(s) of messages to which they are replying, and do not make the
                          effort to put their replies close to (ie just after) the relevant
                          citations they have left in, more often than not, also fail to make
                          the effort to organize their own thoughts in their entire
                          consideration of the discussion.

                          Exchanges with top-posters are usually of a low quality: top-posting
                          makes it difficult to follow the thread ... but top-posters tend to
                          write codswallop more often that those who trim and organize their
                          replies carefully.

                          This is partly because the process of trimming the original post,
                          forces you to identfy the relevant points being made, which helps you
                          notice more clearly what is actually being said. Partly, it is because
                          if you post on usenet for more than a day and fail to notice that
                          top-posting sucks, then ... well, that says something about your
                          perspicacity.

                          Comment

                          • Michael

                            Re: [OT] Top posting is a PITA

                            [color=blue]
                            >Given the time this must leave you to read, understand, and
                            >thoughtfully reply to any given article ... I'll let you draw your own
                            >conclusions about what effect this might have on the quality of your
                            >contribution s.
                            >
                            >[/color]
                            Actually I'm a major contributor to many lists. Obviously I just watch
                            most. Or decide a thread interests me at random points in whichI decide
                            to follow a list more closely for a few days. Also obvious, it's not
                            always the threads that have actual value that interest me.. since I've
                            participated in this one. I'm just amused to see this same argument
                            repeated pointlessly year after year.
                            [color=blue]
                            >... yup, if you are really not interested in _understanding_ what is
                            >going on, then top-posting is for you.
                            >
                            >[/color]
                            I understand by having read the thread and remembered it. If I need a
                            context hint I can peek below but that is usually only needed with
                            complex interwoven threads. Which isn't the majority.. which is why I
                            think top-posting is good for a majority of messages but inline
                            bottom-posting is good other times. Use what is best for the given message.

                            Comment

                            • Ed Cogburn

                              Re: [OT] Top posting is a PITA [was : Prothon Prototypes vs PythonClasses]

                              R Baumann wrote:[color=blue]
                              > one follows the "standard" of the newsgroup one is participating in.[/color]


                              No such thing, since there is no way to enforce these "standards" , and the
                              bottom-posters will always bottom post, and the top-posters will always top
                              post no matter where they are.

                              [color=blue]
                              > Complaining whether one top posts or bottom posts is just a waste of
                              > time, and you, me, we, all know it.[/color]


                              Not always, sure there are the smart asses who top-post just to annoy people,
                              but a lot of top-posters do that because they are newbies and don't know that
                              it annoys so many people. Often they just need to find out how to change
                              their reader program's default, or simply discover that their reader does have
                              such an option.

                              [color=blue]
                              > this is more irritating than whether one is "posting in the approved manner".[/color]


                              No it isn't, as long as someone sticks "OT" in the subject line, I don't mind
                              anyone talking about something else. If its identified as off topic, I can
                              always skip it. Top-posting on the other hand, is annoying because its
                              unnatural for most of us. Most of us may not say anything, and most of the
                              time its not "serious", but IMO, top-posting is far more irritating then OT posts.

                              [color=blue]
                              > This thread was renamed to a different subject, but that was a
                              > half-dozen rants later in the thread than it needed to be.[/color]


                              Why complain about this when you're obviously still participating in this
                              thread two *dozen* posts after "OT" was inserted?

                              [color=blue]
                              > Get my point? Naw, too much to expect. I've wasted both your time and my
                              > time with my own rant against your rants. :-)[/color]


                              Yep, everyone has their pet peeve, but isn't it kinda obvious by now that
                              there are a *lot* more people peeved about top-posting than there are peeved
                              at OT posts. :)

                              [color=blue]
                              > A lot of you guys seem far more interested in starting arguments and keeping
                              > them running, than you are discussing the pros and cons of Python and
                              > providing helpful answers. Rein in your egos, no one, and I include myself,
                              > has anything helpful to contribute in this kind of "dust-up".[/color]


                              I've seen this complaint a thousand times too, and it never makes a
                              difference. You're basically asking people to stop being human, which is why
                              we designated "OT" as a warning for others that the conversation has drifted
                              far afield. However, we never did adopt "TP" so top-posters could warn
                              others, mainly because top-posting is not seen as inevitable, irresistible
                              human behavior, it is of course simply an example of laziness (or ignorance),
                              nothing more. While laziness is inevitable in some humans, its still not
                              accepted behavior. People arguing with one another is perfectly natural, and
                              has been going on for millenia, but for most of the world, its written
                              conversations are done top-to-bottom, not bottom-to-top.


                              Comment

                              • Roy Smith

                                Re: [OT] Top posting is a PITA

                                What makes you think people who top post don't also put a lot of effort
                                into carefully organizing their replies and trimming the original post
                                down to the most relevant points?

                                Jacek Generowicz <jacek.generowi cz@cern.ch> wrote:[color=blue]
                                > top-posters tend to write codswallop more often that those who trim
                                > and organize their replies carefully.
                                >
                                > This is partly because the process of trimming the original post,
                                > forces you to identfy the relevant points being made[/color]

                                Comment

                                Working...