Re: python without OO

2005-01-27 Thread Joe Francia
Timo Virkkala wrote: This guy has got to be a troll. No other way to understand. -- Timo Virkkala Not a troll, just another case of premature optimization run amok. -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-27 Thread Jeff Shannon
Davor wrote: so you get a nice program with separate data structures and functions that operate on these data structures, with modules as containers for both (again ideally separated). Very simple to do and maintain [...] Replace "modules" with "classes" in the above quote, and you have the very

Re: python without OO

2005-01-27 Thread Dave Benjamin
Davor wrote: Is it possible to write purely procedural code in Python, or the OO constructs in both language and supporting libraries have got so embedded that it's impossible to avoid them? Also, is anyone aware of any scripting language that could be considered as "Python minus OO stuff"? (As you

Re: python without OO

2005-01-27 Thread michele . simionato
> "Perfection is achieved, not when there is nothing more to add, but > when there is nothing left to take away." Thanks, that was it! ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-27 Thread beliavsky
[EMAIL PROTECTED] wrote: > >> There is not much than can be done at the Python level. But I would > >> see with interest a Python spinoff geared towards simplicity. > > >I think this would be useless because advanced concepts exist for > >a reason. A simplified spin-off would aquire advanced conce

Re: python without OO

2005-01-27 Thread Alex Martelli
PA <[EMAIL PROTECTED]> wrote: > Yes. But even with the "best" tool and the "best" intents, projects > still fail. In fact, most IT projects are considered failures: > > http://www.economist.com/business/PrinterFriendly.cfm?Story_ID=3423238 The main thesis of the article you quote (although it a

Re: python without OO

2005-01-27 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > Some complexity is not needed, and I am sure even in Python > something could be dropped. But it is difficult to find what can > be removed. Remember that Saint-Exupery quote? Something > like "a work of art is finished when there is nothing left to remove?" Sa

Re: python without OO

2005-01-27 Thread michele . simionato
Peter Maas: >[EMAIL PROTECTED] schrieb: >> Davor is right: even if >> you do not want to use it, the stuff is *there* and somebody in your >> team will. So definitely there is an audience of programmers that just >> do not have an use for all the sophistication and actually are >> penalized by it.

Re: python without OO

2005-01-27 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: Furthermore, if in Python the algorithm for the reverse function applies to many kinds of objects, it just needs to be coded once, whereas a reverse method would have to provided for each class that uses it (perhaps through inheritance). Indeed, this is why Python not only

Re: python without OO

2005-01-27 Thread Peter Maas
[EMAIL PROTECTED] schrieb: Davor is right: even if you do not want to use it, the stuff is *there* and somebody in your team will. So definitely there is an audience of programmers that just do not have an use for all the sophistication and actually are penalized by it. No, because Python does not

Re: python without OO

2005-01-27 Thread Nick Coghlan
Davor wrote: data structures > and > functions that operate on these data structures Eh? What do you think a class is? Py> data = range(10) Py> list.extend(data, range(5)) Py> list.sort(data) Py> print data [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9] The fact that data.extend(range(5)) and data.s

Re: python without OO

2005-01-27 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: Then why was C++ invented? What you have described can be done in C, Pascal, and Fortran 90, all of which are generally classified as procedural programming languages. As Lutz and Ascher say in "Learning Python", in object-based programming one can pass objects around, use

Re: python without OO

2005-01-27 Thread Peter Maas
Davor schrieb: I browsed docs a bit today, and they also confirm what I have believed - that OO is totally secondary in Python. OO is not secondary in Python. It's secondary for you :) And Python leaves the choice to you. In fact, object/classes/metaclasses are nothing but *dictionaries with iden

Re: python without OO

2005-01-27 Thread Peter Maas
Terry Reedy schrieb: But if the class method syntax were manditory, there would be class and/or class hierarchy bloat due to the unlimited number of possible functions-of-a-float and large number of actual such functions that have been written. You are right. I'm not an OO purist, I just wanted

Re: python without OO

2005-01-27 Thread Timo Virkkala
[EMAIL PROTECTED] wrote: I think the OO way is slightly more obscure. It's obvious what x = reverse(x) does, but it is not clear unless you have the source code whether x.reverse() reverses x or if it returns a reversed list. If x.reverse() does the former, a disadvantage relative to the procedural

Re: python without OO

2005-01-27 Thread Timo Virkkala
Davor wrote: Timo Virkkala wrote: This guy has got to be a troll. No other way to understand. not really - it was not my intention at all - but it seems people get upset whenever this OO stuff is mentioned - and what I did not expect at all at this forum as I believed Python people should not be

Re: python without OO

2005-01-27 Thread michele . simionato
Davor wrote: > Thanks, > > I do not hate OO - I just do not need it for the project size I'm > dealing with - and the project will eventually become open-source and > have additional developers - so I would prefer that we all stick to > "simple procedural" stuff rather than having to deal with a de

Re: python without OO

2005-01-26 Thread Craig Ringer
On Wed, 2005-01-26 at 22:28 -0500, Davor wrote: > I browsed docs a bit today, and they also confirm what I have believed - > that OO is totally secondary in Python. In fact, > object/classes/metaclasses are nothing but *dictionaries with identity* > in python. Love this approach. I was really

Re: python without OO

2005-01-26 Thread Isaac To
> "beliavsky" == beliavsky <[EMAIL PROTECTED]> writes: beliavsky> I think the OO way is slightly more obscure. It's beliavsky> obvious what x = reverse(x) does, but it is not clear beliavsky> unless you have the source code whether x.reverse() beliavsky> reverses x or if it re

Re: python without OO

2005-01-26 Thread John Hunter
> "beliavsky" == beliavsky <[EMAIL PROTECTED]> writes: beliavsky> I think the OO way is slightly more obscure. It's beliavsky> obvious what x = reverse(x) does, but it is not clear beliavsky> unless you have the source code whether x.reverse() You don't need to read the src, you

Re: python without OO

2005-01-26 Thread Casey Hawthorne
"The object-oriented programming paradigm has an undeserved reputation as being complicated; most of the complexity of languages such as C++ and Java has nothing to do with their object orientation but comes instead from the type declarations and the mechanisms to work around them. This is a prime

Re: python without OO

2005-01-26 Thread beliavsky
John Hunter wrote: > > "Davor" == Davor <[EMAIL PROTECTED]> writes: > > Davor> not really - it was not my intention at all - but it seems > Davor> people get upset whenever this OO stuff is mentioned - and > Davor> what I did not expect at all at this forum as I believed > Davo

Re: python without OO

2005-01-26 Thread Davor
I'd like to thank everyone for their replies. The main important lesson I got is: Python does not have that many issues with misuse of OO as compared to Java/C++ because it's *dynamically* typed language and extremely powerful *dictionary* data structure. I browsed docs a bit today, and they a

Re: python without OO

2005-01-26 Thread John Hunter
> "Davor" == Davor <[EMAIL PROTECTED]> writes: Davor> not really - it was not my intention at all - but it seems Davor> people get upset whenever this OO stuff is mentioned - and Davor> what I did not expect at all at this forum as I believed Davor> Python people should not be

Re: python without OO

2005-01-26 Thread Davor
Timo Virkkala wrote: This guy has got to be a troll. No other way to understand. not really - it was not my intention at all - but it seems people get upset whenever this OO stuff is mentioned - and what I did not expect at all at this forum as I believed Python people should not be so OO hardco

Re: python without OO

2005-01-26 Thread Timo Virkkala
This guy has got to be a troll. No other way to understand. -- Timo Virkkala -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-26 Thread beliavsky
Nick Coghlan wrote: > Davor wrote: > > thanks for the link > > > > > >>know what's funny: in the Lua mailing list there is currently a > >>discussion about adding OO to Lua. > > > > > > I guess most of these newer languages have no choice but to support OO > > if they want to attract a larger user

Re: python without OO

2005-01-26 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Frank Bechmann (w) wrote: > know what's funny: in the Lua mailing list there is currently a > discussion about adding OO to Lua. >From my quick glance at the language last year I recall that one can access elements of tables (in Python: dict()) with this syntax: ``tbl.att

Re: python without OO

2005-01-26 Thread Francis Girard
Le mercredi 26 Janvier 2005 21:44, PA a écrit : > On Jan 26, 2005, at 21:35, Francis Girard wrote: > >> Project fails for many reasons but seldomly because one language is > >> "better" or "worst" than another one. > > > > I think you're right. But you have to choose the right tools that fit > > yo

Re: python without OO

2005-01-26 Thread PA
On Jan 26, 2005, at 21:35, Francis Girard wrote: Project fails for many reasons but seldomly because one language is "better" or "worst" than another one. I think you're right. But you have to choose the right tools that fit your needs. But I think that's what you meant anyway. Yes. But even with

Re: python without OO

2005-01-26 Thread Frans Englich
On Wednesday 26 January 2005 18:55, Terry Reedy wrote: > Your Four Steps to Python Object Oriented Programming - vars, lists, dicts, > and finally classes is great. It makes this thread worthwhile. I saved it > and perhaps will use it sometime (with credit to you) to explain same to > others. I

Re: python without OO

2005-01-26 Thread Francis Girard
Le mercredi 26 Janvier 2005 20:47, PA a écrit : > Project fails for many reasons but seldomly because one language is > "better" or "worst" than another one. I think you're right. But you have to choose the right tools that fit your needs. But I think that's what you meant anyway. > > Cheers >

Re: python without OO

2005-01-26 Thread PA
On Jan 26, 2005, at 20:39, Francis Girard wrote: When I think that comapnies pay big money for these kind of monsters after having seen a few ppt slides about it, it makes me shiver. Right... but... since when does an implementation language of any sort save a project from its own doom? Project

Re: python without OO

2005-01-26 Thread Francis Girard
Le mercredi 26 Janvier 2005 02:43, Jeff Shannon a écrit : > In statically typed languages like C++ and Java, inheritance trees are > necessary so that you can appropriately categorize objects by their > type. Since you must explicitly declare what type is to be used > where, you may need fine gra

Re: python without OO

2005-01-26 Thread Terry Reedy
"Peter Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Davor schrieb: >> so initially I was hoping this is all what Python is about, but when I >> started looking into it it has a huge amount of additional (mainly OO) >> stuff which makes it in my view quite bloated now. > >

Re: python without OO

2005-01-26 Thread beliavsky
Peter Maas wrote: > Davor schrieb: > > so initially I was hoping this is all what Python is about, but when I > > started looking into it it has a huge amount of additional (mainly OO) > > stuff which makes it in my view quite bloated now. > > So you think f.write('Hello world') is bloated and fil

Re: python without OO

2005-01-26 Thread Thomas Bartkus
"Davor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On the other hand, this does beggar for a reason to bother with Python at > > all. It seems you could be happy doing BASH scripts for Linux or DOS batch > > files for Windows. Both are "nice&simple" scripting languages free

Re: python without OO

2005-01-26 Thread Peter Maas
Davor schrieb: so initially I was hoping this is all what Python is about, but when I started looking into it it has a huge amount of additional (mainly OO) stuff which makes it in my view quite bloated now. So you think f.write('Hello world') is bloated and file_write(f,'Hello world') is not? T

Re: python without OO

2005-01-26 Thread Neil Benn
Davor wrote: Is it possible to write purely procedural code in Python, or the OO constructs in both language and supporting libraries have got so embedded that it's impossible to avoid them? Also, is anyone aware of any scripting language that could be considered as "Python minus OO stuff"? (As you

Re: python without OO

2005-01-26 Thread Miki Tebeka
Hello Davor, > Also, is anyone aware of any scripting language that could be considered > as "Python minus OO stuff"? Maybe Lisp (http://clisp.cons.org/, http://www.paulgraham.com/onlisp.html) or Scheme (http://www.plt-scheme.org/software/mzscheme/, http://mitpress.mit.edu/sicp/full-text/book/boo

Re: python without OO

2005-01-26 Thread Premshree Pillai
Davor Umm, just curious -- why would you want to not use the OO stuff? Python is like pseudocode (the basic OO, which is mostly common to most OO languages, isn't really complicated). Moreover, using Python without OO would be like, um, eating mango seed without the pulp. :) > > --

Re: python without OO

2005-01-26 Thread Fuzzyman
It's perfectly possible to write good python code without using classes. (and using functions/normal control flow). You will have a problem with terrminology though - in python everything is an object (more or less). Common operations use attributes and methods of standard objects. For example :

Re: python without OO

2005-01-26 Thread Claudio Grondi
I can't resist to point here to the Re: How to input one char at a time from stdin? posting in this newsgroup to demonstrate, what this thread is about. Claudio > >On Tue, 25 Jan 2005 12:38:13 -0700, Brent W. Hughes > ><[EMAIL PROTECTED]> wrote: > >> I'd like to get a character from stdin, perf

Re: python without OO

2005-01-26 Thread Alex Martelli
Davor <[EMAIL PROTECTED]> wrote: > no one ever had to document structured patterns - which definitely > exist - but seem to be obvious enough that there is no need to write a > book about them... You _gotta_ be kidding -- what do you think, e.g., Wirth's "Algorithms plus Data Structures Equals Pr

Re: python without OO

2005-01-25 Thread Nick Coghlan
Davor wrote: thanks for the link know what's funny: in the Lua mailing list there is currently a discussion about adding OO to Lua. I guess most of these newer languages have no choice but to support OO if they want to attract a larger user base :-(... Tell me, have you ever defined a C structure

Re: python without OO

2005-01-25 Thread Terry Reedy
Davor, Before I learned Python, I too was put off by OO hype. And I suppose I still would be if I still listened to it. But Python's class statement is somewhere inbetween a C typedef and C++/Jave classes. Stripped down pretty much to the essentials and only used when really useful, it made m

Re: python without OO

2005-01-25 Thread Davor
thanks for the link > know what's funny: in the Lua mailing list there is currently a > discussion about adding OO to Lua. I guess most of these newer languages have no choice but to support OO if they want to attract a larger user base :-(... davor -- http://mail.python.org/mailman/listinfo/p

Re: python without OO

2005-01-25 Thread Davor
M.E.Farmer, first to clarify few things - I'm neither manager nor professionally involved in code development - I'm just embarking on a small project that I would like to attract some programmers to later on and make it a nice open-source system. Based on my previous experience with few SMALL proj

Re: python without OO

2005-01-25 Thread Frank Bechmann (w)
even if I follow the other answers above - language-wise and management-advise-wise - just for the sake of completeness - I would like to point you to Lua: http://www.lua.org/ 1. portability (interpreter runs quite a bit architectures) => yes, nearly pure ANSI-C should compile 2. good ba

Re: python without OO

2005-01-25 Thread M.E.Farmer
Davor, I was gonna let it go but I never was good at shutin up ;) The greatest strength a manager can have is delegation. And with that add the ability to best use the resources available . It seems you are telling me that : 1) You do not understand most programming concepts 2) You are not wil

Re: python without OO

2005-01-25 Thread Jeff Shannon
Davor wrote: M.E.Farmer wrote: Wrap your head around Python, don't wrap the Python around your head! This is NOT Java, or C++ or C , it IS Python. that's interesting hypothesis that behavior will vary due to the use of different language ... If using a different language doesn't require/encourage

Re: python without OO

2005-01-25 Thread Jeremy Bowers
On Tue, 25 Jan 2005 15:01:23 -0800, Davor wrote: > Thanks, > > I do not hate OO - I just do not need it for the project size I'm > dealing with - and the project will eventually become open-source and > have additional developers - so I would prefer that we all stick to > "simple procedural" stuf

Re: python without OO

2005-01-25 Thread Jeff Shannon
Davor wrote: [...] what I need that Python has and bash&dos don't is: 1. portability (interpreter runs quite a bit architectures) 2. good basic library (already there) 3. modules for structuring the application (objects unnecessary) 4. high-level data structures (dictionaries & lists) 5. no strong

Re: python without OO

2005-01-25 Thread Erik Johnson
"Davor" <[EMAIL PROTECTED]> wrote > I do not hate OO - I just do not need it for the project size I'm > dealing with - and the project will eventually become open-source and > have additional developers... If you think your project is valuable enough to eventually be "Open Source", you can b

Re: python without OO

2005-01-25 Thread richard
Davor wrote: > M.E.Farmer wrote: >> Wrap your head around Python, don't wrap the Python around your head! >> This is NOT Java, or C++ or C , it IS Python. > > that's interesting hypothesis that behavior will vary due to the use of > different language - actually most python scripts that I have se

Re: python without OO

2005-01-25 Thread Davor
M.E.Farmer wrote: Wrap your head around Python, don't wrap the Python around your head! This is NOT Java, or C++ or C , it IS Python. that's interesting hypothesis that behavior will vary due to the use of different language - actually most python scripts that I have seen do not even use OO which

Re: python without OO

2005-01-25 Thread Michael Spencer
Davor wrote: Thanks, I do not hate OO - I just do not need it for the project size I'm dealing with - and the project will eventually become open-source and have additional developers - so I would prefer that we all stick to "simple procedural" stuff rather than having to deal with a developer that

Re: python without OO

2005-01-25 Thread Davor
On the other hand, this does beggar for a reason to bother with Python at all. It seems you could be happy doing BASH scripts for Linux or DOS batch files for Windows. Both are "nice&simple" scripting languages free of object oriented contamination. not really, what I need that Python has and bas

Re: python without OO

2005-01-25 Thread Davor
Thanks, I do not hate OO - I just do not need it for the project size I'm dealing with - and the project will eventually become open-source and have additional developers - so I would prefer that we all stick to "simple procedural" stuff rather than having to deal with a developer that will be con

Re: python without OO

2005-01-25 Thread M.E.Farmer
Wrap your head around Python, don't wrap the Python around your head! This is NOT Java, or C++ or C , it IS Python. Davor wrote: > (note, I am not an experienced developer, nor the > others I'll be working with (even though some think they are:-)) Don't worry we didn't get confused, it was quite cl

Re: python without OO

2005-01-25 Thread Thomas Bartkus
"Davor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is it possible to write purely procedural code in Python, ... Of course! > or the OO > constructs in both language and supporting libraries have got so > embedded that it's impossible to avoid them? You can always *write your o

Re: python without OO

2005-01-25 Thread Jarek Zgoda
Davor wrote: Is it possible to write purely procedural code in Python, or the OO constructs in both language and supporting libraries have got so embedded that it's impossible to avoid them? Sure, but you will got problem with libraries. Some of them are in fact frameworks and need some subclassin

Re: python without OO

2005-01-25 Thread Steven Bethard
Davor wrote: Is it possible to write purely procedural code in Python, or the OO constructs in both language and supporting libraries have got so embedded that it's impossible to avoid them? Hmmm... sorta depends on how you define write procedural code... If you mean, can you write Python code w

python without OO

2005-01-25 Thread Davor
Is it possible to write purely procedural code in Python, or the OO constructs in both language and supporting libraries have got so embedded that it's impossible to avoid them? Also, is anyone aware of any scripting language that could be considered as "Python minus OO stuff"? (As you can see I'm