Posts tagged with python

What I Learned Teaching at UNC

This spring semester, I had the honor of teaching JOMC-583 "Multimedia Programming and Production" for the University of North Carolina at Chapel Hill School of Journalism and Mass Communication. The course requires university permission and two prior multimedia programming courses that focus on frontend web development. It was a wonderful opportunity to partner with the university, especially with a department that has shown leadership in recent years with adopting innovative programs and coursework for students interested in the data-driven area of journalism.

The subject matter of the course centered around backend web development with Python and Django and also included other technologies such as git, SQL, and the Unix command line. As a rough outline, the lecture topics were:

  1. Unix command line

  2. Git and Github

  3. Python

  4. Introductory Django

  5. Django views and templates

  6. Django models and data modeling

  7. Frontend development inside a Django project

  8. Miscellaneous topics

  9. Group project time

The course materials were based on Steven King's curriculum for the course from the year prior and is available at

At a high-level, the first half of the course was a mixture of lecture and individual assignments while the second half of the course was spent on two projects. The first development project was completed individually and was small in scale. The second and final project was more ambitious and required collaboration using Github. This served as a nice progression from focusing on concrete skills in isolation to applying those skills and developing further experientially.

One of the group projects was deployed successfully to Heroku and is visible here:

While I think the course was a major learning experience for the students, it certainly was for me as well. It was particularly interesting to see the subject areas that students picked up easily or struggled with and how this often differed with my expectations. In particular, some areas that students picked up quickly were:

  1. The essential Unix command line tools such as: pwd, ls, cd, and so on

  2. Python basics

  3. Python packaging and setup, especially pip and virtualenv

  4. Using Git as a sole contributor

  5. Creating a data model

The students were much quicker to learn these concepts than I anticipated. For instance, we spent two lecture periods focusing on developing skills for the command line, but the first class was enough for most tasks. In the future, I would likely plan on needing only one lecture for that topic.

Some topics that required more reinforcement than anticipated were:

  1. Why writing a custom backend is desirable as opposed to a static HTML site

  2. The semantics of Django URL routing.

  3. How to glue JavaScript code into Django templates

I think the fundamental reason that students struggled with this more than anticipated relates to their arrival to the domain of backend programming from a background of frontend web development.

This was a great experience for me and it was rewarding to see my students succeed in programming with Python and Django. I'm very much looking forward to more opportunities to teach web development in the future.

Headshot of Caleb Smith

Caleb Smith wrote this
on Jun 20, 2015.

Python Beginner’s Night at Astro

Last night we held the first TriPython Python Beginner’s Night. About twenty three people interested in Python attended. Many of them were very experienced developers who answered all kinds of questions. From the very basic to the advanced.

A big thanks to all the Caktus Group folks who attended. You helped a lot of people! Thanks also to the other volunteers who attended. It's really cool to live in a city with so many people who enjoy helping others.

The next free Python Beginner's Night is Monday July 6, 2015 from 6pm to 8pm here at Astro Code School (map). We'll be here on the first Monday of each month with free pizza and Python experts. If you can join us please RSVP on the Meetup page. See you soon!

Headshot of Brian Russell

Brian Russell wrote this
on Jun 19, 2015.

Video - Conditionals in Python

Video - Using with Python 3

Video - Very First Steps with Python

Video - Tips for Using Generators in Python

Video - Implementing Decorators in Python

This screencast provides some insights into implementing decorators in Python using functional programming concepts and demonstrates some instances where decorators can be useful.

In the video, I reference the blog post Python Decorators in 12 Steps by Simeon Franklin for further reading.

Headshot of Caleb Smith

Caleb Smith wrote this
on May 01, 2015.

Video - Functional Programming in Python

In this video our Lead Instructor Caleb Smith presents basic functional programming concepts and how to apply them in Python. Check back later for more screencasts here and on the new Astro YouTube channel.

Headshot of Brian Russell

Brian Russell wrote this
on Apr 24, 2015.

Astro at PyCon 2015

Hello from Montréal, QC! We're here participating in the annual North American 2015 Python Conference.

So far Caleb has helped out at the Django Girls Workshop with three other Caktus Group colleagues.

Caleb teaching at the Django Girls workshop at PyCon2015

I went to the PyCon Education Summit. Great to see folks from around the world, including North Carolina, share cutting edge education ideas. Lots of amazing K-12 and University examples of how Python is teaching programming.

Caleb teaching at Django Girls Workshop at PyCon 2015

We're now hanging out at the Expo telling folks from around the world about Durham and our school. So far I've met people from Poland, Canada, India, Hawaii, and lots of US States. Very fun to represent for North Carolina.

Headshot of Brian Russell

Brian Russell wrote this
on Apr 10, 2015.

PyCon 2015 : See You in Montreal!

Caleb Smith and I are going to Montréal, Quebec, Canada next week for PyCon 2015! It's a huge conference all about the open-source Python programming language. Python is a big part of what we teach here at Astro Code School.

We’ll be at booth #613 in Exhibit Hall 210 in the Palais des Congres. Please come look for us. We’ll have the usual swag like t-shirts for women and men. PLUS we’ll have the very addictive game Ultimate Tic Tac Toe. Play against one another on our big touch screen. It’s harder than it sounds. Will you be a Ultimate Tic Tac Toe champion? Can we win more games than Caktus Group?

Caleb is co-presenting with our Caktus colleagues on Wednesday April 8 from 3:30 p.m. - 5 p.m on Building SMS Applications with Django. He’s also coaching at the Django Girls Workshop April 9. No programming experience required. Just bring a laptop and some energy to learn. You’ll be going through the awesome Django Girls tutorial.

I’ll be attending the Python Education Summit. I’m really looking forward to learning more from other professional and amateur python educators. The talk schedule looks nice!

Are you going to PyCon 2015? What parts of PyCon 2015 are you looking forward too? Tutorial Days, Lightening Talks, or Dev Sprints? Let us know by tweeting at us @AstroCodeschool.

Headshot of Brian Russell

Brian Russell wrote this
on Apr 03, 2015.

Seven Features an Introductory Programming Language Should Have

Python Logo

Python has recently supplanted Java as the most popular introductory teaching language at top U.S. universities. There are many articles covering this fact from the perspectives of computer science faculty at major universities. I wanted to take a moment to add my own thoughts on the subject.

There are several key features of Python that make it more suitable as an introductory language compared to Java:

  1. A more gradual learning curve

  2. Object-oriented programming is not required

  3. Designed for readability

  4. Less verbosity and boilerplate

  5. An interactive shell for exploratory development

I'd like to tease out each of these points. While both languages can be used to write large and complicated programs, the path from an empty directory to a simple and working program is much more straightforward in Python.

Programmers with little experience can use Python to do simple tasks such as web scraping within a few days or weeks of using the language. There are advanced concepts to learn, but the learning curve is more gradual because more can be accomplished in Python with only simpler, more foundational concepts such as variables and control flow.

Courses that use Java as the teaching language focus heavily on object-oriented programming (or "OOP"). While Python is also object-oriented, it is a multi-paradigm language that can also be used with the functional or structured programming paradigms. While it is important to learn OOP eventually, many learners catch on more quickly to the more concrete structured programming paradigm. It is my view that learning about OOP in the level of detail needed to write a Java program, before completing several small programs that work, is a pedagogical mistake that fundamentally puts these steps out of sequence. i.e. A learner should first write small programs before approaching the techniques and concepts used for writing larger ones well.

Furthermore, Python was designed with readability in mind, and is known for mimicing pseudo-code more closely than other programming languages. Learning the keywords and syntax needed for Java programming obfuscates the overall goal of an introductory course; to teach fundamental programming concepts that surpass a given language or problem domain and enable the learner to obtain key insights that will continue to serve them as they learn more computer science and software engineering concepts.

Lastly, like many other languages, Python features an interactive shell that allows the programmer to try small bits of code at a time and to explore the program being developed from within. This shortens the feedback loop of trying out new ideas compared to having separate compile and run steps. The advantages of an iterative approach with a quick feedback loop for a beginner should be obvious.

With all of this in mind, I find it hard to imagine how Java ever became a common introductory language at all. Explanations for this usually center around the importance of object-oriented programming and the ubiquity of Java in the industry. While these are both good reasons to learn Java, possibly even as a second language, they are far from convincing for the purpose of introducing programming.

I would argue that the features of an introductory programming language are:

  1. A shallow learning curve

  2. A clear and consistent language design

  3. Many libraries available for a variety of needs

  4. An interactive environment such as a shell

  5. Light on clutter, boilerplate or superfluous details

  6. An obvious path toward creating small and simple programs

  7. A rapid rate of development

I've outlined how Python meets most of these points already. On the point regarding libraries, in this regard I think Java and Python both feature a rich ecosystem for beginners and experienced programmers alike. However, considering all of these points, I think a number of languages are more appropriate as an introductory teaching language than Java, including at least the following:

  1. JavaScript

  2. Ruby

  3. Scheme

This brings to mind a much more interesting and difficult question. What makes Python a more appropriate first language than each of these? I'll leave this to a future blog post because I think it needs careful and long form comparisons.

I hope to have made clear why I'm glad that major universities are making the shift to Python for introductory courses. In the future, I hope to broaden this argument and describe how Python is the best first language to learn.

Headshot of Caleb Smith

Caleb Smith wrote this
on Mar 01, 2015.