1. 6

Hello fellow crustaceans,

I have an exciting opportunity to help some developing scientists (rising seniors in college) learn to think about how to program during the first few weeks of a longer program this summer. The assumption is of no programming background beyond using a web-browser. In the mornings, they’ll be getting technical instruction in navigating a command line and using python with numpy. Then, in the afternoons, I’ll be working with them to help them think about how to program and structure their programs. Later in the summer they’ll be working with large, multi-spectral data sets and so helping them make the (early) transition from scalars to vector operations will be important.

I’ll have about 15 hours cumulatively to work on this specifically. We’ll use a combination of activities in constrained systems and guided problem solving in python. Among other things I want them to learn:

  1. Break things into small parts (and how)
  2. Computers only do what you tell them (in the context of debugging and heading-off “my code doesn’t like me”)

Many physicists enter graduate school with no programming coursework and then rapidly develop horrible habits. I get to try to head that off. I’m reaching out to all of you because I’m looking for some short (<4000 wds) introductory texts to help set them up how to think about programming. Any thoughts much appreciated! I’d also take ideas about other worthwhile learning goals and useful exercises to help them understand what’s going on.

  1.  

  2. 6

    Are you familiar with https://software-carpentry.org/? Lots of material you can use or reuse (and people you can track down and talk to).

    1. 2

      I am not yet; thank you!

    2. 4

      Summary: Spending 5–10 minutes teaching a strategy to read code can lead to improved reading performance, helping prevent low-performers from becoming overwhelmed and giving up

      This is a good technique to cover, especially because for most active programmers it is so internalised that only tell novices to do it, but don’t teach it.

      1. 1

        Thank you! This is certainly useful and relates to goal #2 above.

        1. 1

          Thanks, I totally missed this when it first appeared.

          1. 1

            Thank you for looking up quobit’s post on Lobsters via which I, too had found it at the time. And thank you, quobit, for sharing the article on Lobsters.

        2. 2

          Also, go over how to read error messages. Your students will get stuck less, and there’ll be less simultaneous demands for your help in the early stages. These are the things I usually cover for Python:

          • This is what an error looks like. The actual error and message are at the bottom.
          • This is what a traceback looks like. Ditto for a 2-frame traceback, a 3-frame traceback; and one where the error occurs in the bowels of numpy or pandas.
          • The most common error for beginners: NameError means the variable you ask for does not exist. Look at the bad name. Is the name wrong (typo?), or did you not define the var yet?