Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-17 Thread Bob Gailer
At 03:04 PM 2/16/2005, Brian van den Broek wrote: Terry Carroll said unto the world upon 2005-02-16 16:18: On Fri, 11 Feb 2005, Bob Gailer wrote: Whenever you find yourself writing an if statement ask whether this would be better handled by subclasses. Whenever you find yourself about to write a gl

Re: [Tutor] Larger program organization

2005-02-16 Thread Kent Johnson
Terry Carroll wrote: On Fri, 11 Feb 2005, Bob Gailer wrote: Whenever you find yourself writing an if statement ask whether this would be better handled by subclasses. Whenever you find yourself about to write a global statement, consider making the variables properties of a class. Bob -- Brian

Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-16 Thread Brian van den Broek
Terry Carroll said unto the world upon 2005-02-16 16:18: On Fri, 11 Feb 2005, Bob Gailer wrote: Whenever you find yourself writing an if statement ask whether this would be better handled by subclasses. Whenever you find yourself about to write a global statement, consider making the variables pro

Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-16 Thread Terry Carroll
On Fri, 11 Feb 2005, Bob Gailer wrote: > Whenever you find yourself writing an if statement ask whether this > would be better handled by subclasses. Whenever you find yourself about > to write a global statement, consider making the variables properties of > a class. Bob -- Brian already asked

RE: [Tutor] Larger program organization

2005-02-13 Thread Ryan Davis
s, Ryan -Original Message- From: Alan Gauld [mailto:[EMAIL PROTECTED] Sent: Saturday, February 12, 2005 3:52 AM To: EJP; Ryan Davis; tutor@python.org Subject: Re: [Tutor] Larger program organization > without trying to make this one of those classic threads of great, > do you f

Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-13 Thread Brian van den Broek
Bob Gailer said unto the world upon 2005-02-13 10:13: At 03:21 PM 2/12/2005, Brian van den Broek wrote: [snip] > I am curious about Bob's "Whenever you find yourself writing > an if statement ask whether this would be better handled by subclasses." Thanks Bob and Alan, It's quite clear now :-) B

Re: ****SPAM(7.4)**** Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-13 Thread Kent Johnson
Bob Gailer wrote: At 03:21 PM 2/12/2005, Brian van den Broek wrote: [snip] > I am curious about Bob's "Whenever you find yourself writing > an if statement ask whether this would be better handled by subclasses." class A: ... class A1(A); def foo(self, ...): statements to process object of

Re: ****SPAM(7.4)**** Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-13 Thread Bob Gailer
At 03:21 PM 2/12/2005, Brian van den Broek wrote: [snip] > I am curious about Bob's "Whenever you find yourself writing > an if statement ask whether this would be better handled by subclasses." I start out writing a class like: class A: def __init__(self, type): self.type = type ... def fo

Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-13 Thread Alan Gauld
> I am curious about Bob's "Whenever you find yourself writing an if > statement ask whether this would be better handled by subclasses." > > Could you explain a bit more? One of the basic purposes of OOP is to eliminate if/switch statements that are conditional on the type of the object being han

Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-12 Thread Brian van den Broek
Bob Gailer said unto the world upon 2005-02-11 15:34: At 10:39 AM 2/11/2005, Ryan Davis wrote: I'm starting to make a code-generation suite in python, customized to the way we ASP.NET at my company, and I'm having some trouble finding a good way to organize all the code. My take on doing that in

Re: [Tutor] Larger program organization

2005-02-12 Thread Kent Johnson
Ryan Davis wrote: I'm starting to make a code-generation suite in python, customized to the way we ASP.NET at my company, and I'm having some trouble finding a good way to organize all the code. I keep writing it, but it feels more and more spaghetti-ish every day. Organize your code into packa

Re: [Tutor] Larger program organization

2005-02-12 Thread EJP
 "Ryan Davis" [EMAIL PROTECTED] wrote My background is mostly C#, so I'm used to the ridiculous rigidity of strongly-typed languages. I have been using python for helper apps for a few months now, so am pretty familiar with the syntax now, but I don't know any of the patterns y

Re: [Tutor] Larger program organization

2005-02-12 Thread Alan Gauld
> without trying to make this one of those classic threads of great, > do you feel you could develop fairly complex applications faster > in Python than in C#/ASP.NET? It's a rhetorical question > (but I'm interested in your answer as a single data point) To be honest it wouldn't make a great

Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-11 Thread Danny Yoo
> >way we ASP.NET at my company, and I'm having some trouble finding a good > >way to organize all the code. > > My take on doing that in Python: > > Organize things into modules. Especially with an eye to potential reuse. > Look at the module index in the docs to see how most of the "standard" >

Re: ****SPAM(11.2)**** [Tutor] Larger program organization

2005-02-11 Thread Bob Gailer
At 10:39 AM 2/11/2005, Ryan Davis wrote: I'm starting to make a code-generation suite in python, customized to the way we ASP.NET at my company, and I'm having some trouble finding a good way to organize all the code.  My take on doing that in Python: Organize things into modules. Especially wit

[Tutor] Larger program organization

2005-02-11 Thread Ryan Davis
I'm starting to make a code-generation suite in python, customized to the way we ASP.NET at my company, and I'm having some trouble finding a good way to organize all the code.  I keep writing it, but it feels more and more spaghetti-ish every day.   I'm going to look at the other stuff i