preemptive OOP?

MonkeeSage MonkeeSage at gmail.com
Sat Sep 30 18:34:18 EDT 2006


John Salerno wrote:
> LOL. Yeah, I guess so. I kind of expected the answer to be "yes, always
> go with OOP in preparation for future expansion", but I should have
> known that Python programmers would be a little more pragmatic than that. :)

Depends on the design philosophy of a particular programmer. YAGNI and
extreme programming are one approach. But, personally, I take that more
as a suggestion not a rule. For example, I don't *need* startswith:

s = 'Cat in a tree'
f = 'Cat'
if s[0:len(f)] == f:
...

But I'm glad startswith is there because it makes it easier for me to
understand what's going on and to use literals rather than temporary
variables:

if s.startswith('Cat'):
...

Regards,
Jordan




More information about the Python-list mailing list