Incremental development

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Incremental development

kh92
I have been using WingIDE for a few weeks now, and I find it very
valuable for debugging my applications. However, I note that I hardly
use it to develop new code, and I wonder if that's because of some
oversight - I can't claim to have read the manual cover to cover.

My typical mode of development is best described as incremental. I
start writing a script that will include both new classes and testing
code, with the idea of factoring out the classes into modules once the
code is reasonably stable. I feed the code that I write in small chunks
to a Python interpreter as I write it, and then I run interactive
checks before writing and testing the next chunk (all this using Emacs'
Python mode). If something crashes, I fix the code and resubmit the
changed parts to the interpreter.

I would love to do all this inside WingIDE, but it seems that I always
have to run the complete script, I can't just execute successive parts
of it under debugger control. Considering that my scripts often do some
lengthy computation in the beginning (e.g. loading a big protein
structure, which can easily take a minute or two), having to start from
scratch for every change slows down development beyond my patience.

Any ideas?

Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Laboratoire Léon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: [hidden email]
---------------------------------------------------------------------

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental development

Stan Pinte
[hidden email] wrote:

>I have been using WingIDE for a few weeks now, and I find it very
>valuable for debugging my applications. However, I note that I hardly
>use it to develop new code, and I wonder if that's because of some
>oversight - I can't claim to have read the manual cover to cover.
>
>My typical mode of development is best described as incremental. I
>start writing a script that will include both new classes and testing
>code, with the idea of factoring out the classes into modules once the
>code is reasonably stable. I feed the code that I write in small chunks
>to a Python interpreter as I write it, and then I run interactive
>checks before writing and testing the next chunk (all this using Emacs'
>Python mode). If something crashes, I fix the code and resubmit the
>changed parts to the interpreter.
>
>I would love to do all this inside WingIDE, but it seems that I always
>have to run the complete script, I can't just execute successive parts
>of it under debugger control. Considering that my scripts often do some
>lengthy computation in the beginning (e.g. loading a big protein
>structure, which can easily take a minute or two), having to start from
>scratch for every change slows down development beyond my patience.
>  
>
what you ask is in my opinion very useful:

select a block of code -> right click -> eval into interpreter

no?

Stan.

>Any ideas?
>
>Konrad.
>--
>---------------------------------------------------------------------
>Konrad Hinsen
>Laboratoire Léon Brillouin, CEA Saclay,
>91191 Gif-sur-Yvette Cedex, France
>Tel.: +33-1 69 08 79 25
>Fax: +33-1 69 08 82 61
>E-Mail: [hidden email]
>---------------------------------------------------------------------
>
>_________________________________________________
>Wing IDE users list
>http://wingware.com/lists/wingide
>
>
>  
>

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental development

Wing IDE Support
In reply to this post by kh92
On Tue, 14 Jun 2005 [hidden email] wrote:

> I have been using WingIDE for a few weeks now, and I find it very
> valuable for debugging my applications. However, I note that I hardly
> use it to develop new code, and I wonder if that's because of some
> oversight - I can't claim to have read the manual cover to cover.
>
> My typical mode of development is best described as incremental. I
> start writing a script that will include both new classes and testing
> code, with the idea of factoring out the classes into modules once the
> code is reasonably stable. I feed the code that I write in small chunks
> to a Python interpreter as I write it, and then I run interactive
> checks before writing and testing the next chunk (all this using Emacs'
> Python mode). If something crashes, I fix the code and resubmit the
> changed parts to the interpreter.
>
> I would love to do all this inside WingIDE, but it seems that I always
> have to run the complete script, I can't just execute successive parts
> of it under debugger control. Considering that my scripts often do some
> lengthy computation in the beginning (e.g. loading a big protein
> structure, which can easily take a minute or two), having to start from
> scratch for every change slows down development beyond my patience.
>
> Any ideas?

I work similarly and have so far (more or less) satisfied my needs with:

1) The Python Shell tool, where I try things out that don't require a lot
    of setup or environment (as far as imported modules, initialization,
    etc).

2) The Debug Probe (Wing Pro only), where you can run to a breakpoint or
    exception in your debug process and then execute code in the context
    of your currently selected stack frame.  This is useful together with
    conditional breakpoints to get to the particular case/state for which
    you're trying to write some code.

3) On occassion, I just write code in small bits and debug that instead
    of launching a whole app into the debugger.  A good way to do this is
    by writing unit tests and developing the code against the unit tests
    first, and then trying it in the context of the whole app.

Both (2) and (3) will benefit once we allow multiple debug processes at
once so you don't have to exit your play space to try the code in the
context of your real app.

>From what you write, the Debug Probe is probably what you want (you can
load your protein structure once and try different things against it).
However, we'ld be interested in any suggestions for other capabilities that
might make your work easier.

Thanks for using Wing.

Stephan Deibel

--
Wingware
Wing IDE for Python
Advancing Software Development

www.wingware.com
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental development

kh92
On Jun 14, 2005, at 16:10, Wingware Support wrote:

> 2) The Debug Probe (Wing Pro only), where you can run to a breakpoint
> or
>    exception in your debug process and then execute code in the context
>    of your currently selected stack frame.  This is useful together
> with
>    conditional breakpoints to get to the particular case/state for
> which
>    you're trying to write some code.

I love the debug probe, that's one of the best features of WingIDE. But
it's convenient for short one-liners only. What I would like to be able
to do is
1) Analyse a bug in the debug probe.
2) Fix the bug in my code, i.e. usually in one or two classes contained
in my script.
3) Resubmit the fixed code to the interpreter.
4) Re-run the test code.

All that without having to start over in a new debug process.

If my understanding of the debug probe is correct, all that I would
need is a command that sends the selection for evaluation to the debug
probe. Copy/paste won't do the trick due to the different handling of
indented blocks in interactive mode.

Could this perhaps be done with scripting?

Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Laboratoire Léon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: [hidden email]
---------------------------------------------------------------------

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental development

Wing IDE Support
On Tue, 14 Jun 2005 [hidden email] wrote:

>> 2) The Debug Probe (Wing Pro only), where you can run to a breakpoint or
>>    exception in your debug process and then execute code in the context
>>    of your currently selected stack frame.  This is useful together with
>>    conditional breakpoints to get to the particular case/state for which
>>    you're trying to write some code.
>
> I love the debug probe, that's one of the best features of WingIDE. But it's
> convenient for short one-liners only. What I would like to be able to do is
> 1) Analyse a bug in the debug probe.
> 2) Fix the bug in my code, i.e. usually in one or two classes contained in my
> script.
> 3) Resubmit the fixed code to the interpreter.
> 4) Re-run the test code.
>
> All that without having to start over in a new debug process.
>
> If my understanding of the debug probe is correct, all that I would need is a
> command that sends the selection for evaluation to the debug probe.
> Copy/paste won't do the trick due to the different handling of indented
> blocks in interactive mode.

We are looking at supporting module / fragment reload as a debugger
feature.  It's not quite so simple as just sending code to evaluate. For
example, think about existing instances that reference a bound code object
for their methods -- replacing one of those won't just automatically happen
if you just re-evaluate a changed class.  There are, however, ways to do
this internally.

> Could this perhaps be done with scripting?

Not really, for the above-described reason.  You can of course re-evaluate
function defs and classes and that will work reasonably for new invocations
or newly created instances.  I do this by dragging an dropping the function
def from the source into the debug probe.  It adjusts leading indent and
should evaluate automatically.

- Stephan

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental development

Todd Ely
In reply to this post by Wing IDE Support


Wingware Support wrote:
On Tue, 14 Jun 2005 [hidden email] wrote:
  
I have been using WingIDE for a few weeks now, and I find it very
valuable for debugging my applications. However, I note that I hardly
use it to develop new code, and I wonder if that's because of some
oversight - I can't claim to have read the manual cover to cover.

My typical mode of development is best described as incremental. I
start writing a script that will include both new classes and testing
code, with the idea of factoring out the classes into modules once the
code is reasonably stable. I feed the code that I write in small chunks
to a Python interpreter as I write it, and then I run interactive
checks before writing and testing the next chunk (all this using Emacs'
Python mode). If something crashes, I fix the code and resubmit the
changed parts to the interpreter.

I would love to do all this inside WingIDE, but it seems that I always
have to run the complete script, I can't just execute successive parts
of it under debugger control. Considering that my scripts often do some
lengthy computation in the beginning (e.g. loading a big protein
structure, which can easily take a minute or two), having to start from
scratch for every change slows down development beyond my patience.

Any ideas?
    

I work similarly and have so far (more or less) satisfied my needs with:

1) The Python Shell tool, where I try things out that don't require a lot
    of setup or environment (as far as imported modules, initialization,
    etc).

2) The Debug Probe (Wing Pro only), where you can run to a breakpoint or
    exception in your debug process and then execute code in the context
    of your currently selected stack frame.  This is useful together with
    conditional breakpoints to get to the particular case/state for which
    you're trying to write some code.

3) On occassion, I just write code in small bits and debug that instead
    of launching a whole app into the debugger.  A good way to do this is
    by writing unit tests and developing the code against the unit tests
    first, and then trying it in the context of the whole app.

Both (2) and (3) will benefit once we allow multiple debug processes at
once so you don't have to exit your play space to try the code in the
context of your real app.

>From what you write, the Debug Probe is probably what you want (you can 
load your protein structure once and try different things against it). 
However, we'ld be interested in any suggestions for other capabilities that 
might make your work easier.

Thanks for using Wing.

Stephan Deibel

--
Wingware
Wing IDE for Python
Advancing Software Development

www.wingware.com
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide

  
I do a lot of programming that follows model 3 above.  That is it is a lot programming of pieces that are part of a larger project.  In this case the module that I am working on is not the main debug file.  Then to run this file I use the 'debug current file' menu pick.   This type of debugging would be more efficient if there was a button that I could click rather than going to the button.  I'm sure there is a key stroke - but I tend to be a gui sort of user.

Todd Ely
-- 
Dr. Todd A. Ely
Guidance, Navigation, and Control Section
Jet Propulsion Laboratory
Mail Stop 301-125L
4800 Oak Grove Drive
Pasadena, CA 91109-8099
Phone: (818) 393-1744 FAX: (818) 393-6388
E-Mail: [hidden email]

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental development

Wing IDE Support
In reply to this post by Wing IDE Support
On Tue, 14 Jun 2005, Wingware Support wrote:
> Not really, for the above-described reason.  You can of course re-evaluate
> function defs and classes and that will work reasonably for new invocations
> or newly created instances.  I do this by dragging an dropping the function
> def from the source into the debug probe.  It adjusts leading indent and
> should evaluate automatically.

Actually, this isn't quite correct in that you have to re-evaluate the
def/class in the right stack frame and scope.  I tend to use it only for
nested defs and simple cases working at the top level of a module.

- Stephan
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental development

Wing IDE Support
In reply to this post by Todd Ely
On Tue, 14 Jun 2005, Todd Ely wrote:
> I do a lot of programming that follows model 3 above.  That is it is a lot
> programming of pieces that are part of a larger project.  In this case the
> module that I am working on is not the main debug file.  Then to run this
> file I use the 'debug current file' menu pick.   This type of debugging would
> be more efficient if there was a button that I could click rather than going
> to the button.  I'm sure there is a key stroke - but I tend to be a gui sort
> of user.

Maybe the soln is to allow clicking and holding the debug icon in toolbar
to pop up the recent debug menu (which is currently in the Debug menu) so
it's easy to select a particular file (main debug file or otherwise).

For now, you might just want to Clear Main Debug File from the Debug menu.
In that case, Wing will debug the current file by default (even when using
the regular debug initiation commands and toolbar icons).  This of course
means you need to go to your main debug file when you want to debug that,
but if you don't do that often it may be a better way to work.

If you do this, you may need to add the location of your main debug file to
the Python Path in Project Properties since unsetting it will remove the
implied inclusion of its directory.

- Stephan
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incremental development

kh92
In reply to this post by Wing IDE Support
On Jun 14, 2005, at 17:35, Wingware Support wrote:

> We are looking at supporting module / fragment reload as a debugger
> feature.  It's not quite so simple as just sending code to evaluate.
> For example, think about existing instances that reference a bound
> code object for their methods -- replacing one of those won't just
> automatically happen if you just re-evaluate a changed class.  There
> are, however, ways to do this internally.

I didn't expect existing objects to be updated, for my test scripts
that really doesn't matter. I know what I have to reexecute after a
class change.

Of course, having an auto-update feature would be nice as well. That
would yield an environment similar to Smalltalk, where bugs can be
fixed in running code.

> Not really, for the above-described reason.  You can of course
> re-evaluate function defs and classes and that will work reasonably
> for new invocations or newly created instances.  I do this by dragging
> an dropping the function def from the source into the debug probe.  It
> adjusts leading indent and should evaluate automatically.

Ahhh.... there's what I was looking for. Dragging the definition to the
debug probe - I didn't even think of trying that!

Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Laboratoire Léon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: [hidden email]
---------------------------------------------------------------------

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Loading...