473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Prothon Prototypes vs Python Classes

Playing with Prothon today, I am fascinated by the idea of eliminating
classes in Python. I'm trying to figure out what fundamental benefit
there is to having classes. Is all this complexity unecessary?

Here is an example of a Python class with all three types of methods
(instance, static, and class methods).

# Example from Ch.23, p.381-2 of Learning Python, 2nd ed.

class Multi:
numInstances = 0
def __init__(self):
Multi.numInstances += 1
def printNumInstances():
print "Number of Instances:", Multi.numInstances
printNumInstances = staticmethod(printNumInstances)
def cmeth(cls, x):
print cls, x
cmeth = classmethod(cmeth)

a = Multi(); b = Multi(); c = Multi()

Multi.printNumInstances()
a.printNumInstances()

Multi.cmeth(5)
b.cmeth(6)
Here is the translation to Prothon.

Multi = Object()
with Multi:
.numInstances = 0
def .__init__(): # instance method
Multi.numInstances += 1
def .printNumInstances(): # static method
print "Number of Instances:", Multi.numInstances
def .cmeth(x): # class method
print Multi, x

a = Multi(); b = Multi(); c = Multi()

Multi.printNumInstances()
a.printNumInstances()

Multi.cmeth(5)
b.cmeth(6)
Note the elimination of 'self' in these methods. This is not just a
syntactic shortcut (substiting '.' for 'self') By eliminating this
explicit passing of the self object, Prothon makes all method forms
the same and eliminates a lot of complexity. It's beginning to look
like the complexity of Python classes is unecessary.

My question for the Python experts is -- What user benefit are we
missing if we eliminate classes?

-- Dave

Jul 18 '05
145 6164
Michael wrote:
If you're making a short response to the entire message it's okay to top
post.


I wouldn't consider it appropriate even then. In that situation
I usually pick some distinctive sentence from the original and
quote that -- just to remind people of the context, not to
reproduce it in toto.

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg

Jul 18 '05 #101
On Tue, 30 Mar 2004 22:40:34 -0700, Hamilcar Barca wrote:
top-posting doesn't follow the rules of written European language.


I don't know why you feel the need to qualify that; I don't know of
*any* human writing system in current use where a discussion proceeds
from the bottom to the top. So:

top-posting doesn't follow the rules of written language.

seems stronger to me.

--
\ "When I turned two I was really anxious, because I'd doubled my |
`\ age in a year. I thought, if this keeps up, by the time I'm six |
_o__) I'll be ninety." -- Steven Wright |
Ben Finney <http://bignose.squidly.org/>
Jul 18 '05 #102
I just downloaded it. I'll give it a try.

"JanC" <us*********@janc.invalid> wrote in message
news:Xn******************@213.119.4.35...
"Mark Hahn" <ma**@prothon.org> schreef:
I really really try to remember to quote from below. If you go through my posts you will see that I remember most of the time. The last few days I
have been reponding to four or five mailing lists after months of only
coding and my fingers are worn out.


Try OE-QuoteFix, it can help you, and it's free:
<http://home.in.tum.de/~jain/software/oe-quotefix/>

Also, I think OE allows you to select the text-to-quote _before_ replying.

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9

Jul 18 '05 #103
Bruno Desthuilliers wrote:
Peter Hickman wrote:
People who whine on about 'top posting' are the sort of people who
draft 'clean desk' policies. If you want to whine about top posting
then start alt.whine.top.posting and have fun.

That is not quite right. Using top posting forces every reader to
unlearn a lifetime of knowledge about narrative flow in content.

Left-right - top-down

That's how we are reading and writing in most western cultures. For me
that's about 40 years of habbit. And it takes a lot of mental effort to
read.

You could just as well expect that we start reading from right to left.
Exactly the same thing.

..too confusing pretty is that And
regards Max M
Jul 18 '05 #104
top.
to
bottom
read
to
learn
to
you
forcing
be
would
this
No,
That is not quite right. Using top posting forces every reader to
unlearn a lifetime of knowledge about narrative flow in content.

Left-right - top-down

That's how we are reading and writing in most western cultures. For me
that's about 40 years of habbit. And it takes a lot of mental effort
to read.

You could just as well expect that we start reading from right to
left. Exactly the same thing.

.too confusing pretty is that And


With top posting you're still reading the same way. You shouldn't even
need to read the quoted text below. It's only there to help keep the
structure of the conversation recorded. You read the relevant parts of a
document first and since we are, as you said, used to reading top-down
that means the relevant parts are highest on the page. The same way we
read a title and opening paragraph before reading the rest of a document.

Jul 18 '05 #105
Max M wrote:
Peter Hickman wrote:
People who whine on about 'top posting' are the sort of people who
draft 'clean desk' policies. If you want to whine about top posting
then start alt.whine.top.posting and have fun.


That is not quite right. Using top posting forces every reader to
unlearn a lifetime of knowledge about narrative flow in content.


(ages since I jumped into a troll... :-)

What against-top-posting people do not WANT to understand is that the very first
interest of posting is, to me, to get help or information.

So, you post your question and, by definition, you remember what it was (well, I
hope so).

Then, you go back to the ng the day after and if you got an answer, you are
interested in the answer, not to reread your post.

I do not read answers to questions I did not post, so I don't care about
"unlearn a lifetime of knowledge about narrative flow in content".

Period.

But as I try to be a gentleman, I did not top-post my post :-)

D.
Toulouse
Auto elected President of the Top Posting Liberation Army

Jul 18 '05 #106
Michael wrote:
With top posting you're still reading the same way. You shouldn't even
need to read the quoted text below.
Then why waste space and bandwidth and include it?
It's only there to help keep the
structure of the conversation recorded.


If you need to refresh your memory on the discussion then back up the
thread and read the previous messages. A whole keypress in most readers.

And that's saying nothing of rendering the information that's given by
the line count of the posting useless. Many readers display the line
count with the subject, and that gives you a clue as to how 'heavy' the
posting is going to be. Just a short rebuttal, a 'me too', or a
dissertation in it's own right? It's impossible to tell when people
include the particular version of the King James' bible they're
commenting on.

As I'm against capital punishement; twentyfive to life for top-posters,
I say.

Stefan,
--
Stefan Axelsson (email at http://www.cs.chalmers.se/~sax)
Jul 18 '05 #107
Then why waste space and bandwidth and include it?
Because it provides contunity?
If you need to refresh your memory on the discussion then back up the
thread and read the previous messages. A whole keypress in most readers.
Which is fine except that often threads go in mupltiple directions and
have multiple people conversing such that without quoted text a reader
may be unsure what and who was being responded to.
And that's saying nothing of rendering the information that's given by
the line count of the posting useless. Many readers display the line
count with the subject, and that gives you a clue as to how 'heavy'
the posting is going to be. Just a short rebuttal, a 'me too', or a
dissertation in it's own right? It's impossible to tell when people
include the particular version of the King James' bible they're
commenting on.


Which is why it's helpful to clip your quoted material to what is needed
to be informative and that is all. It might be a good feature if you
made an option in your mail program not to count quoted lines. Should't
be to hard to implement.

Jul 18 '05 #108
>>>>> "Didier" == Didier Morandi <no@spam.com> writes:

Didier> I do not read answers to questions I did not post, so I don't care
Didier> about "unlearn a lifetime of knowledge about narrative flow in
Didier> content".

So essentially Usenet should be a free Q&A automaton, where people
post questions and Usenet fairies go around answering them? Everybody
takes, nobody gives? I believe such service should cost you money...

Note that many read the newsgroup w/o having any questions of their
own, perhaps wanting to learn from the questions of others or see if
there is some interesting discussion going on. Top posting kills all
that.

It surprises me how much flammage people need before correcting the
error of their ways these days. Top posting might be forgivable for a
newbie/grandmother who is just trying his hand w/ Usenet for the first
time, but repeat offenders should be reprimanded.

--
Ville Vainio http://tinyurl.com/2prnb
Jul 18 '05 #109
On Wed, Mar 31, 2004 at 12:30:23PM +0200, Didier Morandi wrote:
Max M wrote:
That is not quite right. Using top posting forces every reader to
unlearn a lifetime of knowledge about narrative flow in content.
(ages since I jumped into a troll... :-)

What against-top-posting people do not WANT to understand is that the very
first interest of posting is, to me, to get help or information.


My mail reader (I'm using the mailing-list gateway for comp.lang.python, but
this applies equally well to usenet readers) highlights quoted and
non-quoted text in different colours (in case the ">" aren't distinctive
enough already for you!). I find my eye jumps directly to the fresh text
just fine, *and* when people snip text and bottom-post, I still get a
coherent, sensible, intuitively-ordered view of the conversation (not to
mention a seperate pane showing this messages position in the overall
thread).

It's the best of both worlds, but it's ruined by top-posters.
So, you post your question and, by definition, you remember what it was
(well, I hope so).

Then, you go back to the ng the day after and if you got an answer, you are
interested in the answer, not to reread your post.
One of the great features of newsgroups (and mailing-lists) is their ability
to support multiple concurrent conversations -- and that's just within a
single group/list. I subscribe to a lot of mailing lists. It's nice to
have a contextual reminder of what the thing you're reading right now was
related to.

You are also presupposing a very limited question-answer format for usenet,
which is certainly not the only form of communication I see here.
I do not read answers to questions I did not post, so I don't care about
"unlearn a lifetime of knowledge about narrative flow in content".

Period.


Then why are you reading this thread? ;)

-Andrew.
Jul 18 '05 #110

"Didier Morandi" <no@spam.com> wrote in message
news:c4***********@biggoron.nerim.net...

What against-top-posting people do not WANT to understand is that the very first interest of posting is, to me, to get help or information.

So, you post your question and, by definition, you remember what it was (well, I hope so).

Then, you go back to the ng the day after and if you got an answer, you are interested in the answer, not to reread your post.


That's a very good point. One of the forums I read is Baen's Bar
(Baen Publishing) where the publisher has an ironclad rule that
responses to him *must* be top posted. He is absolutely not
going to hit the page down button to see whether there was
anything interesting in the response. If he doesn't see it where
his eyes are pointing, it might as well not exist. I suspect it's the
only way he gets through his mail to get anything done.

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.

John Roth
Jul 18 '05 #111
On Wed, 31 Mar 2004 02:31:08 -0800, Michael
<mo*****@mlug.missouri.edu> wrote:
top.
to
bottom
read
to
learn
to
you
forcing
be
would
this
No,


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.
--
Steve Horne

steve at ninereeds dot fsnet dot co dot uk
Jul 18 '05 #112
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.

Didier Morandi said that the greatest reason for posting is so one may
"get help or information". I don't think that's really so, I think
that sould be further generalized to, one posts to communicate. If
one's goal is to communicate (perhaps to communicate a question, but
whatever), why wouldn't one stress clarity to the reader above
convenience to the author?

Top-posting is a mildly offensive presumption viewed in this light,
like telemarketing or squeegee kids.

Mike.
Jul 18 '05 #113
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".

Jul 18 '05 #114

"Michele Simionato" <mi***************@poste.it> wrote in message
news:95**************************@posting.google.c om...
Peter Hickman <pe***@semantico.com> wrote in message

news:<40**********************@news.easynet.co.uk> ...
I have never left a group because of the trolls.
I have never left a group because of the noobies.
I have left a group because of the constant whining about top posting.


Then maybe you should consider leaving c.l.py ?


Peter, while I am careful to quote, snip, and reply in a manner to make
coherent posts, I have been pretty tolerant of what others do. Indeed, I
don't remember ever commenting about top-posting before this week. (While
I may have, it has not been a priority issue for me.)

But when Mr. Hahn top-posted several sentences littered with several
unresolved references to 'this', 'you', 'suggestion', and something
'fragile', I 'rebelled', seeing how stupidly impolite was his implicit
demand that I spend several minutes scanning the previous post below to see
what he was talking about. End of tolerance. So I satirically, not
whiningly, top-posted a set of questions as to what the references referred
to.

If that drives you off c.l.p., so be it ;-) ... but I hope not.

Terry J. Reedy


Jul 18 '05 #115

"Didier Morandi" <no@spam.com> wrote in message
news:c4***********@biggoron.nerim.net...
What against-top-posting people do not WANT to understand is that the very first interest of posting is, to me, to get help or information.

So, you post your question and, by definition, you remember what it was (well, I hope so).


SourceForge adds new comments to tracker items to the top of the comments
section. If you are are the original poster, and get a new report emailed
with every comment, and get and read them in order, then newest at top is,
I admit, helpful. BUT if you look at an old, unresolved, bug report with
several comments, perhaps to see if you can help, then the format is a
major nuisance. Read the original report at the top. Then jump down to
the bottom and back up to the top of the first comment and read down. Then
scan up to find the top of the second comment and read down. and so on.

The solution, to me, are more easily customizable information readers and
managers. Then one could have, for instance, a module specifically for
interacting with the SourceForge database, complete with user-preference
settings. (Does one exist now? that I don't know of?)

Terry J. Reedy


Jul 18 '05 #116
JanC <us*********@janc.invalid> wrote in message news:<Xn******************@213.119.4.35>...
"Mark Hahn" <ma**@prothon.org> schreef:
I really really try to remember to quote from below. If you go through my
posts you will see that I remember most of the time. The last few days I
have been reponding to four or five mailing lists after months of only
coding and my fingers are worn out.


then set your newsreader to reply afterwards instead of before, and if
it does not allow this, then switch to one that does, there are lots
of good free newsreaders that don't default to top posting ( yuk! ) or
that let you tell it to reply fromt he bottom.
Jul 18 '05 #117
Ville Vainio wrote:
>>"Didier" == Didier Morandi <no@spam.com> writes:

Didier> I do not read answers to questions I did not post, so I don't care
Didier> about "unlearn a lifetime of knowledge about narrative flow in
Didier> content".

So essentially Usenet should be a free Q&A automaton, where people
post questions and Usenet fairies go around answering them? Everybody
takes, nobody gives? I believe such service should cost you money...


Well, no. I should have said that I read questions about which I think I either
know the answer or I can share useful experience with the poster of the question.

D.

Jul 18 '05 #118
Mike Pelletier wrote:
.../..
Didier Morandi said that the greatest reason for posting is so one may
"get help or information".


Didier Morandi said that *his advice on* the greatest reason...

D.

Jul 18 '05 #119
>As I'm against capital punishement; twentyfive to life for top-posters,
I say.

+1
--dang
Jul 18 '05 #120
In article <8e**************************@posting.google.com >,
Hung Jung Lu <hu********@yahoo.com> wrote:

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.


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 (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"usenet imitates usenet" --Darkhawk
Jul 18 '05 #121
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:
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.
On Wed, 31 Mar 2004 02:31:08 -0800, Michael
<mo*****@mlug.missouri.edu> wrote:

top.
to
bottom
read
to
learn
to
you
forcing
be
would
this
No,

Jul 18 '05 #122
Amen! Well said, Mr. Baumann.

R Baumann wrote:
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".

Jul 18 '05 #123
has
Joe Mason <jo*@notcharles.ca> wrote in message news:<sl****************@gate.notcharles.ca>...
In article <69**************************@posting.google.com >, has wrote:
# Library pseudocode

_fooRegistry = []

obj _Foo: # prototype object
# Foo's code goes here

def Foo(): # constructor function
newFoo = _Foo.copy()
_fooRegistry.append(newFoo)
return newFoo
Dirt simple with not an ounce of class metaprogramming in sight.


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?


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. :)
Jul 18 '05 #124
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.

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.

Jul 18 '05 #125
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.

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.

Jul 18 '05 #126
On Wed, 31 Mar 2004 15:08:38 -0800, Michael wrote:
Why on Earth would you leap forwards and back through a top post to
find anything?
Why on Earth would to include the quoted material if it's irrelevant to
your post?
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.
That information is already provided in the message headers
(specifically, the "References:" header on Usenet posts, the
"In-Reply-To:" header on emails).
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.


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/>
Jul 18 '05 #127
On Wed, 31 Mar 2004 15:08:38 -0800, Michael
<mo*****@mlug.missouri.edu> wrote:
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.
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.


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.

You only read the quoted text if you're curious to see which
specific message this message was in reply to.


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
Jul 18 '05 #128
In article <69**************************@posting.google.com >, has wrote:
Joe Mason <jo*@notcharles.ca> wrote in message news:<sl****************@gate.notcharles.ca>...
In article <69**************************@posting.google.com >, has wrote:
> # Library pseudocode
>
> _fooRegistry = []
>
> obj _Foo: # prototype object
> # Foo's code goes here
>
> def Foo(): # constructor function
> newFoo = _Foo.copy()
> _fooRegistry.append(newFoo)
> return newFoo
>
>
> Dirt simple with not an ounce of class metaprogramming in sight.


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?


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.


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.append(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.append()"
line for each cloned object?

Joe
Jul 18 '05 #129
Markus Wankus <ma**************************@hotmail.com> writes:
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)


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.
Jul 18 '05 #130
Michael <mo*****@mlug.missouri.edu> writes:
I follow more than 300 mailing lists on a regular basis (I get around
3 gigs of mail a day just from these lists)
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.
and I much prefer people that top-post.
.... yup, if you are really not interested in _understanding_ what is
going on, then top-posting is for you.
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.


They should be tortured without remorse.
Jul 18 '05 #131
"John Roth" <ne********@jhrothjr.com> writes:
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.


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.
Jul 18 '05 #132
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.

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.
... yup, if you are really not interested in _understanding_ what is
going on, then top-posting is for you.

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.

Jul 18 '05 #133
R Baumann wrote:
one follows the "standard" of the newsgroup one is participating in.

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.

Complaining whether one top posts or bottom posts is just a waste of
time, and you, me, we, all know it.

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.

this is more irritating than whether one is "posting in the approved manner".

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.

This thread was renamed to a different subject, but that was a
half-dozen rants later in the thread than it needed to be.

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

Get my point? Naw, too much to expect. I've wasted both your time and my
time with my own rant against your rants. :-)

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. :)

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".

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.
Jul 18 '05 #134
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 <ja**************@cern.ch> wrote:
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

Jul 18 '05 #135
Jacek Generowicz wrote:
Markus Wankus <ma**************************@hotmail.com> writes:

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)

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.


Geez..you can't even joke about this apparently. OK. Whatever. I'm
easy. I *did* get the point BTW...
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.
Yes.
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.


Alright.

--

MAN! There are some passionate individuals here. In fact, a few
minutes after my lighthearted post I received a flood of IP spoofing
attacks on my router (you know who you are). Man! Take it easy, grab a
beer (or whatever tickles your fancy) and chill. Code something - that
usually helps me. Just don't use VB or C++. ;o)

Markus.
Jul 18 '05 #136
In article <sl****************@gate.notcharles.ca>,
Joe Mason <jo*@notcharles.ca> wrote:
In article <69**************************@posting.google.com >, has wrote:
Joe Mason <jo*@notcharles.ca> wrote in message
news:<sl****************@gate.notcharles.ca>...
In article <69**************************@posting.google.com >, has wrote:
> # Library pseudocode
>
> _fooRegistry = []
>
> obj _Foo: # prototype object
> # Foo's code goes here
>
> def Foo(): # constructor function
> newFoo = _Foo.copy()
> _fooRegistry.append(newFoo)
> return newFoo
>
>
> Dirt simple with not an ounce of class metaprogramming in sight.

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?
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.


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.

It can be a bit more subtle than that in a prototype based system, since
there are two things that are different, but have nearly identical
results, but could both be considered "duplicate an object".

In general, you don't want to _duplicate_ the object, but rather use
that object as "prototype" for the new object.

First, you can make a new object that has all the same
slots/properties/attributes as the first object - let's just call that
"clone" for now (and we'll assume single inheritence, via a slot called
"__parent")
print obj.__parent None obj.a = 1
obj.foo = def (): print "a=",self.a obj.foo() a=1 obj1 = obj.clone()
print obj1.__parent None obj.a = 2 # change something in the original object
print obj1.a # unchanged in the "clone" 1 obj1.foo() a=1

and we'll make the second object that has first object as the __parent
(and we'll pretend that the syntax is "new <some expression>"
obj2 = new obj1
print obj2.__parent <obj1> obj2.foo()

a=2 # since it inherits from obj1

(obviously, the object doesn't actually retain the binded local variable
name)

If we looked at these three objects in a debugger:

obj = <Object 0x1> { __parent: None, a: 1, foo: <Method 0x2> }
obj1 = <Object 0x3> { __parent: None, a: 2, foo: <Method 0x2> }
obj2 = <Object 0x4> { __parent: <Object 0x1> }

If we hadn't changed obj1.a, both obj1 and obj2 would behave identically
to obj (they all have the same properties, same behavior), even though
internally, they are fairly different (obj1 is independant of obj, while
obj2 is completely dependant on obj). Since both "data" and "behavior"
is inherited, this is different from traditional class/instance
organization (where an instance shares its behavior (methods) with all
other instances, but has private data). This also makes the issue of
"obj2.a = 5" important, since at that point obj2 would normally get it's
own value of "a" (and otherwise would inherit the value of obj.a), and
you'd want a clean way to alter obj.a from a method in obj2
("obj2.__parent.a = 3" would work, this is where directed resends are
used in Self).

In general, you want obj2 (since it inherits everything from obj, much
like an instance "inherits" stuff from its superclass), but both are
useful.
Jul 18 '05 #137
In article <ga****************************@news.mpls.visi.com >, Glenn Andreas wrote:
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.
It can be a bit more subtle than that in a prototype based system, since
there are two things that are different, but have nearly identical
results, but could both be considered "duplicate an object".

In general, you don't want to _duplicate_ the object, but rather use
that object as "prototype" for the new object.

First, you can make a new object that has all the same
slots/properties/attributes as the first object - let's just call that
"clone" for now (and we'll assume single inheritence, via a slot called
"__parent")


<snip example>
and we'll make the second object that has first object as the __parent
(and we'll pretend that the syntax is "new <some expression>"


<snip other example>

This is certainly how Self does it. Other prototype based languages
(such as Io) do not make this distinction. In Io, you use "clone" to
make a new object whose parent is the object it was cloned from, and
that's it.

Joe
Jul 18 '05 #138
Roy Smith <ro*@panix.com> wrote:
Jacek Generowicz <ja**************@cern.ch> wrote:
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


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?


Bitter, hard-earned experience. Some people do so, as you demonstrated,
but IMB,H-EE the vast majority do not.

Another problem that occurs when some people top-post and some do not is
that the conversation thread quickly becomes unreadable unless someone
takes the time to rearrange it into a consistent form (as I did in
composing this reply).

--
Robin Munn
rm***@pobox.com
Jul 18 '05 #139
In article <25**************************@posting.google.com >,
Magnus Lyck? <ma****@thinkware.se> wrote:
Michael <mo*****@mlug.missouri.edu> wrote in message news:<40**************@mlug.missouri.edu>...

They're planning to remove tab indention support in 3.0? I for one would
be pissed off at such a change.


I don't think you need to worry. AFAIK Python 3 is the mythological
if-I-could-turn-back-the-clock-and-undo-all-my-mistakes version
of Python, which Guido probably won't have time to work with
until his son is big enough to help him. (He'll be 3 in November.)
It will have little regard for backward compatibility, and if it
does appear sooner than expected, you can expect Python 2.x to be
maintaned in parallel for a long time.


Not quite. Python 3000 is the mythical version; Python 3.0 is expected
to appear some day. While there will be many changes that are not
backward compatible, your "little regard" is unlikely to be true: Guido
*likes* Python.
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"usenet imitates usenet" --Darkhawk
Jul 18 '05 #140
Robin Munn wrote:
Another problem that occurs when some people top-post and some do not
is that the conversation thread quickly becomes unreadable unless
someone takes the time to rearrange it into a consistent form (as I
did in composing this reply).


And more often than not, that's perceived as really not worth the
effort. So, a lot of people that might have provided useful answers,
doesn't care to reply to top-postings because it involves too much work
to rearrange the text to respond in a sensible way.

Top-posting *is* shitting in your pants.

regards,
--
Leif Biberg Kristensen
http://solumslekt.org/
Validare necesse est
Jul 18 '05 #141
Markus Wankus <ma**************************@hotmail.com> writes:
Geez..you can't even joke about this apparently. OK. Whatever. I'm
easy. I *did* get the point BTW...


Cool. Sorry ... I've been away for a few days ... and having to wade
through a lot of top-posted crap on my return has made my tolerance
of TPing come close to an all-time low ... which is accompanied by a
sense of humour failure.

I'm off to sit in a sensory deprivation tank for a few hours.
Jul 18 '05 #142
Roy Smith <ro*@panix.com> writes:
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?


Over a decade of observation of usenet and mailing lists.
Jul 18 '05 #143
Jacek Generowicz wrote:
Markus Wankus <ma**************************@hotmail.com> writes:

Geez..you can't even joke about this apparently. OK. Whatever. I'm
easy. I *did* get the point BTW...

Cool. Sorry ... I've been away for a few days ... and having to wade
through a lot of top-posted crap on my return has made my tolerance
of TPing come close to an all-time low ... which is accompanied by a
sense of humour failure.

I'm off to sit in a sensory deprivation tank for a few hours.


Well - I guess I was being a bit of a dolt too...sorry. ;o)

Let's all sit in our sensory deprivation tanks! That sounds like fun!
Who here can construct metaclasses in the dark, in their head?

Markus.
Jul 18 '05 #144
Markus Wankus <ma**************************@hotmail.com> writes:
Let's all sit in our sensory deprivation tanks! That sounds like fun!
Who here can construct metaclasses in the dark, in their head?


No problem. That's easy. It's typing them into an editor after I get
out where it always goes wrong :-)
Jul 18 '05 #145
On Mon, 29 Mar 2004 08:05:44 -0500, rumours say that "John Roth"
<ne********@jhrothjr.com> might have written:

[tabs vs spaces]
Reading the source for Idle is quite
enlightening: there is a comment about Tk doing something
rather absurd if you change the tab default.


Which comment, I believe, is quite old, and possibly refers to an old
glitch of Tk (ICBW of course).

I like tabs, although out of courtesy to the general consensus in the
python world, I filter any code I make available to the public,
replacing tabs with 4 spaces (at least I try to remember that :).

However, I have a little patch for EditorWindow.py which I apply in
every python installation I am going to use, inserting a
self.set_tabwidth(3) (which translates to a most pleasant width of 3 ens
for the font I use, which is proportional) somewhere in the __init__ of
the EditorWindow class. I don't have any bad consequences (or they went
unnoticed).

I don't preach to use tabs over spaces. I just believe in personal
freedom, as long as I respect commonly accepted rules.
--
TZOTZIOY, I speak England very best,
Ils sont fous ces Redmontains! --Harddix
Jul 18 '05 #146

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Hahn | last post by:
I would like to announce a new interpreted object-oriented language very closely based on Python, that is Prototype-based, like Self (http://research.sun.com/research/self/language.html) instead of...
0
by: Mark Hahn | last post by:
Ben Collins and I have developed a new interpreted object-oriented language very closely based on Python, that is Prototype-based, like Self (http://research.sun.com/research/self/language.html)...
28
by: David MacQuigg | last post by:
I'm concerned that with all the focus on obj$func binding, &closures, and other not-so-pretty details of Prothon, that we are missing what is really good - the simplification of classes. There are...
7
by: Michele Simionato | last post by:
So far, I have not installed Prothon, nor I have experience with Io, Self or other prototype-based languages. Still, from the discussion on the mailing list, I have got the strong impression that...
49
by: Mark Hahn | last post by:
As we are addressing the "warts" in Python to be fixed in Prothon, we have come upon the mutable default parameter problem. For those unfamiliar with the problem, it can be seen in this Prothon...
20
by: Mark Hahn | last post by:
Prothon is pleased to announce another major release of the language, version 0.1.2, build 710 at http://prothon.org. This release adds many new features and demonstrates the level of maturity...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.