Re: [Tutor] designing POOP

2008-04-12 Thread bhaaluu
On Sat, Feb 9, 2008 at 9:46 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > As I mentioned in an earlier mail it tends to oscillate in practice. > You start off looking at the problem to identify the basic classes. > Then you pick one or two and start designing those in detail and > that identifi

Re: [Tutor] designing POOP

2008-02-21 Thread bhaaluu
On Wed, Feb 20, 2008 at 7:53 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > "Michael Langford" <[EMAIL PROTECTED]> wrote > > > I'm firmly with Kent here: OO programming is not about simulation. > > Wooah! > I'm partly on board here and do agree the noun/verb thing is > a gross simplification. But

Re: [Tutor] designing POOP

2008-02-20 Thread Alan Gauld
"Michael Langford" <[EMAIL PROTECTED]> wrote > I'm firmly with Kent here: OO programming is not about simulation. Wooah! I'm partly on board here and do agree the noun/verb thing is a gross simplification. But it does work and is how probably the majority of OOP programmers started out - in the 8

Re: [Tutor] designing POOP

2008-02-15 Thread Michael Langford
I'm firmly with Kent here: OO programming is not about simulation. You are not modeling real world items. You are making code easier to maintain and making parts of code that have to do with one another be near one another. If you spend all your time trying to make your objects into real world thi

Re: [Tutor] designing POOP

2008-02-15 Thread Kent Johnson
Tiger12506 wrote: > I like things to be explicit, and don't care for the level of > abstraction common in MVC. I know it seems naive, but I like to be able to > model object designs after tangible things, and to me, a View does not know > how to keep a state or execute methods because it does n

Re: [Tutor] designing POOP

2008-02-15 Thread Alan Gauld
"Tiger12506" <[EMAIL PROTECTED]> wrote > up. I like things to be explicit, and don't care for the level of > abstraction common in MVC. I know it seems naive, but I like to be > able to > model object designs after tangible things, and to me, a View does > not know > how to keep a state or execu

Re: [Tutor] designing POOP

2008-02-14 Thread Tiger12506
> Now I'm curious. > > MVC is one of the oldest, best established and well proven design > patterns going. It first appeared in Smalltalk in the late 1970's and > has been copied in almost every GUI and Web framework ever since. > I've used it on virtually(*) every GUI I've ever built(**) to the >

Re: [Tutor] designing POOP

2008-02-14 Thread Alan Gauld
"Tiger12506" <[EMAIL PROTECTED]> wrote > Ah yes... I don't like the Model-View-Controller architecture. That > the > major reason why I dislike most information available on C++. This > is a > personal issue though. The Model-View-Controller is a very common > thing, and > everyone but me would

Re: [Tutor] designing POOP

2008-02-14 Thread Tiger12506
> Hmm. Not to me. The second version couples the game state with the > display. I would rather have True... > This is an example of Model-View-Controller architecture (google it). > Notice that the Game and Display are now reusable (maybe there are both > GUI and text interfaces to the game, f

Re: [Tutor] designing POOP

2008-02-13 Thread Kent Johnson
Tiger12506 wrote: > vg = VideoGame() > howmany = rand.randint(0,100) > for i in range(howmany): > vg.buttonpush() > print vg.score#Tear open the case (hope you have a screwdriver) > > OR > > class VideoGame(): > def __init__(self): > self.score = 0 > def updatedisp(): > pr

Re: [Tutor] designing POOP

2008-02-13 Thread Kent Johnson
Alan Gauld wrote: > This is fine and dandy but what if we want to find out the > current value of a.value without calling inc? > Thats where hetter/setter/direct access comes into the > picture. > In Java and some other languages the idiomatic thing > to do is provide methods prefixed with get/s

Re: [Tutor] designing POOP

2008-02-12 Thread Ricardo Aráoz
To further document some points. This comes from PEP 8 (http://www.python.org/dev/peps/pep-0008/) For those who need "authority" : Author: Guido van Rossum , Barry Warsaw """ With this in mind, here are the Pythonic guidelines: - Public attributes should have no leading underscores.

Re: [Tutor] designing POOP

2008-02-12 Thread Ricardo Aráoz
Tiger12506 wrote: >>> This is all fine and dandy, but the video game is pretty worthless unless >>> it >>> can show us what the score is. There are two ways to go about this. A) >>> Give >>> the video game a display which it updates, or B) Tear open the case of >>> the >>> video game and look at

Re: [Tutor] designing POOP

2008-02-12 Thread Tiger12506
>> This is all fine and dandy, but the video game is pretty worthless unless >> it >> can show us what the score is. There are two ways to go about this. A) >> Give >> the video game a display which it updates, or B) Tear open the case of >> the >> video game and look at the actual gears that in

Re: [Tutor] designing POOP

2008-02-12 Thread bhaaluu
On Feb 12, 2008 7:19 AM, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > > Did we think about REUSABILITY? What if in some other application I want > to USE the score, not just display it? What if I want to display it in a > different form (multiplying it by 100)? Then you are back to our > original opt

Re: [Tutor] designing POOP

2008-02-12 Thread Ricardo Aráoz
Tiger12506 wrote: > This is all fine and dandy, but the video game is pretty worthless unless it > can show us what the score is. There are two ways to go about this. A) Give > the video game a display which it updates, or B) Tear open the case of the > video game and look at the actual gears t

Re: [Tutor] designing POOP

2008-02-12 Thread Ricardo Aráoz
Tiger12506 wrote: > This is all fine and dandy, but the video game is pretty worthless unless it > can show us what the score is. There are two ways to go about this. A) Give > the video game a display which it updates, or B) Tear open the case of the > video game and look at the actual gears t

Re: [Tutor] designing POOP

2008-02-12 Thread Alan Gauld
"Tiger12506" <[EMAIL PROTECTED]> wrote > Well, I don't know if this whole email was of use, but it makes the > crux of > the argument make sense to me. I thought it was pretty clear. And it highlights that the choices are like anything else in the world of engineering - a compromise. And the be

Re: [Tutor] designing POOP

2008-02-11 Thread Tiger12506
> "bhaaluu" <[EMAIL PROTECTED]> wrote > >> States, getters-setters, direct access... >> I'm still in toilet-training here/ 8^D >> Can you provide some simple examples that >> illustrate exactly what and why there is any >> contention at all? One clear example I can think of that shows the view

Re: [Tutor] designing POOP

2008-02-11 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote > States, getters-setters, direct access... > I'm still in toilet-training here/ 8^D > Can you provide some simple examples that > illustrate exactly what and why there is any > contention at all? I'll try. State is just a bit of jargon to describe the com

Re: [Tutor] designing POOP

2008-02-11 Thread bhaaluu
On Feb 11, 2008 3:49 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > I think we are in general agreement, albeit with different levels of > trust/toleration of the technique. Direct access is preferred to > getter/setter methods but is in turn less desirable that higher > level methods where they exi

Re: [Tutor] designing POOP

2008-02-11 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote >> The secondary reason is that a class author should be free >> to change the internal data of a class provided he doesn't change >> the message interface, but allowing direct access greatly increases >> the risk that a change will break some users code. P

Re: [Tutor] designing POOP

2008-02-10 Thread Kent Johnson
Alan Gauld wrote: > Over-use of direct access tends, in my experience, to lead to > the temptation to move code that should be in the class (or a > subclass) into client code. And it is avoidance of that temptation > that is my main reason for providing a values() or state() type > method, rather

Re: [Tutor] designing POOP

2008-02-10 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote > Alan doesn't like direct attribute access *or* getters and setters, > IIUC. He wants all access to the attributes of a class instance to > be > through higher-level methods. I'd moderate that slightly. I really, really, don't like getters/setters. So, i

Re: [Tutor] designing POOP

2008-02-10 Thread Kent Johnson
Dave Kuhlman wrote: > Here is something relevant to this argument, although I'm not sure > that I agree with it: > > "Getters and setters are evil. Evil, evil, I say! Python objects > are not Java beans. Do not write getters and setters. This is > what the 'property' built-in is for.

Re: [Tutor] designing POOP

2008-02-10 Thread Dave Kuhlman
On Sat, Feb 09, 2008 at 08:42:04PM -0500, Kent Johnson wrote: > Alan Gauld wrote: > > >> def values(self): > >> return (self.name, self.wealth, self.strenth) > >> > >> Or get rid of values() entirely and just refer to the attributes > > > > Nope, I don't like that as much since it encourage

Re: [Tutor] designing POOP

2008-02-09 Thread Kent Johnson
Alan Gauld wrote: >> def values(self): >> return (self.name, self.wealth, self.strenth) >> >> Or get rid of values() entirely and just refer to the attributes > > Nope, I don't like that as much since it encourages direct > access. Maybe we just need to agree to disagree here. I don't see

Re: [Tutor] designing POOP

2008-02-09 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote >> e = Explorer() >> >> e.describe(withText=True) # gets the long version >> >> or >> >> print """ >> You are an explorer whose name is %s, >> You have wealth of %s and strength of %s >> """ % e.describe() # uses tuple result > > Um, yuck. A functio

Re: [Tutor] designing POOP

2008-02-09 Thread Kent Johnson
Alan Gauld wrote: > class Explorer(object): > fmtStr = """ > My name is %s > and I have wealth of $%s and > strength of %s""" > > # other code here > > def describe(withText=False) > values = (self.name, self.wealth, self.strenth) > if not withText: >

Re: [Tutor] designing POOP

2008-02-09 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote > When you're designing a program, how do you go about dealing > with text descriptions, like the descriptions for a room? Here is an > example of a room description: > > THIS IS THE AUDIENCE CHAMBER > THERE IS A WINDOW TO THE WEST. BY LOOKING TO THE RIGHT > THR

Re: [Tutor] designing POOP

2008-02-09 Thread Alan Gauld
> ..., I'd like to have the finished program > be identical to the procedural program as far as I/O goes. You could do it but it would be easier to change it a little because the original games prompts etc betray its internal structure. You can just get the objects to return their attributes an

Re: [Tutor] designing POOP

2008-02-09 Thread Kent Johnson
bhaaluu wrote: > When you're designing a program, how do you go about dealing > with text descriptions, like the descriptions for a room? Here is an > example of a room description: > > THIS IS THE AUDIENCE CHAMBER > THERE IS A WINDOW TO THE WEST. BY LOOKING TO THE RIGHT > THROUGH IT YOU CAN SEE

Re: [Tutor] designing POOP

2008-02-09 Thread bhaaluu
On Feb 9, 2008 8:46 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > "bhaaluu" <[EMAIL PROTECTED]> wrote > Some more thoughts on designing here. You said I can use the procedural program as a program "requirement" because it defines I/O. Even though the OOP program will have the data and functions in

Re: [Tutor] designing POOP

2008-02-09 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote > the second chapter deals with a Blackjack game. One thing I noticed > (and remember, this is a Noob's viewpoint): The classes seemed to be > designed from small to large, rather than from large to small. As I mentioned in an earlier mail it tends to oscillate

Re: [Tutor] designing POOP

2008-02-09 Thread bhaaluu
On Feb 9, 2008 4:09 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "Tiger12506" <[EMAIL PROTECTED]> wrote > > > Are some simple examples off the top of my head. It's not difficult > > to model > > real-life things with classes, but ... > > This is a good point, it is excellent practice for thinking

Re: [Tutor] designing POOP

2008-02-09 Thread Alan Gauld
"Tiger12506" <[EMAIL PROTECTED]> wrote > Are some simple examples off the top of my head. It's not difficult > to model > real-life things with classes, but ... This is a good point, it is excellent practice for thinking about the responsibilities of objects > ...it is much more difficult to m

Re: [Tutor] designing POOP

2008-02-08 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote There have been lots of comments about this already but I'm deliberately jumping in at this level because I want to pick up a few general points... > class Explorer(object): >"""player""" >def __init__(self,name): >"""initilaization method""" >

Re: [Tutor] designing POOP

2008-02-08 Thread Tiger12506
> There is nothing like growing a program to the point where you don't > know how it works or how to change it to make you appreciate good design Amen. I was recently fighting with an example of a multi-client, simple server that I wanted to translate into assembly. Not only was the code unreada

Re: [Tutor] designing POOP

2008-02-08 Thread Tiger12506
> This is something that one can only gain from experience? > I really had to struggle to get the Light class to work at all. > I have no idea how many times I started over. But I do feel > that I am starting to learn some of this stuff. This surprises me... I guess it does take experience. What i

Re: [Tutor] designing POOP

2008-02-08 Thread Kent Johnson
bhaaluu wrote: > On Feb 8, 2008 4:46 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: >> "Refactoring is the process of changing a software system in such a way >> that it does not alter the external behavior of the code yet improves >> its internal structure." -- Martin Fowler in Refactoring > This is

Re: [Tutor] designing POOP

2008-02-08 Thread bhaaluu
On Feb 8, 2008 4:46 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > bhaaluu wrote: > > > It also cleaned up main(), and put everything in well defined packages > > at the top of the program. > > Yes, good OOD puts things into cohesive, comprehensible packages. > > > I can see do difference in "game p

Re: [Tutor] designing POOP

2008-02-08 Thread Kent Johnson
bhaaluu wrote: > It also cleaned up main(), and put everything in well defined packages > at the top of the program. Yes, good OOD puts things into cohesive, comprehensible packages. > I can see do difference in "game play". 8^D And that's a good thing, right? "Refactoring is the process of ch

Re: [Tutor] designing POOP

2008-02-08 Thread bhaaluu
On Feb 8, 2008 3:24 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > > and change the loop from >while True: > to >while explr.alive: > > This would give you an Explorer class that actually does something useful. > > Kent > It also cleaned up main(), and put everything in well defined pa

Re: [Tutor] designing POOP

2008-02-08 Thread Kent Johnson
bhaaluu wrote: > class Explorer(object): > """player""" > def __init__(self,name): > """initilaization method""" > self.__name = name > self.strength = 20 > self.wealth = 60 > > def get_name(self): > return self.__name There is no need for get_

Re: [Tutor] designing POOP

2008-02-08 Thread bhaaluu
On Feb 7, 2008 9:40 PM, Tiger12506 <[EMAIL PROTECTED]> wrote: > There's a couple of errors in here that no one has addressed yet because the > question was geared towards programming style... So now I will address them. > Or undress them, I suppose. ;-) I didn't make much progress until I started

Re: [Tutor] designing POOP

2008-02-08 Thread Kent Johnson
Alan Gauld wrote: > Unit tests and TDD is not a design technique per se. > It is definitely not a technique for designing OOP programs > its a programming technique that makes code more reliable > (whether OOP or not). > > Where it does help in design is by focussing attention > on how a class (o

Re: [Tutor] designing POOP

2008-02-08 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote > PyUnit: > It really doesn't seem to be an "absolute beginner" technique. Unit tests and TDD is not a design technique per se. It is definitely not a technique for designing OOP programs its a programming technique that makes code more reliable (whether OOP or

Re: [Tutor] designing POOP

2008-02-07 Thread Tiger12506
There's a couple of errors in here that no one has addressed yet because the question was geared towards programming style... So now I will address them. Or undress them, I suppose. ;-) > #!/user/bin/python > """ >>From the testing laboratory of: > b h a a l u u at g m a i l dot c o m > 2008-02-

Re: [Tutor] designing POOP

2008-02-07 Thread bhaaluu
On Feb 7, 2008 6:47 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "Alan Gauld" <[EMAIL PROTECTED]> wrote > > >> What is the equivalent of JUnit in Python? > > > > I think the nearest equivalent is > > > > Oops, I was going top say PyUnit then remembered the name > had changed but forgot to check ou

Re: [Tutor] designing POOP

2008-02-07 Thread Alan Gauld
"Alan Gauld" <[EMAIL PROTECTED]> wrote >> What is the equivalent of JUnit in Python? > > I think the nearest equivalent is > Oops, I was going top say PyUnit then remembered the name had changed but forgot to check out the latest incarnation. Fortyunately others have done the work for me. P

Re: [Tutor] designing POOP

2008-02-07 Thread bhaaluu
On Feb 7, 2008 4:58 PM, Eric Brunson <[EMAIL PROTECTED]> wrote: > bhaaluu wrote: > > What is the equivalent of JUnit in Python? The article says that JUnit is > > used for unit tests, or you can write your own. Since I don't have a clue, > > writing my own is probably out the question. Also I'm not

Re: [Tutor] designing POOP

2008-02-07 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote > What is the equivalent of JUnit in Python? I think the nearest equivalent is > writing my own is probably out the question. Also I'm not familiar > with > Java, and am just learning Python OOP, so I'm not getting much out > of that one. Sorry. Absolute Beg

Re: [Tutor] designing POOP

2008-02-07 Thread Kent Johnson
bhaaluu wrote: > What is the equivalent of JUnit in Python? The unittest module is based on JUnit. http://docs.python.org/lib/module-unittest.html Here is a simple introduction to the capabilities of unittest. It doesn't do much to motivate the examples though: http://www.oreillynet.com/onlamp/

Re: [Tutor] designing POOP

2008-02-07 Thread Eric Brunson
bhaaluu wrote: > What is the equivalent of JUnit in Python? The article says that JUnit is > used for unit tests, or you can write your own. Since I don't have a clue, > writing my own is probably out the question. Also I'm not familiar with > Java, and am just learning Python OOP, so I'm not getti

Re: [Tutor] designing POOP

2008-02-07 Thread bhaaluu
On Feb 7, 2008 4:07 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > bhaaluu wrote: > > > The TDD method is the method used in my tutorial: > > Python Programming for the Absolute Beginner 2E. Michael Dawson. 2006. > > Dawson uses a very simple Tamagotchi example called Critter Caretaker > > to introd

Re: [Tutor] designing POOP

2008-02-07 Thread Kent Johnson
bhaaluu wrote: > The TDD method is the method used in my tutorial: > Python Programming for the Absolute Beginner 2E. Michael Dawson. 2006. > Dawson uses a very simple Tamagotchi example called Critter Caretaker > to introduce the mechanics of POOP. However, perhaps he is using > the TDD method of

Re: [Tutor] designing POOP

2008-02-07 Thread bob gailer
Also beware the difference between reassigning and extending: class F: a = 3 b = [] def __init__(self, a, b): self.a = a self.b.append(b) def show(self): print self.a, self.b f1=F(1,2) f2=F(3,4) f1.show() # 1 [2, 4] f2.show() # 3 [2, 4] -- Bob Gailer 919-636-4239 Chapel Hill

Re: [Tutor] designing POOP

2008-02-07 Thread Marc Tompkins
> Sorry, my bad - this was my me, but I forgot to hit "Reply All". My me? I think I meant to type "my message". -- www.fsrtechnologies.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] designing POOP

2008-02-07 Thread Kent Johnson
bhaaluu wrote: > Best practice? Use class attributes when you actually want a shared attribute, for example for constants with class scope, or as defaults when instance attributes may not be assigned. Class attributes can be redefined by subclasses which makes them useful as a way to configure

Re: [Tutor] designing POOP

2008-02-07 Thread bhaaluu
I was asked: Here's a situation I often encounter, and I was wondering what the "best practice" is. I've generally initialized my classes' attributes this same way: > class TestClass1(object): > """ please give me a better name""" > def __init__(self): > """please document me""

Re: [Tutor] designing POOP

2008-02-07 Thread bhaaluu
Greetings, I've read both Kent's and Alan's approaches to designing a POOP, and am intrigued with the possibilities of the noun/verb/adjective technique, but am also sympathetic to the TDD method as well because it is how I've always programmed. I have noted Alan's comments on the limitations of T

Re: [Tutor] designing POOP

2008-02-07 Thread Kent Johnson
Alan Gauld wrote: > "Kent Johnson" <[EMAIL PROTECTED]> wrote >> The writings of Robert C Martin have taught me a lot about good >> design >> and agile development. They don't all apply to Python > > Martin is very good on Agile, I'm less impressed with his OO writing, > largely because he does te

Re: [Tutor] designing POOP

2008-02-07 Thread bhaaluu
On Feb 6, 2008 8:15 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Design a little, code a little, repeat... > http://personalpages.tds.net/~kent37/stories/3.html > > > You can discover many useful design techniques by applying DRY. More here: > http://personalpages.tds.net/~kent37/s

Re: [Tutor] designing POOP

2008-02-07 Thread Alan Gauld
"Kent Johnson" <[EMAIL PROTECTED]> wrote > Let me say that I don't mean any disrespect for Alan or his > approach, I > just have a different point of view. Heh, heh! I was waiting for someone to post a message like this. I'll respond by saying the noun/verb thing is not actually the method I wou

Re: [Tutor] designing POOP

2008-02-06 Thread Kent Johnson
bhaaluu wrote: > How do you design POOP? What are the guidelines you keep in mind > to design "good" POOP? Can an absolute beginner learn to design POOP? I have mostly stayed out of this thread for lack of time and because Alan is doing a great job, but I think I will chime in a bit because this

Re: [Tutor] designing POOP

2008-02-06 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote Let me preface this message by saying that I've never written a TAG before - either procedurally nor using OOP. so I don't know if the following approach is a good way to go or not. However it's where I feel things moving... > I have a tendancy to think abo

Re: [Tutor] designing POOP

2008-02-06 Thread bhaaluu
On Feb 6, 2008 12:06 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > "bhaaluu" <[EMAIL PROTECTED]> wrote > > > Here is my description, in plain English. > > > > Text Adventure Game Requirements: > > 1. The Explorer enters her name at a prompt. > > 2. Other things are initialized at this point. > > 3. T

Re: [Tutor] designing POOP

2008-02-06 Thread bhaaluu
Thank you Alan. This helps tremendously! I had gone to your OOP tutorial and read it over (again) and the closest thing I could find on that page was the Bank Account example that had a list of things a bank account might be expected to do. So away I went, making a list. The problems with that ap

Re: [Tutor] designing POOP

2008-02-06 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote > Here is my description, in plain English. > > Text Adventure Game Requirements: > 1. The Explorer enters her name at a prompt. > 2. Other things are initialized at this point. > 3. The layout of the Castle is defined. > 4. Treasure is placed in rooms in the

Re: [Tutor] designing POOP

2008-02-06 Thread bhaaluu
On Feb 5, 2008 3:02 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > Describe the problem in plain English text(or whatever you > language is!). > -- > Alan Gauld > Author of the Learn to Program web site > http://www.freenetpages.co.uk/hp/alan.gauld > Here is my description, in plain English. Text

Re: [Tutor] designing POOP

2008-02-06 Thread Tiago Saboga
On Wed, Feb 06, 2008 at 08:58:09AM -, Alan Gauld wrote: > Thus always base inheriotance on common mbehaviour not on > common data. > > I hope that makes it clearer. Thanks Alan, it's clear now. And now I know that this is not one of the mistakes I am making ;) Tiago Saboga. _

Re: [Tutor] designing POOP

2008-02-06 Thread bhaaluu
On Feb 5, 2008 3:02 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > One of the earliest ways of doing this has now fallen sonewhat > out of favour but in practie I find it works quite well for beginners > is: > > Describe the problem in plain English text(or whatever you > language is!). Underline th

Re: [Tutor] designing POOP

2008-02-06 Thread Alan Gauld
"Tiago Saboga" <[EMAIL PROTECTED]> wrote >> sub types of an abstract superclass. Do NOT use data >> attributes for this, always base inheritance heirarchies >> on behaviour. > > Could you please elaborate on this last sentence? I don't understand > what you mean, and I feel I may be on this track.

Re: [Tutor] designing POOP

2008-02-05 Thread Tiago Saboga
On Tue, Feb 05, 2008 at 08:02:19PM -, Alan Gauld wrote: > "bhaaluu" <[EMAIL PROTECTED]> wrote > > > Now I am interested in learning how to DESIGN an object-oriented > > version The question was very interesting, and so where the answers. > Don't at this stage worry too much about inheritanc

Re: [Tutor] designing POOP

2008-02-05 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote > Now I am interested in learning how to DESIGN an object-oriented > version A useful distinction. You need to understand what classes are before you can use them but the art of desiogn is indeed different to the skills of construction > Can I use the procedu

Re: [Tutor] designing POOP

2008-02-05 Thread Kent Johnson
bhaaluu wrote: > POOP: Python Object Oriented Programming/Programmer/Program(s) POOP = borderline offensive and definitely annoying. Maybe you don't know that poop is a synonym for excrement? Is that what you are trying to learn? > Now I am interested in learning how to DESIGN an object-ori

Re: [Tutor] designing POOP

2008-02-05 Thread bhaaluu
On Feb 5, 2008 1:13 PM, Marc Tompkins <[EMAIL PROTECTED]> wrote: > > On Feb 5, 2008 5:46 AM, bhaaluu <[EMAIL PROTECTED]> wrote: > > What I'm interested in is the thought processes and/or > > guidelines that Tutors employ when they sit down to design a POOP. > > > The Code Smells page is as good a s

Re: [Tutor] designing POOP

2008-02-05 Thread Marc Tompkins
On Feb 5, 2008 5:46 AM, bhaaluu <[EMAIL PROTECTED]> wrote: > What I'm interested in is the thought processes and/or > guidelines that Tutors employ when they sit down to design a POOP. Whenever I have a few free minutes and a desire to contemplate the infinite (Hah!), I surf over to the C2 wiki.