Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Is classless worth consideration

Reply
Thread Tools

Is classless worth consideration

 
 
David MacQuigg
Guest
Posts: n/a
 
      04-29-2004
On Wed, 28 Apr 2004 18:40:07 -0700, Erik Max Francis <>
wrote:

>David MacQuigg wrote:
>
>> The problem we Python programmers are having is understanding the
>> fundamental advantage of eliminating classes and working only with
>> instances. The theoretical discussions put me to sleep. I can't see
>> the point of the examples above. What we need is a simple use case.

>
>I certainly don't see the point in having a prototype-based system if
>the declaration for defining a prototype (`proto' in your examples)
>looks very much like the way you build a class. All that seems to
>accomplish is a semantic change of "class" to "proto," which doesn't
>gain anything.
>
>Compare that to, say, Io -- a prototype-based system -- where there is
>no syntax at all for defining a "class" or "prototype." You simply
>clone and attach messages as you go.


I'm not familiar with Io. The syntax I am proposing will allow
cloning instances and attaching attributes as you go. What do
"messages" provide that are lacking in normal attributes?

-- Dave

 
Reply With Quote
 
 
 
 
has
Guest
Posts: n/a
 
      04-29-2004
Peter Hansen <> wrote in message news:<MbWdnTRxROYvZg3dRVn->...
> has wrote:
>
> > Well, as far as Python itself is concerned, it'd go a long way in
> > eliminating the hideously baroque and increasingly brittle OO model it

>
> I find it especially hard to find the enthusiasm to read past
> the highly inflammatory phrase "hideously baroque". I had to
> do a double-take just to confirm that the poster is indeed
> talking about Python.


Compared to C++, I expect it's a real breath of fresh air. But
compared to how something like Self does OO, it is indeed hideously
baroque.


> If you think it's baroque**, say so. Adding "hideous" just tells us
> you are already highly biased against Python and poisons anything
> else you were about to say...


Oh, puh-leez. Now I'll not take you to task for such a dopey comment
this time around 'cos I'm not a regular here and I'm a right bugger to
Google for by my initials, so it's hard to figure out exactly who I
am. But let me remedy this by providing my web address so you can go
check my credentials:

http://freespace.virgin.net/hamish.sanderson/

If you still want to accuse me of such childish nonsense afterwards,
bring barbeque sauce.


> ** Please double-check the definition of "baroque" that you are
> using as well.


"Feature-encrusted; complex; gaudy; verging on excessive."


> Terms more like "elegant" and "simple" have come to mind, however,
> which is quite at odds with your perception. Strange, that.


Yes it is. However, I got my observation skills from several years'
art school training, so I don't think the fault lies there. I may not
have the formal CS training and deep programming knowledge and
experience that many folks here have, but neither am I burdened by the
religous and political baggage that all too often seems to accompany
it.

Oh, and another skill I've learn is saying exactly what I think, and
being none too shy about how I say it. Just so you know.
 
Reply With Quote
 
 
 
 
has
Guest
Posts: n/a
 
      04-29-2004
(A. Lloyd Flanagan) wrote in message news:<. com>...

> > Well, as far as Python itself is concerned, it'd go a long way in
> > eliminating the hideously baroque and increasingly brittle OO model it
> > currently has.

>
> I wouldn't call it "hideously baroque", myself. Yes, there are some
> details that need to be cleaned up (and when do we get a target date
> for Python 3?). On the other hand, for most programming most of the
> time, it's pretty straightforward.
>
> Of course, I'm a C++ expert, so my standard of what qualifies as
> "baroque" is probably pretty high.




> None of which means I don't think your approach isn't interesting and
> worth pursuing. I look forward to seeing how it goes.


Prothon isn't my baby but Mark Hahn's - see <www.prothon.org>. (FWIW,
I also consider Prothon's OO programming model unnecessarily complex
in its current state, but it's still early days so who knows.) As for
seeing any language projects of my own, well I do have an idea of two
I'm just getting started on. But I'd not hold my breath if I were you,
as I'm a rather slow worker.
 
Reply With Quote
 
Peter Hansen
Guest
Posts: n/a
 
      04-30-2004
has wrote:

> Peter Hansen <> wrote in message news:<MbWdnTRxROYvZg3dRVn->...
>
>>has wrote:
>>>Well, as far as Python itself is concerned, it'd go a long way in
>>>eliminating the hideously baroque and increasingly brittle OO model it

>>
>>I find it especially hard to find the enthusiasm to read past
>>the highly inflammatory phrase "hideously baroque". I had to
>>do a double-take just to confirm that the poster is indeed
>>talking about Python.

>
> Compared to C++, I expect it's a real breath of fresh air. But
> compared to how something like Self does OO, it is indeed hideously
> baroque.


Oh, now you're qualifying the statement. In comparison to
something less baroque, it's baroque. Fair enough...

But at least you say what you think. That counts for
something.

-Peter

P.S. You've got an art background, I've got an engineering
background, neither of us has a CS background. Maybe that
ought to tell us how well we're likely to communicate about
software and we can just stop here.
 
Reply With Quote
 
Hung Jung Lu
Guest
Posts: n/a
 
      04-30-2004
Peter Hansen <> wrote in message news:<boydnb9qfrqWJQzdRVn->...
> has wrote:
> > Compared to C++, I expect it's a real breath of fresh air. But
> > compared to how something like Self does OO, it is indeed hideously
> > baroque.

>
> Oh, now you're qualifying the statement. In comparison to
> something less baroque, it's baroque. Fair enough...


Good that things cleared up. I have also pointed out previously that
Python uses 5 devices where prototype-based needs only one: (a) class,
(b) instance, (c) module, (d) metaclass, (e) scope. If this is not
hideously baroque, then, Houston, we've got a problem. If you can
really think outside the box, you'd pitch in also: (f) aspect.

regards,

Hung Jung
 
Reply With Quote
 
Peter Hansen
Guest
Posts: n/a
 
      04-30-2004
Hung Jung Lu wrote:

> I have also pointed out previously that
> Python uses 5 devices where prototype-based needs only one: (a) class,
> (b) instance, (c) module, (d) metaclass, (e) scope. If this is not
> hideously baroque, then, Houston, we've got a problem. If you can
> really think outside the box, you'd pitch in also: (f) aspect.


Well, (c) module is merely a packaging technique, not anything
to do specifically with OOP, so it shouldn't appear in a list
of "what do you think makes Python's OO model hideously baroque".

As for class and instance, unless all other languages that
have class and instance are also considered baroque, it
hardly seems fair to separate them.

Scope doesn't quite seem to fit in this either, but not
being a theoretician I'll just leave the discussion at
this point and point out that for the purposes of a *large*
majority of the people using Python, these issues do not
arise and Python OO is very much a breath of fresh air
compared to anything else they've used. Which still makes
it hard for me to see a claim of "hideous baroqueness" as
anything other than deliberately inflammatory, but wrong.

-Peter
 
Reply With Quote
 
has
Guest
Posts: n/a
 
      04-30-2004
Peter Hansen <> wrote in message news:<boydnb9qfrqWJQzdRVn->...

> > Compared to C++, I expect it's a real breath of fresh air. But
> > compared to how something like Self does OO, it is indeed hideously
> > baroque.

>
> Oh, now you're qualifying the statement. In comparison to
> something less baroque, it's baroque. Fair enough...


Merely posting you some meaningful reference points, as I take it by
your adjectives you're more from the C++ end of the spectrum.


> But at least you say what you think. That counts for
> something.
>
> -Peter
>
> P.S. You've got an art background, I've got an engineering
> background, neither of us has a CS background. Maybe that
> ought to tell us how well we're likely to communicate about
> software and we can just stop here.


The day that scientists, engineers, programmers and artists start
talking to one another, instead of constructing vast impenetrable
fortresses to hide behind, is one I _greatly_ look forward to. Where
such rampant self-serving cliquery and deeply reactionary
conservativism sprung from I don't know, but I do wish it'd hurry up
and bog off again. Poor Leonardo must be spinning in his grave.
 
Reply With Quote
 
Donn Cave
Guest
Posts: n/a
 
      04-30-2004
In article < >,
(Hung Jung Lu) wrote:
> Peter Hansen <> wrote in message
> news:<boydnb9qfrqWJQzdRVn->...
> > has wrote:
> > > Compared to C++, I expect it's a real breath of fresh air. But
> > > compared to how something like Self does OO, it is indeed hideously
> > > baroque.

> >
> > Oh, now you're qualifying the statement. In comparison to
> > something less baroque, it's baroque. Fair enough...

>
> Good that things cleared up. I have also pointed out previously that
> Python uses 5 devices where prototype-based needs only one: (a) class,
> (b) instance, (c) module, (d) metaclass, (e) scope. If this is not
> hideously baroque, then, Houston, we've got a problem. If you can
> really think outside the box, you'd pitch in also: (f) aspect.


As much as I love simplicity, it seems to me you may be
stretching it here. I would have to agree with Peter Hansen
that it isn't clear that scope and module would benefit
from collapse into a single concept along with the rest.

For that matter it isn't clear that instance and class
would benefit, but when we get to metaclasses it's harder
to disagree with you. I think I recall that you have been
arguing that class and instance naturally give rise to
metaclass, and that would be a strong argument.

If it's true - if you really can't write effective,
maintainable programs in Python without metaclass. To
me that seems like an absurd proposition, though, if only
because I'd have no idea how to use metaclass nor why I
would want to do so. When the idea showed up a few years
back, everyone chuckled about the `then my head exploded'
experience of wrestling with metaclasses, and I have been
assuming that it was a sort of sport accessory for people
who need a little of that kind of thing now and then. You
don't think so, it's a basic necessity, programs written
with just class and instance are liable to be ineffective
or unmaintainable or something?

Donn Cave,
 
Reply With Quote
 
Hung Jung Lu
Guest
Posts: n/a
 
      04-30-2004
Peter Hansen <> wrote in message news:<84Kdnfu3OoN4oA_dRVn->...
> Hung Jung Lu wrote:
> > I have also pointed out previously that
> > Python uses 5 devices where prototype-based needs only one: (a) class,
> > (b) instance, (c) module, (d) metaclass, (e) scope. If this is not
> > hideously baroque, then, Houston, we've got a problem. If you can
> > really think outside the box, you'd pitch in also: (f) aspect.

>
> Well, (c) module is merely a packaging technique, not anything
> to do specifically with OOP, so it shouldn't appear in a list
> of "what do you think makes Python's OO model hideously baroque".


Are you sure about that? Have you seen how people put an class
instance in sys.modules so they could use it as a module (an old trick
by now)? Have you seen people asking __call__() to make modules
callable, and/or property getters/setters for modules? "Merely a
packaging technique"? Have you seen people using modules as
singletons? Do you realize that "from ... import ..." is nothing but a
form of module inheritance? Think again. Let me say it again: think
outside the box. It's hard to do when you are inside the box. But try.
Try hard.

> Scope doesn't quite seem to fit in this either, but not
> being a theoretician I'll just leave the discussion at
> this point


I am sorry, there is no theory to do here. Check out the Io language.

Code factorization is carried out not when two pieces of code are
identical, but when they are analogous enough. By tearing things apart
and claiming that they are different and should not be unified, it
only goes to show you are still inside a box. All the 6 devices I have
pointed out can be reduced to one single device: object. Matter of
fact, many of them are already unified in a prototype-based language
like Io, no theory there. Why have 6 devices and all kinds of
redundancies/inconsistencies/hacks, when you can do it all with just
one? As the other poster said: "hideously baroque" it is.

regards,

Hung Jung
 
Reply With Quote
 
Donn Cave
Guest
Posts: n/a
 
      04-30-2004
In a similar vein, I have noticed that clothing often comes
with pockets, yet this essentially duplicates the functionality
of shoes, which are also items of clothing that one puts things
in.

We can certainly reduce the Baroque complexity of our lifestyle
if we can eliminate this gratuitous superfluity and rather than
pockets, simply append shoes to our clothes where needed to
store a few essentials. Why, you could store soup, all kinds
of stuff in a shoe that you'd hesitate to put in a pocket.
Think outside the box!

Donn Cave,
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"no ip classless" and "ip cef" Paweł Damian Cisco 8 05-25-2009 03:29 PM
IP CLASSLESS not working Max Cisco 13 05-09-2008 09:03 AM
ip classless and auto-summary jh3ang Cisco 3 08-05-2006 03:10 PM
Question about Redistributing Between Classful and Classless Protocols ws00sw@gmail.com Cisco 0 06-28-2005 12:51 PM
[Classless] Just to be sure... Yermat Python 0 04-30-2004 02:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57