## Posts tagged ‘Python’

### Updates: NSF Funding to Study Learning with Teaspoon Languages for Discrete Mathematics

A few months before the pandemic started, Dr. Elise Lockwood at Oregon State reached out to me. She’d heard that I was interested in programming for teaching non-CS subjects, and that’s what she was doing. I loved what she was doing, and we started having regular chats.

Elise is a mathematics education researcher who has been studying how students come to understand counting problems. Like “If you have three letters and four digits, how many license plates can you make?” Or “How many two letter words can you make from the letters ROCKET, if you don’t allow double letters?” She’s been exploring having students learn counting problems by manipulating Python programs to generate all the possible combinations, then counting them. (Check out her recent papers on her Google Scholar page, especially those with her student Adaline De Chenne.)

As I said, I loved what she was doing, but Python seemed heavy-handed for this. I was starting to work on our Teaspoon languages. Could we build lighter-weight languages for the same problems?

As I kept reading Elise’s papers, I started working on two possible designs.

In one of them (called Counting Sheets), we play off of students’ understanding of spreadsheets. You can just describe what you want in each column, and the system will exhaustively generate every combination:

Or you can use an “=“ formula that knows how to do very simple operations with sets. Here’s a solution to the two letter words from ROCKET without repeating problem:

This is one of the tools that we’ve been building in support for both Spanish and English keywords (like Pixel Equations, that I talked about last September):

Elise found Counting Sheets intriguing, but she was worried if it would work to make the iterative structures implicit and declarative. Would students need to see the iteration to be able to reason about the counting processes?

So, I built a second Teaspoon language, called Programmed Counting. Here, the loops are explicit, like Python, but the only variable type is a set, and the words and phrases of the language come from counting problems.

Elise was a real sport, trying out the languages as I generated prototypes and finding the holes in what I was doing. We met face-to-face only once, when I went to Portland for SIGCSE 2020 — the one that got cancelled the very morning it was supposed to start. I had lunch with Elise, and we worked for a few hours on the designs. Barb and I went home the next day, and the big pandemic lockdown started right afterwards.

Will these work for learning? We don’t know — but we just got funding from NSF to find out! “We” here is me and PhD student Emma Dodoo, and we’ll be involving Adaline as a consultant. Elise is currently a rotator at NSF, so she’s involved only from the sidelines because of NSF COI issues. Our plan is to run experiments with various combinations of the Teaspoon languages (one or both), standalone and with Python. Do we need Python if we have the Teaspoon languages? Do the Teaspoon languages serve as scaffolding to introduce concepts before starting into Python?

Below is the abstract on the new IUSE grant, as an overview of the project. University of Michigan CSE Communications wrote a nice article about the work, available here. Huge thanks to Jessie Houghton, Angela Li, and Derrick White who turned my LiveCode prototypes into functioning Web versions.

## Abstract for NSF

Programming is a powerful tool that scientists, engineers, and mathematicians use to gain insight into their problems. Educators have shown how programming integrated into other subjects can be a powerful tool to enhance learning, from algebra to language arts. However, the cost is learning the programming language. Few students in the US learn programming — less than 5% of high school students nationwide. Most students do not have the opportunity to use programming to support ™ learning. This project is investigating a new approach to designing and implementing programming languages in classrooms: Task-specific programming (TSP) languages. TSP languages are explicitly design for integration in specific classes, to meet teacher needs, and to be usable with less than 10 minutes of instruction. TSP languages can make the power of programming to enhance learning more accessible. This project will test the value of TSP languages in discrete mathematics, which is a gateway course in some computer science programs.

The proposed project tests the use of two different TSP languages and contrasting that with a traditional programming language, Python. The proposed work will contribute to understanding about (1) the role of programming in learning in discrete mathematics, (2) the value of task-specific languages to scaffold learning, (3) how alternative representational forms for programming influence student use of TSP languages, and (4) how the use of TSP languages alone or in combination with traditional languages enhance students’ sense of authenticity and ability to transfer knowledge.

### Media Computation today: Runestone, Snap!, Python 3, and a Teaspoon Language

I don’t get to teach Media Computation1 since I moved to the University of Michigan, so I haven’t done as much development on the curriculum and infrastructure as I might like if I were teaching it today. I did get a new version of JES (Jython Environment for Students) released in March 2020 (blog post here), but have rarely even started JES since then.

But using Jython for Media Computation is so 2002. Where is Media Computation going today?

I’ve written a couple of blog posts about where Media Computation is showing up outside of JES and undergraduate CS. Jens Moenig has been doing amazing things with doing Media Computation in Snap! — see this blog post from last year on his Snap!Con keynote talk. SAP is now offering a course From Media Computation to Data Science using Snap! (see link here). Barbara Ericson’s work with Runestone ebooks (see an example blog post here) includes image manipulation in Python inside the browser at an AP CS Principles level (see example here). The amazing CS Awesome ebook that Beryl Hoffman and Jen Rosato have been doing with Barb for AP CS A includes in-browser coding of Java for the Picture Lab (see example here).

I was contacted this last January by Russ Tuck and Jonathan Senning. They’re at Gordon College where they teach Media Computation, but they wanted to do it in Python 3 instead of Jython. You can find it here. It works SO well! I miss having the image and sound explorers, but my basic demos with both images and sounds work exactly as-is, with no code changes. Bravo to the Gordon College team!

Most of my research these days is grounded in Task-Specific Programming languages, which I’ve blogged about here (here’s a thread of examples here and here’s an announcement of funding for the work in social studies). We now refer to the project as Teaspoon Computing or Teaspoon Languages — task-specific programming => TSP => Teaspoon. We’re adding a teaspoon of computing into other subjects. Tammy Shreiner and I have contributed a chapter on Teaspoon computing to a new book by Aman Yadav and Ulf Dalvad Berthelsen (see announcement of the book here).

We have a new Teaspoon language, Pixel Equations, that uses Media Computation to support an Engineering course in a Detroit Public School. Here, students choose a picture as input, then (1) enter the boolean equations for what pixels to select and (2) enter equations for new red, green, and blue values for those pixels. The conditionals and pixel loops are now implicit.

In several of our tools, we’re now exploring bilingual or multilingual interfaces, inspired by Sara Vogel’s work on translanguaging (see paper here) and Manuel Pérez-Quiñones’s recent work on providing interfaces for bilingual users (see his TED talk here and his ACM Interactions paper here). You can see in the screenshot below that colors can be referenced in either English or Spanish names. We’re now running participatory design sessions with teachers using Pixel Equations.

I’m planning a series of blog posts on all our Teaspoon languages work, but it’ll take a while until I get there.

1. For new readers, Media Computation is a way of introducing computing by focusing on data abstractions used in digital media. Students write programs to manipulate pixels of a picture (to create photo filters), samples of a sound (e.g., to reverse sounds), characters of a text, and frames of a video (for video special effects). More at http://mediacomputation.org

### Confusion over the forms of programming problems: Mathematics/Physics versus CS

I’m teaching Media Computation again this semester, about 250 students (over 50% female) in a huge lecture hall.  It’s hard to wander the room to answer questions, especially during peer instruction, but we do it anyways.

I’ve been thinking a lot about one question on the first quiz in week #2 of the class.  All my students are Georgia Tech undergraduates but not-CS majors, so, very smart, lots of math and science background, but almost no programming background.

Here was one of the two problems that had the lowest score. Students were to write down what this program would print.

```def computeSalary():
rate = 10.00
hours = 40
salary = hours * rate
hours = 30
print salary
increase = 1.00
salary = hours * (rate + increase)
print salary```

I suspect most teachers would think that this is a pretty standard first semester, even first couple weeks problem. I certainly did. I even discussed almost the exact same program in lecture.

The most common wrong answer was to write only what the second print statement generated. The first print statement was ignored.

During the last 5-10 minutes of the quiz, almost everyone was gone, and I answered lots of questions from the remaining students — picking my way through the narrow aisles in the lecture hall. They were struggling, so one might expect that they would try to get clues by asking questions. This was a problem that they asked lots of questions about.

I was struck by the words that students used when they described what was the one number that they were writing. One told me that the number she wrote down was the “result” of the function. Another told me that that was the “answer.” I came away with the sense that the students were thinking about the program as a mathematics function or a physics story problem.

We often talk about how computer programs might lead to misconceptions for students because of flawed transfer from mathematics. For example, Python functions have mutable data, use the “=” sign in a non-mathematical way, and have side effects. I wonder if the confusion here is about the similarity in form of the problem. Students see a series of equations in math, or a description of a situation in physics, and the answer is a number, an answer, a single result. Not so with programs — it’s a series of statements (like those others), but there may be more than one thing that the program does. We’d need to do real research to see if there is anything to this, not just me noting anecdotal comments from a half dozen students.

### Stanford CS department updates introductory courses: Java is Gone

Stanford has decided to move away from Java in their intro courses. Surprisingly, they have decided to move to JavaScript.  Philip Guo showed that most top CS departments are moving to Python.  The Stanford Daily article linked below doesn’t address any other languages considered.

The SIGCSE-Members list recently polled all of their members to talk about what they’re currently teaching.  The final spreadsheet of results is here.  Python appears 60 times, C++ 54 times, Java 84 times, and JavaScript 28 times.  I was surprised to see how common C++ is, and if Java is dying (or “showing its age,” as Eric Roberts is quoted below), it’s going out as the reigning champ.

When Java came out in 1995, the computer science faculty was excited to transition to the new language. Roberts wrote the textbooks, worked with other faculty members to restructure the course and assignments and introduced Java at Stanford in 2002. “Java had stabilized,” Roberts said. “It was clear that many universities were going in that direction. It’s 2017 now, and Java is showing its age.” According to Roberts, Java was intended early on as “the language of the Internet”. But now, more than a decade after the transition to Java, Javascript has taken its place as a web language.

ADDENDUM: As you see from Nick Parlante’s comment below, the JavaScript version is only an experiment.  From people I’ve talked to at Stanford, and from how I read the article quoted above (“more than a decade after the transition to Java, Javascript has taken its place”), I believe that Stanford is ending Java in CS106.  I’m leaving the title as-is for now. I’ve offered to Marty Stepp that if CS106 is still predominantly Java in one year, I will post a new blog post admitting that I was wrong.  Someone remind me in April 2018, please.

### Where are the Python 3 Libraries for Media Computation

My Blog@CACM post for this month is on JES, the Jython Environment for Students, which at 14 years old and over 10,000 downloads, is probably one of the oldest, most used, and (by some definition) most successful pedagogical Python IDE’s.

The SIGCSE Members list recently had a discussion about moving from Python 2 to Python 3. Here’s a description of differences. Some writers asked about MediaComp. With respect to the Media Computation libraries, one wrote:

I’m sad about this one, because we use and like this textbook, but I think it’s time to move to Python 3.  Is there a compatible library providing the API used in the text?

Short answer: No. There are no compatible Media Computation libraries for CPython 2 or 3.

We keep trying. The latest attempt to build Media Computation libraries in CPython is here: https://github.com/sportsracer48/mediapy. It doesn’t work on all platforms yet, e.g., I can’t get it to load on MacOS.

We have yet to find a set of libraries in Python that work cross-platform identically for sample-level manipulations of sounds. For example, PyGame’s mixer object doesn’t work exactly the same on all platforms (e.g., sampling rates aren’t handled the same on all platforms, so the same code plays different speed output on different platforms). I can do pixel-level manipulations using PIL. We have not yet tried to find libraries from frame manipulations of video (as individual images). I have just downloaded the relevant libraries for Python 3 and plan to explore in the future, but since we can’t make it work yet in Python 2 (which has more mature libraries), I doubt it will work in Python 3.

• I have been building Media Computation examples in GP, a blocks-based language (see post here).
• Jeff Gray’s group at U. Alabama has built Blockly-like languages Pixly and Tunely for pixel and sample level manipulations.
• Cynthia Lee at Stanford has been doing Media Computation in her classes in MATLAB and in C++
• The Calico project supports Media Computation in IronPython (based on Python 3) and many other languages, because it builds on .NET/MONO which has good multimedia support.
• We’re able to more and more in JavaScript-based Python implementations (like Pythy and Runestone), because JavaScript has excellent cross-platform multimedia support.

When we did the 4th edition of our Python Media Computation textbook, I looked into what we’d have to change in the book to move to Python 3. There really wasn’t much. We would have to introduce `print` as a function. We do very little integer division, so we’d have to explain that. The focus in our course (non-technical majors, first course) is at a higher level than the differences between Python 2 and 3. I am confident that, at the end of our course, the majority of our students would understand the differences between Python 2 and 3. As we move more to browser-based IDE’s, I can support either Python 2 or 3 syntax and semantics. Preparing students for industry jobs using exactly CPython 3 is simply not a priority in our course.

### Do blocks equal “making” and text equal “coding”? Doing MediaComp in Blocks-Based Languages

Interesting perspective from a blogger in the Scratch community, liked below.  I do frequently hear the pattern described in the post quoted below.  “I’ve started by daughter/niece/local-school on Scratch, and now I want to know how to move them into something ‘real’ (e.g., text).”  I typically point them to amazing things that can be done in Scratch (like Alex Ruthmann’s beautiful livecoding of music in Scratch).

I recently got a chance to play with GP, a new programming language from John Maloney (of Scratch fame), where all blocks and texts are isomorphic.  There’s a slider that lets you switch from one to the other.  Even the debugger and class browser show up with tiles.  Where does that play out in this debate?  GP is the first blocks-based language I’ve used with the right primitives to do MediaComp, so I built one of my examples in it.  Took me about three times as much time to write and four times as much space (in screen real estate) as in Python (even with John looking over my shoulder guiding me).  Maybe that’s not a bad thing — maybe that encourages a different style of use.  Next time I try something like that, I’m far more likely to think about building my own blocks and using more abstraction to save on dragging-and-fitting effort.

I’ve been a part of the Scratch community for about 8 years now (yes, really). During this time, I’ve noticed a pattern that seems to apply to a lot of people:

join Scratch => create projects => discover text-based programming => quit Scratch because of “real programming”

Note the scare quotes around “real programming”. Generally, a “real” programming language is text-based (C, Python, etc.) and apparently qualifies as real because it’s used by well-known developers for something.

Obviously I disagree with disqualifying Scratch as a real programming language.

### JES 5.02 Now Released, and Media Computation 4th Edition Slides Available

JES 5.02 is now released at https://github.com/gatech-csl/jes/releases/tag/5.020.  I have links to all the main downloads at http://mediacomputation.org .

This is a maintenance release.  Thanks to Nina Koch’s student, Henry, we have fixes for colorizing and some other problems.  Henry has also written code to allow for capture of keystrokes and mouse movement in a picture window, so that you could build some simple games.  I’ll save that for JES 5.10.
I don’t do JES releases that often, so in-between, I forget how painful cross-platform development is. JES is all written in Java and Jython, which means we “write once, test everywhere.”  I developed mostly on Mac OS X, but makensis (for Windows Installers) doesn’t work on Mac OS X.  So I ran Ubuntu in VirtualBox to build the Windows installer and test the Linux version.  But I still had to test on Windows (e.g., to make sure that the Sound Explorer was fixed).  It’s all details —  ls here vs. dir/w there, can’t install Oracle Java from Ubuntu installer, remembering sudo apt-get, Lenovo toolkit updater interrupting installations…
From Github:
Fixes in JES 5.02 (with many thanks to HenryStevens and sportsracer48 for fixes):
• Fixes a problem if you quit during raw_input that you can’t do another raw_input
• Makes the Sound explorer fully functional again
• Fixes colorizing
• Makes autosave work again
• Unicode characters in input file get flagged. (Jython can’t execute a line with unicode characters on it.)

You can find all the fourth edition Powerpoint slides (including a 68Mb zip of all of them) at http://coweb.cc.gatech.edu/mediaComp-teach/60. I’ve put some of the Peer Instruction question slides into the chapter PPT slide decks, but you can find more at the instructors-only website (see the Media Computation website for more on the teacher website).

Most of the changes are in the early chapters. Chapter 3 on text and language manipulation is all new. The latter chapter PPT slide decks have a few new slides in each deck, including:

• Creating state-preserving versions of picture manipulation functions in Chapter 16 on Functional Programming
• Subclassing Picture and Sound to move functions into methods in Chapter 17 on Object-oriented Programming
• Recursive turtle patterns, which are possible with an improved Turtle class in JES 5 in Chapter 17

### Fourth edition of Python Media Computation released today: Teacher resources and desirable difficulties

According to Amazon, the Fourth Edition of the Python Media Computation book is released today (see page here). That’s the new cover above. I’ve been working on the 4th edition for most of the summer. Some of the bigger changes are:

• Before we manipulate pictures, we manipulate letters, words, and language, e.g., build “MadLib” and “koan” generators, and encoding and decoding keyword ciphers. Language is a medium, too, and it’s easier to get started (for some folks) with the smaller-iteration loops of text before getting to the thousands-of-iterations loops of pixels in a picture. It’s an optional chapter — everything introduced there gets introduced again later.
• Since the new version of JES fixed a round-off error in the Turtle class, we can do recursive turtle manipulations now (which tended to get messed up in earlier forms of JES).
• I juggled content around so that we do more with conditionals and querying the pixel for its position, before we introduce nested loops. Nested loops are really hard for students, and I learned (from seeing the code that my students wrote) that they can do far more than I’d guessed with single loops — even with multiple pictures. I included more of that.
• I have tried (for the last two editions) to provide screen-scraping examples, e.g., writing code to pull weather, news, or friends’ information from websites.  It’s getting harder and harder to write that kind of code.  Instead, I decided to provide more code that parses CSV files, as can be found at Open Data Journalism sites (like at The Guardian) and sources like the US Census.  The examples are still about parsing out useful information, but it’s a lot easier to parse CSV and encouraged at these sites.
• There are more end of chapter problems, and new pictures.  And trying to catch all the errors in the Third Edition that master teachers like Susan Schwartz (at West Point) found.

We’re working on teacher resources now. Currently in development (aiming to have ready in the next couple months) the Powerpoint slides for each chapter of the book, a collection of all the code in the book for teachers, and a solutions manual for every end of chapter problem. These are surprisingly controversial. There are lots (mostly University) teachers who think that I shouldn’t provide any of these resources — teachers should be able to develop all of those themselves. Most of the high school and community college teachers I know appreciate having them.

In searching for the Fourth Edition on Amazon, I read the comments on the Third Edition (see here). Authors probably shouldn’t read the reviews of the book — they’re painful. But I did, and even worse, I actually responded.

Here is a quote from one, titled “False Advertising.”

Its biggest problem: false advertising. This is NOT a book on Python, it’s about JYTHON – A Java based imitation of Python.
Why? Well, there’s some pretty software, available to download, which uses the the JRE. The author chose to stick with this “easy learning environment” and basically cripple anyone wanting to write Python code for Blender, Maya, Android etc.

You may learn to program from this text, but don’t expect a trouble-free life when you get exposed to the real language.

Here was my response:

Everything in this book is useful when wanting to write Python code for Blender, Maya, Android, etc. This is an introductory book on data, loops, conditionals, and objects. Those parts of Python are identical in this book and in the Python that you’ll use in Blender, Maya, and Android. For introductory Python programming, Jython and CPython are exactly the same.

I was surprised to see the original commenter responded. His point was that some kinds of friction, in dealing with the “real world” is desirable:

As an introductory book, I would expect a section on how to install and configure Python. Written covering Windows, Linux, and the Mac OSX. There is no such section; the whole point of Jython is to “hide” this technical level. Which is fine for learning loops etc. but leaves a student lost when encountering Python out in the real world.

It’s an interesting perspective, kind of a “rugged individualism” approach. I do agree with the notion of desirable difficulties in learning (see more here),  but don’t agree that installing Python is one of those.  Do most Python programmers install Python themselves, or is it already installed on the servers, computers, etc. that they will be programming? Is it a critical part of learning a language? Is it significantly different than installing JES (try that here)? Are you “lost” and unable to program if you don’t install it yourself first?

A sad addendum to this story: Our Media Computation data structures book (see the Amazon page here) has gone out of print. The publisher didn’t notify us. Someone approached us about using the book, and was told that it was out of print. When I queried Pearson, they admitted it. More, because it’s not out of print everywhere (I guess it’s available in some non-US markets), Pearson won’t let us post the content anywhere. It’s a dead book now.

### African-American students preference for graphical or text-based programming languages depended on career goals

One of the results from Betsy DiSalvo’s dissertation on Glitch (see a post on that work) that I found most interesting was that there wasn’t a clear winner between graphical, drag-and-drop programming (Alice) and text-based programming (Python).  She has now written up that part of the dissertation work, and it’s linked below.

To determine appropriate computer science curricula, educators sought to better understand the different affordances of teaching with a visual programming language (Alice) or a text-based language (Jython). Although students often preferred one language, that language wasn’t necessarily the one from which they learned the most.

### JES 5 Now Released: New Jython, Faster, Updated Watcher, with Jython Music

Matthew Frazier is an undergraduate at North Carolina State University who contacted me this last Spring.  He was going to be in Atlanta for a couple of months and was looking for a research opportunity.  Barbara and I had just been talking about how JES needed to be updated.  I checked his references and hired him without ever meeting him.  Wow, did that work great!
JES 5 (the Jython Environment for Students) has just been released at: https://github.com/gatech-csl/jes/releases/tag/5.010.  Matthew did a great job updating our workhorse for Media Computation Python (which was originally developed in Summer 2002 and is still used daily).  JES includes a full implementation of Jython, plus support for media manipulation — libraries, help functions, and explorers for looking at individual pixels and samples. Here’s a one-screen overview of JES (click on it to make it bigger):
JES window to left with program area and command area (REPL), Watcher button for debugger, two image explorers, and one sound explorer.  Help is under JES Functions menu and Help menu.
Some of the things he did for JES 5 include:
• First, we’re on github!  Come join us in stomping out bugs and making JES even better!
• Upgrading the Jython interpreter to version 2.5, making available new language features and speeding up many user programs.  I have been working on the 4th edition of the Python MediaComp book this summer, and have introduced the time library so that users can actually time their algorithms (one of those CS Principles ideas), so I had ready-made programs to run in both JES4.3 and JES5.0.  The speed doubled.
• Adding code to JES and the installers to support double-clicking .py files to open them in JES, on all supported platforms.
• Bundling JMusic and the Jython Music libraries, allowing JES to be used with the text “Making Music with Computers” by Bill Manaris and Andrew Brown.  This is super exciting to me.  All of their examples (like these) work as-is in JES 5 — plus you can do sampled sound manipulations using the MediaComp libraries.  The combination makes for a powerful and fun platform for exploring computation and sound.  My thanks to Bill who worked with us in making everything work in JES.
• Adding a plugin system that allows developers to easily bundle libraries for use with JES.
• Fixing the Watcher, so that user programs can be executed at arbitrary speeds.  This has been broken for a long time, and it’s great to have it back.  When you’re looking for a bug in a program that loops over tens of thousands of pixels or sound samples, the last thing you want is a breakpoint.
• Adding new color schemes for the Command Window, which allow users to visually see the difference between return values and print output.  This was a suggestion from my colleague Bill Leahy.  Students when first learning return can’t see how it does something different from printing.  Now, we can use color to make the result of each more distinctive.  Thanks to Richard Ladner at ACCESS Computing who helped us identify color palettes to use for colorblind students, so we can offer this distinction in multiple color sets.

• Fixing numerous bugs, especially threading issues.  When we first wrote JES, threading just wasn’t a big deal.  Today it is, and Matthew stomped on lots of threading problems in JES 5.  We got lots of suggestions and bug reports from Susan Schwartz, Brian Dorn, and others which we’re grateful for.

Thanks to Matthew for pulling this all together!  Matthew’s effort was supported by NSF REU funding.

### Python is the most popular intro language: But what about CS Principles?

Philip Guo did an analysis of what top CS departments teach in their introductory courses (see link below) and found that Python now tops Java.  MATLAB tops C and C++ (though not if these are combined), and Scheme and Scratch are near the bottom.

Philip’s analysis did include CS0 and CS1 courses, which points to a problem for adoption of CS Principles as an Advanced Placement exam.  Scratch is the only one of the popular CS Principles languages now used in the CSP Pilots that is also being used in CS departments.  Other CSP popular languages include App Inventor, Alice, Processing, JavaScript, and Snap!.  Those don’t appear in Philip’s results to any significant degree.

It’s reasonable to say that an AP will only succeed (e.g., students will take it) if they can get credit or placement for the exam in college or university.  Typically, colleges and universities give credit for courses that are currently taught.  Will we see colleges and universities start teaching CS Principles?  Will they give credit for a course that they don’t teach? For languages they don’t teach?  Maybe we’ll see more of an influx of CSP languages and courses into colleges and universities. I predict that we won’t.

Scratch is the only visual, blocks-based language that made this list. It’s one of the most popular languages of this genre, which include related projects such as Alice, App Inventor, Etoys, Kodu, StarLogo, and TouchDevelop. The creators of these sorts of languages focus mostly on K-12 education, which might explain why they haven’t gotten as much adoption at the university level.

### Seeking advice on Python Media Computation, Fourth edition (for Q1 2015)

Pearson has asked me to update our Python Media Computation book, “Introduction to Computing and Programming: A Multimedia Approach.”  This will be the fourth edition.  I plan to address the errata (as well as the ones I haven’t yet posted to the website), add new assignments, and change out the pictures (a lot of those pictures are 12 years old now).  I think I’m going to give up on trying to do screen-scraping off a live website — they keep changing too fast.  Instead, I might add something about how to parse CSV files, which are common and useful.

I have a couple of bigger ideas for changes, and I’d appreciate feedback from readers. (And I’m certainly interested in other advice you might give me.)

(1) CPython cross-platform libraries have come a long way since the 3rd edition was written. It’s likely that we could write a media library for CPython that works much like media library in JES. A CPython version of Media Computation would likely be faster. We probably would not re-create JES in CPython. It will take some time to develop a CPython version, so a Jython/JES-based 4th edition could be available in early 2015 (aiming to be out before SIGCSE 2015), but a CPython version would probably be mid-2015.

• (a) Is a CPython version something that you would find interesting and worth adopting?
• (b) Would you have a preference for one or the other? Or would you see value in having both versions?

(2) At Georgia Tech, we have started teaching the book with a brief excursion into strings and lists before introducing pictures. We talk about the medium as being language or text, and we manipulate characters in the strings using algorithms like those we later use with pixels in a picture or samples in a sound. For example, we can “mirror” words as we later mirror sounds or pictures. The advantage is that students can see all the characters in the string, and print out every step of the loop — where neither of those is reasonable to do with pictures or sounds.

We’re considering adding an OPTIONAL chapter at the beginning of the book in the 4th edition. We wouldn’t remove the introduction to loops in Chapter 3. We would move some of the string processing from Chapter 10 into this new Chapter 2.5, but leave methods and file I/O for Chapter 10. You would be able to use the book as-is, but if you want to start with characters and words as a text medium first, we would support that path, too.

• Does that seem like a chapter that you would find useful? Or would you rather just keep the book with the chapters as they are now?

Thanks for any advice you would like to give me on producing the 4th edition of the book!

### Thoughts from Toronto on teaching code to librarians

The blog post linked below felt close to home, though I measure it differently than lines of code.  The base point is that we tend to start introductory programming courses assuming way more knowledge than is already there.  My experience this semester is that we tend to expect students to gain more knowledge more quickly than they do (and maybe, than they can).

I’m teaching Python Media Computation this semester, on campus (for the first time in 7 years).  As readers know, I’ve become fascinated with worked examples as a way of learning programming, so I’m using a lot of those in this class.  In Ray Lister terms, I’m teaching program reading more than program writing.  In Bloom’s taxonomy terms, I’m teaching comprehension before synthesis.

As is common in our large courses at Georgia Tech (I’m teaching in a lecture of 155 students, and there’s another parallel section of just over 100), the course is run by a group of undergraduate TA’s.  Our head TA took the course, and has been TA-ing it for six semesters.  The TA’s create all homeworks and quizzes.  I get to critique (which I do), and they do respond reasonably.  I realize that all the TA’s expect that the first thing to measure in programming is writing code.  All the homeworks are programming from a blank sheet of paper.  Even the first quiz is “Write a function to…”.  The TA’s aren’t trying to be difficult.  They’re doing as they were taught.

One of the big focal research areas in the new NSF STEM-C solicitation is “learning progressions.”  Where can we reasonably expect students to start in learning computer science?  How fast can we reasonably expect them to learn?  What is a reasonable order of topics and events?  We clearly need to learn a lot more about these to construct effective CS education.

I’m not going to articulate the next few orders of magnitude, both because they are not relevant to beginner or intermediate programmers, and because I’m climbing the 1K → 10K transition myself, so I’m not able to articulate it well. But they have to do with elegance, abstraction, performance, scalability, collaboration, best practices, code as craft.

The 3am realization is that many, many “introduction” to programming materials start at the 1 → 10 transition. But learners start at the 0 → 1 transition — and a 10-line program has the approachability of Everest at that point.

### Try an Hour of Code in an Ebook for #CSEdWeek

It’s CSEd Week this week. Code.org and Computing in the Core have effectively merged now, and that’s the organization that owns and promotes CSEd Week. The big focus this year is the Hour of Code — getting all students to do some kind of coding activity for one hour. There are a lot of tutorials now available at the CSEdWeek site.

As readers of this blog now, one of my research activities is to create an electronic book to support high school teachers learning computer science. (Here’s our project webpage.) We’ve been exploring ideas like how best to create videos about computer science (hint: use subgoal labels!) and how to reduce cognitive load (hint: Parson’s problems). We’re also working on multi-modal explanations (evidence suggests that audio narration for code is more effective than text descriptions) and worked examples.

Barb Ericson put together an Hour of Code activity using some of our ideas for learning Python with turtles here, as an Hour of Code activity: http://interactivepython.org/runestone/static/IntroPythonTurtles/index.html. Please do try it and let us know what you think!

If you have an Hour of Code activity that isn’t making it to the main CSedWeek.org site, please feel free to link to it here in the comments!

### Visiting West Point to give the Castle Lecture

Barbara Ericson and I gave the Castle Lecture at West Point in April.  The Castle Lecture is a big deal — we spoke before the entire first-year class at West Point.  (Last year’s lecture was David Ferrucci, PI of the IBM Watson project.)  We received this honor because West Point requires Computer Science of everyone, and this is the first year that they all the first years used our Media Computation Python textbook in that class.  So, we got a chance to lecture to 1200 future Army officers and their instructors who all knew Media Computation.  It was a stunning experience.

The whole day was amazing.  If you’ve never been to West Point, I highly recommend that you take the opportunity.  The campus is beautiful.  The traditions and stories about the place are amazing.  There’s such a sense of history, such a buzz about the place.  We ate lunch with a group of cadets (in an absolutely enormous mess hall where thousands of students eat lunch in 20 minutes) and were deeply impressed. These are undergraduate students who are making a huge commitment to service to their country.

The biggest intellectual treat for me was learning more about their course, IT 105.  700 students every semester take the course — in groups of 20.  16 instructors are involved in teaching the course.  We met with the instructors who teach just about nothing but IT 105, but also met some of the other West Point EECS instructors who teach a section or two of IT 105 along with their other courses.  (Like Dr. Tanya Tolles Markow, a GT alumna, who teaches IT 105 and database classes.)

The person who makes this all work is Susan K. Schwartz (CAPT, USN, Ret).  Her attention to detail is phenomenal.  Susan is going to give me her errata for the third edition when she finishes this semester, which is more detailed than all the corrections that all instructors have sent me for both of the previous editions combined.  Susan creates detailed lecture notes and assignments that drive all the sections for every day across the entire semester.  All the students who take the course take the same exams, so Susan provides enough detail so that all the instructors know what to do in each class so that all students get to the finish line.

Barb and I each got to sit in one section.  This is the opposite of a MOOC.  The teacher knows every student.  She (I attended one of Susan’s classes) calls on individual students, prods students to engage, and gives them activities in class.  It’s small, interactive, and individualized.  Yet, there are 700 students taking it at once.  It’s an enormous effort to make that large of a class work such that students can all have that small class experience. We’re going to try to get Susan’s materials available to other Media Computation teachers.

The lecture was fun and exciting to do. We talked about how media was going to influence them for the rest of their lives.  I gave a brief audio lecture, then we talked about computers that can process all that we can hear and see, and have the processing power of ten year’s forward.  What does that mean for the rest of their lives?  Barb gave a great overview of advances in robotics and cyber-security and even prosthetics. Afterward at the reception, we each had 9-12 cadets asking us follow-up questions for about an hour.  We got back to the Thayer Hotel (what a place!) just buzzing from the amazing adventure of the day.