python debugging question
lycka at carmen.se
Thu Mar 16 15:37:48 CET 2006
diffuser78 at gmail.com wrote:
> I am a python newbie. I have writen some 500 lines of code. There are 4
> classes and in all 5 files.
> Now, I am trying to run the program. I am getting wrong values for the
> simulation results.
If you first write 500 lines of code, and *then* try to run it,
it seems you are using a development approach suitable in the
1960's when running a program meant handing a stack of punch
cards to a computer operator in a white coat, and then getting
the result of the run the next day (if you're lucky).
I was taught to write like this as recently as in the late 80's
when I was in universtity, but today I typically run my code
every ten minutes or so. It's rare that I run the code I work
on less frequently than every thirty minutes.
In my experience, my current way of developing software leads to
higher productivity, better quality and much better predictability
in regards to both development time and software performance and
features. The way to achieve this is to use lots of automated
tests and a development time where you learn to work in small
increments. Martin Fowler's book "Refactoring" is a good guide
for this, and Python is a very good language to use for this kind
Perhaps this might be useful?
More information about the Python-list