[clue] debuging programs

chris fedde chris at fedde.us
Tue May 17 07:30:19 MDT 2011


Programming is hard. People are just not very good at being perfect.  And
software has to be perfect in some sense to work properly.  This is what
makes programming hard.  So the best plan is to work in a tight think, code,
test loop. There are plenty of techniques that help you isolate trouble too.
  The first technique everyone figures out is diagnostic print statements.
 Second is usually learning how to use an interactive debugger for your
environment.   Third is often automated testing.   Fourth is code review if
you are working with someone else.

For me one of the best tools for programming is prospective documentation.
 Call it requirements or system design if you like.  I like to write down in
English what I want the program to do before I start programming.
 Usual this is nothing very formal.  Just a few sentences and paragraphs,
maybe a picture or two that convey the concepts and sequences that will go
into the design.  From this I can work out a modular breakdown and some high
level functionality goals.

Then I can take each module and goal and break them down further, implement
each including automated testing and at least a stub of documentation and
finaly integrate them together into a complete system including as much
automated integration testing as I can muster.   When the system is finished
and if you are lucky people start using your system.   And that's when it
starts getting really hard.


On Tue, May 17, 2011 at 6:39 AM, Mike Bean <beandaemon at gmail.com> wrote

> Besides, I know I'm basically just a wanna-be, but my experience of coding
> is very...different, then the public perception of the work, especially in
> large projects.  write a couple lines, test, curse at the monitor, tweak,
> test, curse at the monitor, tweak, throw the monitor out the window.   Get a
> new monitor, tweak, test again, go out to lunch, get an idea, tweak, it
> finally works, write a few more new lines and repeat the whole process ad
> nauseum.
>
> I wrote a python calculator, nothing special, just adds and subtracts.  50
> lines.   Took me at least a week.  Granted, it's not my full time job, but I
> did some scribbling in various notebooks at Wendy's over dinner when I could
> until I could type it out [?]
>
> Most of the large projects I've seen don't tend to have one person in
> charge of the whole source,  this guy writes a function, that guy writes the
> video driver...etc...etc...  To a degree you all end up leaning on each
> other anyway.   Case and point,
> http://www.nerdmeritbadges.com/products/rubberduck
>
> Bean
>
> On Mon, May 16, 2011 at 11:42 PM, Brian Gibson <bwg1974 at yahoo.com> wrote:
>
>> > In learning to program, can you get someone else to help debug the
>> programs...?
>>
>> Yes. The actual process of explaining your code to someone else often
>> helps to highlight where you made your mistake.
>>
>>
>>
>> ------------------------------
>> *From:* Louis Miller <veganguy at canadaseek.com>
>> *To:* clue <clue at cluedenver.org>
>> *Sent:* Sun, May 15, 2011 1:40:31 PM
>> *Subject:* [clue] debuging programs
>>
>> Hello,
>>
>>       I'm working on the fourth program from the "Learn Python the Hard
>> Way" book. It isn't working, right. In learning to program, can you get
>> someone else to help debug the programs, or to see that you typed everything
>> correctly, or are you supposed to be all on your own? If it is not
>> inappropriate to get help with this, then how would I go about finding
>> someone online? Maybe, there is a program that compares lines of text,
>> automatically, that you can use?
>>
>> Louis
>>
>>
>> ------------------------------
>> Get email for your site ---> http://www.canadaseek.com
>>
>> _______________________________________________
>> clue mailing list
>> clue at cluedenver.org
>> http://cluedenver.org/mailman/listinfo/clue
>>
>
>
> _______________________________________________
> clue mailing list
> clue at cluedenver.org
> http://cluedenver.org/mailman/listinfo/clue
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cluedenver.org/pipermail/clue/attachments/20110517/1a350bea/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 96 bytes
Desc: not available
Url : http://cluedenver.org/pipermail/clue/attachments/20110517/1a350bea/attachment-0001.gif 


More information about the clue mailing list