Good programming as seen in: Fw: Is this possible in Python ?

King Kuta mr.kuta at libero.it
Sun May 18 02:49:34 EDT 2003


Hi Pythonians,

I am picking back up on a thread that was on this newsgroup spme time ago
(5/15).
Since I am strating to learn OOP, I was trying to do it well right from the
beginning and I have been trying to learn good programming techniques before
actually punching in any code.
I have to say thouhg that Chad answer (read fwd attachment, plz...) caught
me a bit off guard.
No "debbugging" ? Wow that sounds heaven if OOP could save me taht....
Can I ask anybody to explain to me (or simply point me to online
references...) the meaning of:
(i) ...you design with testing suites (such as unit tests)...
(ii) ...and "contracts" (often reduced to putting 'assert' statements
throughout your code to cause early failure when a bug is causing your
program state to go bad.).

Sorry for the long post and thanks for your contribution.

Kuta

----- Original Message ----- 
From: "Chad Netzer" <cnetzer at mail.arc.nasa.gov>
Newsgroups: comp.lang.python
Sent: Thursday, May 15, 2003 12:21
Subject: Re: Is this possible in Python ?


> On Thu, 2003-05-15 at 05:13, Helmut Jarausch wrote:
>
> > But it doesn't solve the problem.
> > The trick in Simscript was
> >
> > You just write
> > a= b+c
> > d=2*a
> >
> > then some time later you want to monitor the variables,
> > e.g. for debugging
>
> As others have pointed out, you can fairly easily create objects that
> implement this kind of behavior.  Also, there is the Python debugger
> (pdb module - comes standard with Python), for tracing and inspecting
> live programs.
>
> Furthermore, much modern software engineering practice prescribes
> building your software in such a way as you don't have to ever do this
> kind of debugging (the old "peek at variables and trace program flow",
> that was prevalent before object-oriented programming was big, and when
> assembly language debuggers were common).  These days, good practice
> suggests you design with testing suites (such as unit tests), and
> "contracts" (often reduced to putting 'assert' statements throughout
> your code to cause early failure when a bug is causing your program
> state to go bad.)
>
> I grew up using debuggers, and these days, I *never* use them.  I simply
> don't need to, because my software is (typically) pieced together from
> small, well-tested components, with tests that scale up as the
> complexity of the system scales.
>
> If this interests you, please inquire further, and I'm sure people will
> point you to more specific resources.  In the mean time, look into
> Python unittest module, and the buzzword compliant "Extreme Programming"
> and "Agile Programming" methodologies)
>
>
> -- 
>
> Chad Netzer
> (any opinion expressed is my own and not NASA's or my employer's)
>
>






More information about the Python-list mailing list