Github streak days 31-60: What I’ve learned

green_boxes

My current GitHub contributions graph

About two months ago I started writing some lessons for an Introduction to Programming class I was about to teach. I was using IPython Notebook to write those lessons, so I decided to put the notebooks on GitHub. I worked on the project pretty steadily, and soon passed my old GitHub record of 17 days. From then on, watching those little green boxes pile up got more and more addictive. Is it worthwhile to maintain a streak? I don’t want to keep it going forever, but it has definitely been worthwhile so far.

Introduction to Python - the main project I've been working on, as it looks now.

Introduction to Python – the main project I’ve been working on, as it looks now.

My main project at this point is Introduction to Python. Introduction to Python is an open resource for students who want to learn Python as their first language, and for teachers who want a free and open curriculum to use with their students. The project is growing steadily, both in terms of content and in terms of features that help students learn Python efficiently.

Improving my git workflow: branching

Introduction to Python, as it looked a month ago.

Introduction to Python, as it looked a month ago.

I have been a hobbyist programmer most of my life, which means I have worked mostly alone on my projects. When I started using git a few years ago, I began the bad habit of pushing all of my commits to master. This habit was great for starting a GitHub streak; it was easy to make a few commits each day, and some days I got to see some really dark green boxes show up. But as my project started to grow and attract some potential contributors, I started to feel really self-conscious about having such a cluttered master branch.

All output is collapsed by default, so readers can try to predict what the output should be.

All output is collapsed by default, so readers can try to predict what the output should be.

I knew about branches before, but had not practiced using them enough to make them part of my regular workflow. This streak has me using git every day, so it became harder and harder to put off using branches. Most of my commits involve adding content about how Python works, so many of these commits are quite appropriate to push directly to master, especially at this early stage. But one goal was to make the output of all sample code hidden by default, with a pair of show/ hide buttons below the sample code. This is a great learning feature; it allows students to predict the output of a code sample they are looking at, and then click a button to see if their prediction was correct. I am not a front-end guru, but I can find my way around js libraries and css hacks. Some of my commits while working on this feature would make no sense in master; they put buttons on the screen that didn’t do anything yet, and they put buttons on pages that had no output. So I did all this work on a feature branch, and then merged that to master. It was very satisfying to become more comfortable with a workflow I know will work well on a truly collaborative project.

A few other things I learned

I learned about a number of other things through pushing commits each day, and did some things I would not otherwise have gotten to:

  • I started writing some of my non-programming curriculum on IPython Notebook, so that I could share it easily with students. I would like to learn to use a Python static site generator such as hyde, pelican, jinja, or nikola, but I didn’t have time to dig into that this month. There’s so much that can be done just using IPython Notebook markdown cells!
  • I pushed the content on Introduction to Programming through making basic terminal applications. Now anyone who follows the curriculum starting at Hello World can learn to write simple terminal applications.
  • I feel more and more connected to the programming world outside my small town in Alaska, where my students are the only people I know who write any code.
  • I started writing tests! I wrote a test to verify that all links in this project are working. The default behavior is to start a SimpleHTTPServer and test the local working copy, but it accepts a flag to test all links on the deployed site. It does not yet test anchor tags, but just being sure that all links between pages and to external sites are not broken makes me more confident in the project overall. I also got to use Requests, which makes me feel like a Real Python Programmer.
  • I found that I am much more likely to keep a project going. I started a really cool version of a text-based Adventure game, which starts out with the player standing on the front steps of our high school. Students and staff loved the first day’s progress. In the past I would have copied this to my computer and maybe done something with it. Instead I just threw it up on GitHub, and I have worked on it a couple times since then. The simple act of using GitHub every day makes it easy to keep interesting, nascent projects alive.
  • I used Bootstrap 3.0, which I’ve been wanting to use in a project.

What’s next?

I’m going to try to keep this streak going a while longer, as long as it is keeping me productive and improving my professionalism in programming. In the next 30 days, I’d like to:

  • Keep using branches. This is a no-brainer, for everything except content that should go directly into the project.
  • Consider using pull requests. I know some people don’t merge any of their own branches, they submit all branches as pull requests, even if they are simply going to accept their own PR. I want to do this just to be more comfortable with the process of submitting and accepting PRs.
  • Keep adding content to Introduction to Python.
    • Finish the basic sections through Functions, Classes, Exceptions, and Testing.
    • Complete the first project, a mapping visualization using matplotlib Basemap.
    • Add more content around how to write programs. You’ve managed to learn a bunch of syntax, but how do you think through a project’s requirements and figure out how to  start writing code?
    • Clarify the section about setting up a programming environment: how to install linux on a donated computer, how to troubleshoot non-functioning Python environments, how to find help, etc.
  • Do some non-github work. I have one non-open project that I need to make significant progress on. It’s hard to work on closed projects when you’ve been immersed in the open source world, but I have a pretty meaningful project to work on. I aim to balance the two, instead of focusing so much on just the open source work.
Advertisements
Posted in programming | Tagged , , , , , , , | Leave a comment

What I’ve learned from my first 30-day GitHub streak

My first 30-day streak on GitHub

Look at that nice patch of green on the right hand side!

Today marks the end of my first 30-day streak of making contributions on GitHub. I had no intentions of starting a streak, but now that I’ve got one going, it’s addictive. More importantly, I find I am learning a great deal, and my overall work habits are improving.

Starting a new project

About a month ago I started teaching an Introduction to Python class, which I teach each fall. This year I decided to use IPython to write up my lesson notes and demonstration programs. In the course of learning IPython, I discovered how easy it is to post notebooks online using IPython Notebook Viewer. I ended up posting the notebooks on GitHub, and sharing them with students through the Notebook Viewer.

I wrote a post about how IPython and GitHub were making my teaching better, and I was quite surprised to see that post sit on the front page of HN for most of a day. The overwhelmingly positive response inspired me to keep working on the project, and before I knew it I had matched my previous streak of 17 days.

30 days: Nothing new on GitHub, but quite meaningful for me

I know there are some really long streaks on GitHub, and I have no intention of setting any records. But I was pleasantly surprised to find that I was learning a lot by maintaining my own streak.

  • I made steady progress on my project. I would have made steady progress on this project anyways, but having fun with a streak definitely helped me maintain a steady level of progress. Except for one or two days of simply opening a new issue, the streak has me focusing on writing at least some code each day.
  • Simply opening a new issue is not “cheating”. I opened new issues on a couple days when I didn’t have time to make a more serious contribution. But that wasn’t cheating. It gave me the chance to put into writing a number of issues that were stirring in my head. Good documentation always makes a project stronger, and tracking issues effectively is part of forming good documentation habits.
  • My first pull request. Yes I will accept it!

    My first pull request. Yes I will accept it!

    I got my first pull request! It was minor, but that’s what I expected for a first pull request. It’s a pretty good feeling to have someone else make even a minor contribution to a project I had started.

  • I learned more about git. Three weeks into the project, I decided to host static versions of the notebooks I was creating for students. IPython’s Notebook Viewer is a wonderful tool, but some of the longer notebooks were taking 8-12 seconds to load. GitHub was down one day during class, so students lost access to the public versions of the notebooks. I decided to throw static versions of the notebooks up somewhere, and ended up creating introtopython.org. The load times went down to about one second, and I have a much easier time pointing students to our learning materials. I ended up making a post-commit hook that converts the raw notebooks to html. I had heard of git hooks before, but never had the opportunity to use them until now.
  • I kept up with other projects as well. One of my routines each morning is to click the little blue notifications dot at the top left side of the GitHub page. I love the Gittip project, but I just don’t have time to contribute right now. Even though I can’t actively contribute, I still feel connected to that project by skimming the notifications every morning. When I do have some time to contribute, it will be much easier for me to jump into that project.

What’s next? 60 days?

I learned enough from these first 30 days that I want to try for a 60-day streak. I don’t care much for chasing numbers, but I am quite curious to see what the next 30 days will bring. I expect to see a much more refined project, and I hope to have a few more contributors. I expect to learn some more about git, and continue improving my overall workflow. And yes, I do look forward to seeing a larger area of solid green squares on my GitHub page.

There is one thing that might keep me from maintaining my streak, however. I have been a lone hobbyist programmer for most of my life, so I have developed the habit of doing almost all of my work on the master branch. I know I should be working on branches, and I read recently that committing to non-default branches does not count as a contribution; only the merge back into master counts. So it sounds like working on a branch for a couple days, for ten or so commits, will only count as one contribution on the day that branch is merged back into master. I certainly don’t want to let a streak motivate me to have a bad git workflow, so I will happily give up a streak to pick up a better overall workflow.

If these streaks we’ve been hearing about have made you consider starting your own streak, why not begin today? Who knows what you will learn, and what you might accomplish.

Posted in programming | Tagged , , , , , , | Leave a comment

How IPython Notebook and Github have changed the way I teach Python

A live notebook about how to use lists in Python.

A live notebook about how to use lists in Python.

I teach in a small high school in southeast Alaska, and each year I teach an Introduction to Programming class. I recently learned how to use IPython Notebook, and it has completely changed the way I teach my classes. There is much to improve about CS education at the K-12 level in the United States, and sharing our stories and our resources will go a long way towards improving what we offer to students.

My first programming classes

3d Modeling

How I tend to use Python: A model of a koch snowflake, and the real thing printed in stainless steel. I wrote a Python program to generate the OpenSCAD code for printing the model.

Like many people who teach Intro to Programming classes, I don’t have a formal CS degree. I started programming as a kid, and then went on to a degree in Physics. I have always programmed for fun, however, and recently I have started to take my programming more seriously. As I have taken my own programming more seriously, I have been looking for ways to bring it into my teaching.

The first time I taught an introductory programming class, I created lessons each day and came up with exercises and challenges for students to try. Students loved the class, because they spent most of their time trying to apply what they were learning to problems they could solve. They felt like real programmers from the first day of the session. The class was a nice start for me as a programming teacher, but we didn’t get very far. It was just too hard to create curriculum at a pace that kept up with my more capable students. As someone without a formal CS background, there was also plenty I had to clarify for myself along the way.

The second time around, I tried to base the class on an established curriculum. I tried to use Zed Shaw’s Learn Python the Hard Way, because I had heard such consistently good things about it in all the tech communities I participate in. It didn’t work out though, because students just did not catch on to the approach of LPTHW. I know LPTHW asks students to write their own programs, but for people brand new to programming, there was just too much left to them to figure out, even with a teacher in the room. I have one student who really enjoyed it, but for most students we didn’t get a whole lot further than my first class, and they had a lot less fun along the way. This is not a criticism of Zed’s work, it is an admission that I did not use his curriculum in a way that captured my students’ interest in programming. My students seemed to respond better to very specific exercises based on what they just learned, with a more gradual transition into exercises and challenges that ask them to apply their own ideas to what they have just learned.

This year’s class

This time through, I wanted to go back to creating my own lessons, with more efficiency than I had before. I also needed a backup plan for students who might outpace my teaching. I heard about IPython Notebook every day at PyCon this past year, so I decided to take a look at it. Once I got used to it, I couldn’t believe how effective it could be as a tool for teaching.

An active editing session in IPython Notebook. Each cell can either be text or code, and code cells can be run as independent programs.

An active editing session in IPython Notebook. Each cell can either be text or code, and code cells can be run as independent programs.

If you are unfamiliar with IPython Notebook, it basically lets you mix Python code and text on the same page, and lets you run your code blocks as separate programs. IPython Notebook was developed for scientific programming, where you want to solve a larger problem through a series of smaller programs, with notes in between about your progress. This approach allows for a much more efficient workflow than having to write a bunch of separate program files, with your notes in separate text files.

As a teacher, I found this was a perfect tool for creating lessons. I write a few notes about a topic, then write a small program to illustrate how to implement the topic in code. IPython Notebook makes it easy to develop these lessons locally, and GitHub makes it easy to store these notebooks in a publicly accessible place. The IPython Notebook Viewer then makes them available in a reader-friendly format.

My basic workflow:

  • I created a notebook for the syllabus I’d like to follow.
  • For each topic in the syllabus, I create a local notebook which will hold lessons for that topic.
  • When I have time, I create lessons at home and push them live.
  • I always teach with my computer hooked up to a projector. When I clarify something during a lesson, I push the changes to GitHub as soon as the lesson is over.
  • If I cover a new topic in class, I write my examples directly in one of the notebooks. If the live work is clean enough, I push it straight to GitHub. If the live work needs a bit of cleanup, I commit locally and then push it live after class, when I have the chance to look it over more carefully.
  • If a student starts to outpace me, I can steer them into something more established such as Udacity or Coursera. These are the students who are likely to be successful in more independent learning settings.

Results so far

This workflow has been extremely satisfying so far, for me and for my students. We are having as much fun as we had the first year I taught a programming class, but we are covering things much more quickly as well. I can see a number of benefits in this workflow:

  • Students can have a copy of all class materials open on their own computers, and accessible outside of class.
  • We can add and modify exercises and challenges at will, throughout the class.
  • Students get to see some of the tools they will use when they become more proficient, such as git, GitHub, IPython, and others.

What’s next?

I really want to figure out a way to embed programming in my school culture throughout the year. A few thoughts about how to move forward on this goal:

  • Continue to develop the notebooks throughout this session. Some of this involves converting old blog posts into IPython notebooks.
  • Develop a core set of assignments that students can do in any class, that use their programming skills to help them in their other classes. For example, use your understanding of Python’s dictionaries to keep track of the key words you are learning in each of your classes.
  • Set up a system where students who reach a certain level of skill and understanding begin to teach newer students, using our class materials. This would take the pressure off of me to always teach introductory courses, and would let me teach some more advanced classes.
  • Clean up the notebooks, so they stand on their own rather than serving as class notes. Right now, they don’t read well for independent learning. This could be improved, although they probably shouldn’t get too wordy.

Collaboration

If you’d like to play with these notebooks, check out the project page on GitHub. I’d be happy to collaborate on building out these resources, so get in touch if you’d like to contribute. I can be reached through email, ehmatthes at gmail, or twitter @ehmatthes. If you are active on GitHub, you can also leave feedback on Issue #10.

Posted in programming | Tagged , , , , , | 12 Comments

Intro to Programming, Fall 2013

This page includes some links we are using in Introduction to Programming (using Python), for fall 2013.

The index page for class lessons is here. From that page, you can get to any of our class lessons.

We are writing our first code using pythontutor.com. Each time you use pythontutor, choose
“python 3.3” from the drop down list. This will make sure you are using the most recent version of Python, not an older version. Even when we start using a text editor and saving our program files locally, I still encourage you to use pythontutor when you want to see how your code is executed.

Posted in programming | Tagged , , , , , , , | Leave a comment

Cleaning up a code directory

I am configuring a new laptop, and I want to do it a little more cleanly than my last few migrations to a new machine. Rather than simply copying over all my files, I am being quite selective. As I work my way through some archives, I am learning to purge some unneeded files such as .pyc files from code directories.

# Remove all .pyc files from a directory, and all its subdirectories:
# Find only files ending in .pyc, then pipe them to the rm command.
find . -type f -name "*.pyc" | xargs rm -frv

# Remove all virtualenv directories from a directory tree:
find . -type d -name "venv" | xargs rm -frv

In doing this, one source directory went from ~8000 files to ~800 files, and from ~50MB to ~3MB. This also makes me rethink my backup script. I think my next backup script will exclude these files in the first place.

Posted in programming | Tagged , , | Leave a comment

Gittip is About People, not Products

Why “Distributed Genius Grants” is the perfect tagline for Gittip

Gittip | Distributed Genius GrantsIn case you haven’t heard, Gittip is a crowdfunding platform that allows you to make anonymous, recurring donations to people whose work you value. The tagline for Gittip recently changed from “Inspiring Generosity” to “Distributed Genius Grants”. This new tagline, while a small change to the overall project, gets at the heart of what makes Gittip special. The idea of a distributed genius grant, accessible to everyone, could have a transformative impact on the world.

MacArthur Fellows ProgramA “genius grant” is a common nickname for an honor given to a few people each year by the MacArthur Foundation. The Foundation identifies people whose creative work pushes the boundaries of innovation in their given fields. The MacArthur Fellows grant is a no-strings-attached gift of $500,000 to each recipient, spread out over five years. The foundation trusts its recipients to use the gift to further their life’s work. The MacArthur foundation trusts that you will use your funds to do whatever you need to continue your life’s creative work, and avoid the burnout that can come from dealing with the obligations associated with other funding sources.

Gittip is a “genius grant” on a small scale. When someone tips you on Gittip, you receive that money with no strings attached. People making donations through Gittip are making a statement of trust that you will continue to take your work in a positive, open direction.

Gittip: Inspiring GenerosityPeople have asked for different funding mechanisms on Gittip, for example the ability to make one-time donations. I have remained firmly against these alternative mechanisms, in order to develop Gittip’s core mission as far as it can be taken. The notion of “distributed genius grants” gets at some of my previously unarticulated reasons for wanting to stay true to the original model. What kind of person makes a recurring donation to a recipient? A donor who supports the person behind the product they use. Take an independent musician, for example. If I like a single album from an artist who I don’t know well, I probably want to pay the artist a reasonable amount for that album. Platforms already exist to help artists receive these kinds of payments. But if I like an album and I want to support the artist’s ongoing work in creating music independently, Gittip provides the perfect platform through which to do so. I set up a recurring donation, and the artist gets my ongoing support. I have just made a small, recurring “genius grant” to an artist whose work I value. If enough people support this artist, they effectively get long-term support similar to full genius grants.

This new tagline even makes me reconsider my commitment to anonymity on Gittip. The main reason to keep donations anonymous was to ensure that tips do not unduly influence the direction or nature of recipients’ work, as corporate sponsorship inevitably does. But if the core mission of the site is described as “Distributed Genius Grants”, maybe it becomes clear enough to everyone involved that tips are distributed with no strings attached.

Gittip has been a fascinating experiment to watch, and I continue to learn from watching it develop. Thank you @gwenbell for helping all of us articulate a little more clearly the essence of what makes Gittip important.

———————–

Read about my open source education work on gittip

Posted in programming | Tagged , , , , , | 3 Comments

Interpreting the Common Core Standards “Public License”

As a teacher with strong ties to the open source software community, I view the Common Core standards with a bit of skepticism. I see many benefits to having a common set of standards, but I also see some serious red flags in the ecosystem of educational resources that are being created around Common Core. If the Common Core Standards were released under a truly open license, I’d be quite happy with all of these resources. But the Common Core’s “Public License” is not an open license, and that raises some important questions about the resources being developed around these standards.

Open Licenses and the “Four Freedoms”

Truly open licenses are built around the “four freedoms“, none of which have to do with cost:

  • The freedom to use the resource for any purpose;
  • The freedom to modify the resource as you wish;
  • The freedom to redistribute the resource as you wish;
  • The freedom to distribute copies of your modified version of the resource to others.

Examples of truly open licenses in the software world include the Gnu General Public License (GPL), and the MIT license. In the media world, we have Creative Commons licenses which clearly manage and respect these freedoms. If someone releases an educational resource under a license that guarantees these freedoms, then they can accurately call their offering an “open resource”.

The Common Core’s “Public License”

So what does the Common Core’s license allow us to do? Here are two excerpts, taken directly from the license itself, which can help us answer this question:

  • THE COMMON CORE STATE STANDARDS ARE PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.
  • The NGA Center for Best Practices (NGA Center) and the Council of Chief State School Officers (CCSSO) hereby grant a limited, non-exclusive, royalty-free license to copy, publish, distribute, and display the Common Core State Standards for purposes that support the Common Core State Standards Initiative.

Let’s look at each of the four freedoms, and ask if this license grants us these freedoms.

  • Do we have the freedom to use the resource for any purpose?
    • No. We can only use the standards “for purposes that support the Common Core State Standards Initiative”.
  • Do we have the freedom to modify the resource as we wish?
    • No. The standards are protected by copyright, which means we cannot modify them.
  • Do we have the freedom to redistribute the resource as we wish?
    • No. We can only redistribute them, again, “for purposes that support the Common Core State Standards Initiative”.
  • Do we have the freedom to distribute copies of our modified version of the resource to others?
    • No. We can’t modify the standards, so we can’t distribute a modified version of the standards.

As my two-year-old son is fond of saying, “Holy mackerel!” The Common Core’s Public License does not give us any of the four fundamental freedoms of the open source/ open resources movements!

Does it really matter? Some open questions

When a resource is distributed without cost, it is tempting to ignore the four freedoms. The people behind Common Core have not sued anyone for infringement, as far as I know. But it seems pretty risky to build an education system on a resource that one group controls. Here are a couple specific questions to put this in context:

Common Core vs. Alaska Writing standards

An excerpt of the Common Core Writing Standards on the left, and Alaska’s Writing standards on the right. Alaska has “not adopted” the Common Core Standards.

  • The state of Alaska has not adopted the Common Core standards. Yet Alaska’s current standards are clearly lifted straight from the Common Core document. To see for yourself, look at page 58 of Alaska’s English Language standards document and page 45 of the Common Core English Language standardsAre Alaska’s standards legal?
  • I want to create a student-friendly version of the Common Core standards. Rather than develop a companion to the standards themselves, I want to use the organizational structure that Common Core has developed and basically rewrite the standards document in language that is friendlier to students. Is this legal?
  • A company or organization wants to build a tool that allows teachers to develop curriculum efficiently, using the Common Core standards as a way to structure the curriculum. What happens if the Common Core decides this tool does not “support the Common Core State Standards Initiative”?

I ask these questions because teachers and schools need to have control of the resources we use. We need to have publishers supporting our work, rather than continuing to perpetuate a system where teachers and schools are constantly racing to keep up with newly-published standards and curriculum resources. We need to aim for continuous improvement, but that needs to be at a pace that we determine, not the pace that a company or external organization determines.

The license under which major educational standards and resources are released is critical. These licenses tell us who is in control of the current education system. If we are not in control, then I have a fundamental problem with widely-used resources such as the Common Core standards.

Posted in education | Tagged , , , , | 6 Comments