Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Prototype OO
On Mar 23, 12:32 am, "Diez B. Roggisch" <de...@nospam.web.de> wrote:
> John Machin schrieb:
> 
> 
> 
>
> I don't understand the question.
>
> Diez

It presupposes that the reader on first seeing "coworker" has mentally
decomposed it as "cow-ork-er".

Report this thread to moderator Post Follow-up to this message
Old Post
John Machin
03-23-08 12:16 AM


RE: Prototype OO
John Machin wrote:

> On Mar 23, 12:32 am, "Diez B. Roggisch" <de...@nospam.web.de> wrote: 
>=20
> It presupposes that the reader on first seeing "coworker" has mentally
> decomposed it as "cow-ork-er".

As an aside, having lived much of my early life on a hobby farm, I've
often wondered to myself just what cow-orking involves ... ;)

Tim Delaney

Report this thread to moderator Post Follow-up to this message
Old Post
Delaney, Timothy (Tim)
03-26-08 12:28 AM


Re: Prototype OO
On Wed, 26 Mar 2008 06:49:57 +0800, "Delaney, Timothy (Tim)"
<tdelaney@avaya.com> declaimed the following in comp.lang.python:

>
> As an aside, having lived much of my early life on a hobby farm, I've
> often wondered to myself just what cow-orking involves ... ;)
>
Probably millennia too late to ask Saruman... <G>
--
Wulfraed	Dennis Lee Bieber		KD6MOG
wlfraed@ix.netcom.com		wulfraed@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff:		web-asst@bestiaria.com)
HTTP://www.bestiaria.com/

Report this thread to moderator Post Follow-up to this message
Old Post
Dennis Lee Bieber
03-26-08 09:49 AM


Re: Prototype OO
On Mar 25, 11:24=A0pm, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote:
> On Wed, 26 Mar 2008 06:49:57 +0800, "Delaney, Timothy (Tim)"
> <tdela...@avaya.com> declaimed the following in comp.lang.python:
>
>
> 
>
> =A0 =A0 =A0 =A0 Probably millennia too late to ask Saruman... <G>

Solomon?

Report this thread to moderator Post Follow-up to this message
Old Post
castironpi@gmail.com
03-26-08 09:49 AM


Re: Prototype OO
En Wed, 26 Mar 2008 01:27:15 -0300, <castironpi@gmail.com> escribió:
> On Mar 25, 11:24_pm, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote: 
>
> Solomon?

No: http://en.wikipedia.org/wiki/Saruman

--
Gabriel Genellina


Report this thread to moderator Post Follow-up to this message
Old Post
Gabriel Genellina
03-26-08 09:49 AM


Re: Prototype OO
On Wed, 26 Mar 2008 02:03:24 -0300, "Gabriel Genellina"
<gagsl-py2@yahoo.com.ar> declaimed the following in comp.lang.python:

>
> No: http://en.wikipedia.org/wiki/Saruman

In particular the references to the orcs (easily visualized as
having a "k" when transformed to a verb)
--
Wulfraed	Dennis Lee Bieber		KD6MOG
wlfraed@ix.netcom.com		wulfraed@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff:		web-asst@bestiaria.com)
HTTP://www.bestiaria.com/

Report this thread to moderator Post Follow-up to this message
Old Post
Dennis Lee Bieber
03-26-08 09:49 AM


Re: Prototype OO
On Mar 26, 3:14=A0am, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote:
> On Wed, 26 Mar 2008 02:03:24 -0300, "Gabriel Genellina"
> <gagsl-...@yahoo.com.ar> declaimed the following in comp.lang.python:
>
>
> 

Ask him any time over.

Report this thread to moderator Post Follow-up to this message
Old Post
castironpi@gmail.com
03-26-08 09:49 AM


Re: Prototype OO
sam a écrit :
> Bruno Desthuilliers napisa³(a):
> 
>
> I can see that Python and Javascript inheritance model is almost the
> same. Both languages are dynamically typed. And it seems that using
> "classes" in Python makes some things more complicated then it is
> necessary

I have to disagree here.

> (eg functions, methods and lambdas are differen beeing in
> Python concept).

The lambda statement creates an ordinary function object, so no
difference here - and it has nothing to do with classes vs prototypes.
wrt/ functions and methods, what you declare with a def statement within
a class statement is actually a plain function (and FWIW, you can add
dynamically add methods to classes or instances). Python 'methods' are
only thin callable wrappers around the function/class/instance set,
wrappers that are dynamically generated by the function object itself
when it's looked up on a class or instance, thanks to the descriptor
protocol.

>
> 
>
> Probably I'm not alone. Many people who think dymanic types are Rhight
> Thing in programming will also prefer prototype-based programming to
> class-based.

Chapter and verse, please ?

Ok, I repeat (please read more carefully):
"""
Don't be fooled by the term "class" itself - it's meaning is totally
different in a language like Python.
"""

> 
>
> Yes -- I'm new to Python.

So may I suggest you actually *learn* how Python's object model works ?

Report this thread to moderator Post Follow-up to this message
Old Post
Bruno Desthuilliers
03-26-08 01:17 PM


Re: Prototype OO
Diez B. Roggisch napisa³(a):

> no "inheritance model" in Javascript. Or why does each JS-lib provide
> it's own version of an extend-function [1]?

Ok -- thank you!



> The only point you might have is the somwhat unfortunate distinction
> between lambda and function in python - but this is on a syntactical
> level only. Once created, you can use them as you like.


Yes -- everybody searches for a perfect language to his needs...

Report this thread to moderator Post Follow-up to this message
Old Post
sam
03-31-08 11:02 AM


Re: Prototype OO
NNTP-Posting-Host: gbk210.internetdsl.tpnet.pl
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: nemesis.news.neostrada.pl 1206955429 1684 83.12.36.210 (31 Mar 2008
 09:23:49 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Mon, 31 Mar 2008 09:23:49 +0000 (UTC)
User-Agent: IceDove 1.5.0.14pre (X11/20080208)
In-Reply-To: <13u76h8mifniibc@corp.supernews.com>
Bytes: 3500
Xref: number1.nntp.dca.giganews.com comp.lang.python:578135

Steven D'Aprano napisał(a):
 
>
> Please explain why you think that functions are more complicated in
> Python because of the class model.

Sorry for a late reply (I was out of the office).


1. You have different syntax for named and unnamed (lambdas) functions.
Functions and methods are different things in Python even if they have same
syntax. But all these are still a pieces of code that you use repeatedly to 
make
some task.

2. Static function doesn't need to reference "self", and Python forces
programmer to put "self" explicitly. Then you have to do some "tricks" on
function to become static. Python is said "nothing is really private", but
interpreter does some "tricks" to make __id hidden for a class.


Some opinions:

1. In early days you could do OOP in C -- you just used additional parameter
 in
a function. Then C++ appeared to make life easier: "when you write
mystring.toupper(), then toupper function gets hidden argument called "this"
".
Programs are written in a high level object oriented languages now. In these
languages you still use the same syntax mystring.toupper(), but now you don'
t
pass object to a function (as in C), but you act on that object. So in the b
ody
of toupper() you can REFERENCE object "mystring". So why do I have to put th
at
"strange" argument "self"?

This is not only my opinion
(http://apache.ece.arizona.edu/~edat.../Prototypes.htm). Without "se
lf"
you would use same syntax for ordinary functions, methods, and lambdas.


2. Something is private because you can't reference that from outside the sc
ope.
The wrong way is to make object properties private by declaring them private
 or
to do hidden actions (__id). For example all local variables in function are
private, because you can't access them from outside that function. Why desn'
t
this work for objects?

Again this is not only my opinion --
http://www.crockford.com/javascript/private.html.



Report this thread to moderator Post Follow-up to this message
Old Post
sam
03-31-08 11:02 AM


Sponsored Links




Last Thread Next Thread Next
Pages (5): « 1 [2] 3 4 5 »
Search this forum -> 
Post New Thread

Python archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 02:59 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.