carpentries-lab / python-aos-lesson

Python for Atmosphere and Ocean Scientists
https://carpentries-lab.github.io/python-aos-lesson/
Other
88 stars 50 forks source link

[JOSE] Debug/pdb example seems extraneous #17

Closed darothen closed 5 years ago

darothen commented 6 years ago

The short segue discuss pdb and debugging in Lesson 4 seems a little extraneous. It's shown as an aside or a segue, but doesn't really reinforce the core point of the module (building and running more universal command line programs from your test scripts). If it's core material that the author wishes the student to dwell on a bit, then there may be two ways to better integrate it into the material:

  1. Move it to the "Defensive Programming" or lesson
  2. More tightly integrate it into the material

For instance, the GitHub material comes prior to the Defensive Programming which makes a lot of sense. One tool that the author could use to emphasize that debugging exists and is useful could be to accidentally commit a line with a syntax error in it. The author could then walk through fixing the issue in a simple way that introduces some more tools: First, the author could show pdb to help track down the bug. Second, they could use git blame to figure out when that line was changed. Finally, they could use git commit --amend or a revert to undo and fix the issue. The point of this short exercise would be to walk through a real-life, very common use case which the student will certainly encounter, and emphasize how these tools and techniques help minimize the pain that debugging causes with ad hoc development practices.

CC: openjournals/jose-reviews/issues/37

DamienIrving commented 6 years ago

Thanks, @darothen - this is an excellent suggestion.

I've gone ahead and moved the pdb content to the lesson on defensive programming (see https://github.com/carpentrieslab/python-aos-lesson/commit/a21a6ae2e0993999b9cfc3e815e147d1f0121766).