I wish someone, who has experience in both Java/PHP/C# and Python
would tell me how mush better/worse is it to program in a language
that misses most of the OO parts!
--Scott David Daniels
Scott....@Acm.Org
Having said that, the dynamic nature of Python lets you experiment
with some more advanced OO concepts that Java doesn't have, like
mixins (like multiple inheritance) and multimethods (dispatching on
parameter types). Then there are metaclasses..
Here's a view from a seasonal programmer :
My day job is mostly doing some networking/security stuffs,
I only do programmings only if I had to (like creating
tools/automation/etc) or if no one in my network team was able/didn't
want to do it :(
Just a couple months back we had an engineering issue and we needed to
create/design a robust broker system that works in a background.
This system would take orders from different systems in a form of XML
and should be able to 'talk' to cluster firewalls (range in hundreds
of firewalls) and should be able to add/remove/check/verify/edit
objects on the individual firewall.
Knowing the complexity of the problem and the time constraint that we
had (my manager gave me 2.5 months to get this thing to work) , I had
no other resolution other than turning my self into python. At first I
was a bit doubtful but I kept moving on esp knowing that running a big
and complex project with perl would be like 'digging my own graveyard'
(especially in terms of modularity & maintenance ).
As it turned out, I enjoyed doing big projects with python especially
with its OOP style : simple & really easy --without having to go into
too much OOP details or bogged down with OOP theory-- it just works !
and it's as easy as if you're running a 'plug & play' module and
playing LEGO. Long story short, I was able to present the whole system
in time and the system is now being used in production for a mission
critical F/W deployment ( I've used pyexpect,XML and Threading to
speed up the process )
The good thing about python is : it 'tastes' like what it was being
advertised (eg: Makes things easy and makes complex problem possible )
and I agree 100% with that. If a seasonal programmer like me find it
easy, then it should be much easier for you.
BTW: Before this project, I've programmed in C/PHP/Perl/Tcl but never
had a chance to really try Python in a full-blown OOP complex project.
HTH
I would describe PHP's "OO schema" as "very strict" (FWIW, I wouldn't
qualify anything PHP as "strict" in any way...)
> As I red through
> Python's tutorial it seams it has nothing of those rules. No statical,
> abstract classes, functions, or variables.
Why so ?
> I wish someone, who has experience in both Java/PHP/C# and Python
> would tell me how mush better/worse is it to program in a language
> that misses most of the OO parts!
Where did you read that these were "most of the OO parts" ? All those
dumb qualifiers are C++/Java's very peculiar (mis)understanding of OO.
All you need to do proper OO are objects (defined by a unique id, a
state and a behaviour) and messages.
As far as I'm concerned, what I don't understand is how one can do OO in
a language that has non-object "objects" (ie: primitive types etc).
Anyway... Python's object model is indeed quite different from what
you've "learned" with Java and PHP, and you'll have to first unlearn
most of what you think you know about OO. OTHO, once you do understand
Python's object model and it's incredible flexibility and power, you
won't want to hear about Java anymore. Not to say Python is the "more
pure" OOPL ever (if that's what you're after, Smalltalk is your friend -
but it's not really used that much nowadays...), it's firstly a very
*practical* language, but still it's OO all the way down (everything -
including functions and classes and modules - is an object), and it
really makes OO easy and usefull.
My 2 cents...
import antigravity