Last Tuesday, I, and a few others from our class, attended the Python Workshop offered by the GCDI fellows.
Clearly, the purpose of the workshop was to introduce people with little programming background to some basic principles of programming and to a few foundations for the syntax of Python. First off, I think it is next to impossible for a 2 hour programming workshop to do more than help participants clear initial hurdles (or inertia) necessary to start the long, hopefully exciting and empowering, journey into learning how to program. Secondly, the specific hurdles you need to clear really depend on where you are in the learning process. Many of the participants, for example, had never programmed before, but some in that group came in with a clearer idea of what coding is than others — having absorbed mental models of the abstract spaces in which it works. So, it’s not an easy workshop to design.
That said, I think Rachel (the lead instructor) and Pablo (the support instructor) did a really good job of getting us going with the language. What I would have liked to have seen was a little bit more on where we should go next to make Python a useful tool for us, and to give some of us an idea of the kind of investment needed to do so. Rachel did mention something that seems hugely important to approaching learning Python: instead of trying to learn the language in some sort of systematic and holistic way from the outset, start with a problem you are trying to solve, a thing you want to do, and learn how to do that thing. You’ll have stakes, then, that will motivate you to push on when you run into inevitable impediments. You’ll also pick up a lot of the surrounding programming, API and implementation principles in a more grounded and transportable way.
Okay, so what did we cover?
Initially, why program in the first place?
- Learning programming helps you understand computing better in general
- It thus makes you a smarter computer user
- Importantly, it develops problem solving skills, systems thinking skills, and gives you experience in reducing complex problems into simpler components
- And, hey, if you get good at it, it’s extremely marketable
Why use Python in particular?
- It’s not the hardest language to start with
- It’s interpreted rather than compiled, so you can very quickly and easily see the results of what you are coding
- Lots of online resources for learning (famous for its great documentation)
- Many open-source libraries for Python, which means lots of tools you can use to build programs
- Quickly becoming industry standard for certain fields (particularly machine learning and text analysis)*
As far as the language goes, we covered:
- Data types (e.g. integers, floats, strings)
- Assignation of data values to variables
- How Python stores and manipulates those variable values in memory
- Defining and calling functions
- The “list” data structure (called “array” in other languages)
- And the use of “Definite Loops” (loops that iterate through a list a fixed number of times)
We didn’t get to what Rachel called “Decision Structures” due to time — (decision structures manifesting as if/else if/else constructions that evaluate inputs and run different code based on the value of said inputs).
All of this stuff, including the decision structures lesson, you can see up on Rachel’s GitHub page for the Workshop here: https://github.com/rachelrakov/df_code/blob/master/Intro_to_Python_Programming_py3.6.ipynb
One of my favorite parts of the workshop, however, was being introduced to Jupyter Notebook (http://jupyter.org/) which Rachel used as the presentation mechanism. You can see its output on the GitHub page. It seems like an amazing tool for teaching (particularly code), because you can include instructional text alongside code blocks that actually run in the notebook. Pablo mentioned that Jupyter Notebook also works with an assortment of visualization packages. So, while I went in to get some Python information, I came out with a new pedagogical tool to explore!
As has been mentioned, I’ve done a lot of programming in the past, just not with Python. If this is true of you as well, I would not recommend the workshop — you are not the intended audience. However, if you want to get started programming in general, and/or with Python in particular, I think it’s great. Not only will you get the initial nudge everyone needs, but you’ll meet some great Digital Fellows who can be resources for you in the future. I recommend you ask them where to go next to start using Python productively in your work.
Edit: one final thing, don’t forget that Patrick Smyth, our fearless advisor, is highly proficient and experienced in using Python; he is a tremendous resource both for getting started and hacking on the code you’re working on.
*I pulled this section almost directly from the GitHub page