Tuesday, January 22, 2019

If I were to redo my 2011 Research Tools class

If I were doing the equivalent of my 2011 Research Tools class, I would do it as much as possible in Python 3 (python 2 is dead) with Jupyter notebooks.  I don't know what editor, but maybe PyCharms?  But I would prefer to pick something opensource.  Here are some of the things I was just thinking about while on the bus this morning:


  • Teaching python should be taught through multiple methods.  Incorporate or at least give guided options for self learning, normal classes focused on using Python and Jupyter, included in other courses that the same students will take.
  • Teach unit testing from the beginning
  • Beware the Python examples in some commercial products.  Their examples can sometimes be kinda crazy and detrimental to learning how to write Python effectively.
  • Start with version control from the beginning for projects of all sizes.  There is no project too small for git (or I guess mercurial)
  • Treat python 2 as persona non grata
  • Introduce style guides early.  If you can, pick one for the department.  Code should be like formal writing and lab notebooks: Correct grammar, spelling, formatting, etc. make things grow faster and last longer. e.g. http://google.github.io/styleguide/pyguide.html
  • To go with the style guide, teaching about code formatting tools (and having a required one) can take away a lot of stress from the code.  Go ahead and write that messy looking code.  Then run the formatter and linter when you are ready.  A much lower stress way of getting readable code.  codespell is another of my favorite tools
  • Teach pip + virtual environments
  • Teach the basics of copyright rules and what licenses mean.  When is it okay to use other code.  When is it okay or not okay to share your code with others.  What does it mean to not put a license on code
  • Encourage sending pull requests to projects.  Especially for projects with CI setup so you can see what it's like to have your code checked
  • Stack overflow and the like are used by the pros.  Everyone should use them and learn how to interpret the quality of answers