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: ****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: ****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: ****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