Debugger done

pemungkah on 2003-06-06T17:38:48

The debugger has now been commented, top to bottom.

It was an interesting job, and well worth doing. Not only did I learn a lot, but something that others will be able to use has come out of it. In addition, I learned a lot about how to check a vastly re-commented, re-whitespaced source against the original. For those interested:

  1. Install perltidy.
  2. Edit, edit edit. If you're going to try to clean up code, perltidy it now. The default settings yield very nice source.
  3. Once editing is complete, copy the source and edited versions elsewhere.
  4. Run this on both copies of the old and new source: perltidy -syn -dsm -naws -dnl -sob -dac -ce -bar This will syntax-check the output, delete extra null statements, don't add whitespace, delete old newlines and re-break, "swallow" optional blank lines, delete all comments, cuddled elses, opening brace always on right
  5. diff -ua the resulting code, piping it through perl -p -e 'next if /^[\+\-]\s*$/'
You can now visually inspect the output, looking for dropped stitches. This works particularly well for catching pod blocks with missing =cuts, as the old code will show up as deleted from the output code.

It might be worthwhile to consider some code-comparison enhancements to perltidy; even with the command line given above, lines with their internal spacing changed will still show up as different.


WOW!

ziggy on 2003-06-06T17:44:04

Good Job! Doubly so for having the gumption to see a problem, attempt to fix it, and succeed all on your own.

Thanks!

We all owe you some beers this summer. What's your favorite?

Re:WOW!

pemungkah on 2003-06-10T15:05:40

I loved the stuff at the Church Brewpub in Pittsburgh; we'll have to see what's cookin' in Portland. :)

Whitespace changes

vsergu on 2003-06-06T17:45:27

Couldn't you use -b or -w when you run diff to avoid seeing whitespace changes?

Re:Whitespace changes

pemungkah on 2003-06-10T15:03:46

-w seemd to help some (thanks!), but newlines are still a problem here and there. More fiddling with perltidy might do it.

I think the real problem is that it's not easy to parse perl and do a real semantic diff.