Archive for November, 2018

Is Liveness a critical factor in learning Computer Science? Context, motivation, and feedback for learning programming

My CACM Blog post for November is on the topic of Direct Instruction, why it’s better than Discovery Learning, and how we should teach programming “directly.”

I wonder about the limitations of Direct Instruction.  I don’t think everything can be learned with direct instruction, even with deliberate practice.

At SIGCSE 2016, John Sweller made a provocative claim (that I haven’t yet found in his published papers).  He said that humans must be able to learn higher-order thinking skills.  We’d be dead if we didn’t. However, we cannot teach them.  Students have to figure them out from experience. Is programming a similar kind of task?

I have been studying Spanish on a streak of over 600 days in DuoLingo now. DuoLingo is the best direct instruction I’ve ever had.  Everything I do is deliberate practice — it’s really good at figuring out what I’m not good at, and giving me more problems on that.  I am nowhere near fluent.  I know some words. I can read some. I’m getting better at hearing. I am not fluent.  Maybe learning natural and programming languages both require more than direct instruction.

What leads to fluency, in natural languages or programming languages?  I suspect that part of it is context and motivation.  You have to be in a position to want to say something (in a natural or programming language) in order to learn it.

But I also think it’s about feedback.  I don’t really learn Spanish well because I’m rarely in a position to use it. If I did, I’d get a response to what I said. Can anyone learn to program without trying to write some code and getting feedback on whether it works? The issue of feedback came up several times in the recent discussion about the relationship between teaching programming and teaching composition.

Steven Tanimoto talks about the value of “liveness” in a programming environment (see paper here), which is about the ease of writing code and getting different kinds of feedback on the code. Maybe Liveness encapsulates the kinds of things we need for successful CS learning. Of course, even “liveness” doesn’t give the kind of feedback that a human reader can, but it does shorten the feedback timing loop.

 

 

November 30, 2018 at 7:00 am 17 comments

African-Americans don’t want to play baseball, like women don’t want to code: Both claims are false

I listened to few of my podcasts this summer with our move, so I’m catching up on them now. I just heard one that gave me a whole new insight into Stuart Reges’s essay Why Women Don’t Code.

In Here’s Why You’re Not an Elite Athlete (see transcript here), they consider why:

In 1981, there was 18.7 percent black, African-American players in the major leagues. As of 2018, 7.8 percent.

Why was there such a precipitous drop? David Canton, a professor at Connecticut College, offers three explanations:

I look at these factors: deindustrialisation, mass incarceration, and suburbanization. With deindustrialisation — lack of tax base — we know there’s no funds to what? Construct and maintain ball fields. You see the rapid decline of the physical space in the Bronx, in Chicago, in these other urban areas, which leads to what? Lack of participation.

Suburbanization drew the tax base out of the cities. With fewer taxes in the cities, there were fewer funds to support ball fields and maintain baseball leagues.

The incarceration rates for African-American men is larger than for other demographic groups (see NCAA stats). Canton explains why that impacts participation in baseball:

I can imagine in 1980, if you were 18-year-old black man in L.A., Chicago, New York, all of a sudden, you’re getting locked up for nonviolent offenses. I’m going to assume that you played baseball. I’m arguing that those men — if you did a survey, and go to prison today, federal and state, I bet you a nice percentage of these guys played baseball. Now some were not old enough to have children. And the ones that did weren’t there to teach their son to play baseball, to volunteer in Little League because they were in jail for nonviolent offenses.

There is now a program called RBI, for Reviving Baseball in Inner cities, funded by Major League Baseball, to try to increase the participation in baseball by African-Americans and other under-served youth. There are RBI Academies in Los Angeles, New York, Kansas City, and St. Louis.

So, why are there so few African-Americans in baseball? One might assume that they just choose not to play baseball, just as how Stuart Reges decided that the lack of women in the Tech industry means that they don’t want to code.

I find the parallels between the two stories striking:

  • Baseball used to be 18.7% African-American.
  • Computer Science used to be 40% female.
  • There have been and are great African-American baseball players. (In 1981, 22% of the All-Star game rosters, were African-American, according to Forbes.) There is no inherent reason why African-Americans can’t play baseball.
  • There have been and are great female computer scientists. There is no inherent reason why women can’t code.
  • Today, baseball is only 7.8% African-American.
  • Today, computer science is only about 17% female (in undergraduate enrollment).
  • There are structural and systemic reasons why there are fewer African-Americans in baseball, such as deindustrialization, suburbanization, and a disproportionate impact of incarceration on the African-American community. (Some commentators say that the whiteness of baseball runs much deeper.)
  • There are structural and systemic reasons where there are fewer women in computer science. There are many others, like the thoughtful posts from Jen Mankoff and Ann Karlin, and the heartfelt personal blog post by Kasey Champion, who have listed these far better than I could.
  • Major League Baseball recognizes the problem and has created RBI to address it.
  • The Tech industry, NSF (e.g., through creation of NCWIT), and others recognize the problem and are working to address it. Damore and Reges are among those in Tech who are arguing that we shouldn’t be trying to address this problem, that there are differences between men and women, and that we’re unlikely to ever reach gender equity in Tech.

Maybe there are people pushing back on the RBI program in baseball, who believe that African-Americans have chosen not to play baseball. I haven’t seen or heard that.

If we accept that we ought to do something to get more African-Americans past the systemic barriers into baseball, isn’t it just as evident that we should do something to get more females into Computing?

November 26, 2018 at 8:00 am 1 comment

Literature is to Composition, as Computer Science is to Computational Literacy/Thinking

Coding_Literacy___The_MIT_Press

Annette Vee was visiting in Ann Arbor, and looked me up. We had coffee and a great conversation.  Annette is an English Professor who teaches Composition at University of Pittsburgh (see website here). She published a book last year with MIT Press, Coding Literacy: How Computer Programming is Changing Writing. (I’m part way through it and recommend it!) She knew me from this blog and my other writing about computational literacy. I was thrilled to meet someone who makes the argument for code-as-literacy with a real claim to understanding literacy.

One of the themes in our conversation was the distinction between literature and composition.  (I’m going to summarize something we were talking about — Annette is not responsible for me getting things wrong here.) Literature is about doing writing very well, about writing great works that stand the test of time. It’s about understanding and emulating greater writers.  Composition is about writing well for communicationIt’s about letters to Grandma, and office memos, and making your emails effective.  Composition is about writing understandable prose, not great prose as in literature. People in literature sometimes look down on those in composition.

There’s a similar distinction to be made between computer science as it’s taught in Universities and what Annette and I are calling coding/computational literacy (but which might be what Aman Yadav and Shuchi Grover are calling computational thinking).  Computer science aims to prepare people to engineer complex, robust, and secure systems that work effectively for many users. Computational literacy is about people using code to communicate, to express thoughts, and to test ideas. This code doesn’t have to be pretty or robust. It certainly shouldn’t be complex, or nobody will do it. It should be secure, but that security should probably be built into the programming system rather than expecting to teach people about it (as Ben Herold recently talked about).  People in computer science will likely look down on those teaching computational literacy or computational thinking. That’s okay.

Few people will write literature. Everyone will compose.

November 23, 2018 at 7:00 am 40 comments

MIT creates a College of Computing to integrate across all disciplines

Last month, MIT announced the creation of the MIT Schwarzman College of Computing, with a $1 Billion commitment (see article here).  Below is my favorite part of the press release.  I’ll paraphrase the elements that have me excited about what MIT is going do with this new College:

  • It’s not just about taking CS to the other disciplines. It’s about “allowing the future of computing and AI to be shaped by insights from all other disciplines.”  This is key to Peter Denning’s notion of Computing and not just Computer Science.  Computing is about the rest of the world influencing, pushing, and advancing what we know about computer science.
  • The 50 new positions are going to be in the College and joint with other departments.  That’s a key step to get integration.
  • When they talk about what they’re going to do with this new College, “education” is the first word, and “research and innovation” are second and third.  Does that ordering imply a priority? Will it really keep those priorities? Who knows, but they’re good words.
  • There goal is that every student knows to “responsibly use and develop” computing technologies and AI.  Is MIT going to institute a campus-wide computing course requirement?  Even better would be to make sure that there is significant computing in the disciplinary courses.  The NYTimes article (see here) quotes MIT President Reif as aiming to “educate the bilinguals of the future.”

    He defines bilinguals as people in fields like biology, chemistry, politics, history and linguistics who are also skilled in the techniques of modern computing that can be applied to them.

Yes! That’s an exciting vision.

Headquartered in a signature new building on MIT’s campus, the new MIT Schwarzman College of Computing will be an interdisciplinary hub for work in computer science, AI, data science, and related fields. The College will:

  • reorient MIT to bring the power of computing and AI to all fields of study at MIT, allowing the future of computing and AI to be shaped by insights from all other disciplines;

  • create 50 new faculty positions that will be located both within the College and jointly with other departments across MIT — nearly doubling MIT’s academic capability in computing and AI;

  • give MIT’s five schools a shared structure for collaborative education, research, and innovation in computing and AI;

  • educate students in every discipline to responsibly use and develop AI and computing technologies to help make a better world; and

  • transform education and research in public policy and ethical considerations relevant to computing and AI.

 

November 19, 2018 at 8:00 am 5 comments

How Machine Learning Impacts the Undergraduate Computing Curriculum

I’ve been looking forward to seeing this article in print since Ben Shapiro first talked about this, months and months ago. Ben, Rebecca Fiebrink, and Peter Norvig raise the (reasonable) argument that machine learning is now a central activity in computer science, and should be a core topic in undergraduate computing curriculum. What does that mean for what we teach and how we teach it? It’s something that we ought to be talking about.

The growing importance of machine learning creates challenging questions for computing education…

Changes to the Introductory Sequence…These same two aims can also describe introductory courses for an ML-as-core world. We do not envision that ML methods would replace symbolic programming in such courses, but they would provide alternative means for defining and debugging the behaviors of functions within students’ programs. Students will learn early on about two kinds of notional machine—that of the classical logical computer and that of the statistical model. They will learn methods for authoring, testing, and debugging programs for each kind of notional machine, and learn to combine both models within software systems.

We imagine that future introductory courses will include ML through the use of beginner-friendly program editors, libraries, and assignments that encourage students to define some functions using ML, and then to integrate those functions within programs that are authored using more traditional methods. For instance, students might take a game they created in a prior assignment using classical programming, and then use ML techniques to create a gestural interface (for example, using accelerometers from a smartphone, pose information from a webcam, or audio from a microphone) for moving the player’s character up, down, left, and right within that game. Such assignments would engage students in creating or curating training examples, measuring how well their trained models perform, and debugging models by adjusting training data or choices about learning algorithms and features.

 

Source: How Machine Learning Impacts the Undergraduate Computing Curriculum

November 16, 2018 at 7:00 am 4 comments

What do I mean by Computing Education Research? The Computer Science Perspective

 

Last week, I talked about how I explain what I do to social scientists. This time, let me explain what I do to computer scientists. I haven’t given this talk yet, and have only tried the ideas out on a few people. So consider this an experiment, and I’d appreciate your feedback.

Let’s simplify the problem of computing education research (maybe a case of a spherical cow). Let’s imagine that instead of classes of Real Humans, we are teaching programming to Human-like Turing Machines (HTMs). I’m not arguing that Turing machines are sufficient to represent human beings. I’m asking you to believe that (a) we might be able to create Turing Machines that could simulate humans, like those we have in our classes, (b) RH’s would only have additional capabilities beyond what HTM’s have, and (c) HTM’s and RH’s would similar mechanisms for cognition and learning. (Carl Hewitt has a great CACM blog post arguing that message passing is more powerful than TM’s or first order logic, so maybe these should be HMP, Human Message Passers. I don’t think I need more than TM’s for this post.)

This isn’t a radical simplification. Cognitive science started out using computation as a model for understanding cognition (see history here). Information processing theory in psychology starts from a belief that humans process information like a computer (see Wikipedia article and Ed Psychology reference). Newell and Simon won the ACM Turing award and in their Turing Award lecture introduced the physical symbol system hypothesis, “A physical symbol system has the necessary and sufficient means for general intelligent action.” If we have a program on a Turing machine that gives it the ability to process the world in symbols, our theory suggests that it would be capable of intelligence, even human-like intelligence. I’m applying this lens to how we think about humans learning to program.

This simplification buys me two claims:

  • The Geek Gene is off the table. The Geek Gene is the belief that some people can’t learn to program (see blog post for more). Any Turing machine can simulate any other Turing machine. Our HTM’s are capable of tracing a program. If any HTM can also write code, then all HTM’s can write code. Everyone has the same computational capability. (If HTM’s can all code, then RH’s can all code, because HTM’s have a subset of RH cognitive capabilities.)
  • Learning of our students can be analyzed and understood as information processing. The behavior of Turing machines is understandable with analysis. HTM’s are sophisticated Turing machines. The core mechanism of HTM’s can be analyzed and understood. If we think about our students as HTM’s, we might reason about their learning about computing.

Here are some of the research questions that I find interesting, within this framing.

How do HTM’s learn to program?

All HTM’s must learn, and learn at a level where their initial programming (the bootstrap code written on their tape when they come into our world) becomes indistinguishable from learned capabilities. HTM’s must have built-in programming to eat and to sleep. They learn to walk and run and decipher symbols like “A,” such that it’s hard to tell what was pre-programmed and what was learned. HTM’s can extend their programming.

There are lots of models that describe how HTM’s could learn, such as SOAR and ACT-R. But none so far has learned to program. The closest are the models used to build the cognitive tutors for programming, but those couldn’t debug and couldn’t design programs. They could work from a definition of a program to assemble a program, but that’s not what most of us would call coding. How would they do it?

How would HTM’s think about code? How would it be represented in memory (whether that memory is a tape, RAM, or human brains)? There is growing research interest in how people construct mental models of notional machines. Even experts don’t really know the formal semantics of a language. So instead, they have a common, “notional” way of thinking about the language. How does that notional machine get represented, and how does it get developed?

How do we teach HTM’s to learn to program?

You shouldn’t be able to just reprogram HTM’s or extend their programs by some manipulation of the HTM’s. That would be dangerous. The HTM might be damaged, or learn something that led them into danger. Instead, extending HTM’s programming can only be done by conscious effort by the HTM. That’s a core principle of Piaget’s Theory of Cognitive Development — children (RH’s and HTM’s) learn by consciously constructing a model of the world.

So, we can’t just tell an HTM how to program. Instead, we have to give them experiences and situations where they learn to program when trying to make sense of their world. We could just make them program a lot, on increasingly harder programs. Not only is that de-motivating (maybe not an issue for HTM’s, but certainly is for RH’s), but it’s inefficient. Turns out that we can use worked examples with subgoal labeling and techniques like Parson’s problems and peer instruction to dramatically improve learning in less time.

What native capabilities of HTM’s are used when they learn to code?

We know that learning to read involves re-using more primitive mechanisms to see patterns (see article here). When HTM’s learn to program, what parts of the native programming are being re-used for programming?

Programming in RH’s may involve re-use of our built-in ability to reason about space and language. My colleague Wes Weimer (website) is doing FMRI studies showing that programmers tend to use the parts of their brain associated with language and spatial reasoning. In our work, we have been studying the role of spatial reasoning and gesture in learning to program (see summaries of our ICER 2018 papers). We don’t know why spatial reasoning might be playing a role in learning to program. Maybe it’s not spatial reasoning, but some aspect of spatial reasoning or maybe it’s even some other native ability that is related to spatial reasoning.

How does code work as an external representation of HTM’s, and where does it help?

We can safely assume that HTM’s, like RH’s, would enhance their cognition through the use of external representations. Cognition and memory are limited. Even an infinite tape has limitations in terms of time to access. Human cognitive systems are limited in terms of how much can be attended to at once. RH’s use external representations (writing notes, making diagrams, sketches) to enhance their cognition. We’re assuming that HTM’s have a subset of RH abilities, so external representations would help HTM’s, too.

My students and I talk about a wonderful paper by David Kirsh, Thinking with External Representations (see link here). It’s a compelling view of how external representations give us abilities to think that we don’t have with just our brain alone.

How can program code be a useful external representation for HTM’s? When does it help, e.g., with what cognitive tasks is code a useful external representation? For example, a natural one is modeling and simulation — we can model more complex situations with program code than we can keep in our head, and we can simulate that model for a much larger range of time and possible values. Are there cognitive tasks where code by itself, as a notation like written language or mathematics, can enhance cognition? Here I’m thinking about the ability of code to represent causal relationships (e.g., as in Bruce Sherin’s work) or algebraic forms (e.g., as in Bootstrap) — see here for discussion of both.  I’m intrigued by the idea of the affordances of reading code even before writing it.

What makes programming worth learning for HTM’s?

Why should an HTM learn programming? Let’s assume that an HTM’s basic programming is going to be about staying alive, e.g., Maslow’s hierarchy of needs. When would an HTM want to learn programming?

The most obvious reason to learn programming is because you can get paid to do it. It’s about meeting physiological needs and safety. But, if you can meet those needs doing something that’s easier or more pleasant or has fewer barriers, you’ll likely do that.

Sometimes, you’ll want to learn programming because it makes easier something you want to do anyway. Brian Dorn’s graphic designers wanted to learn programming (see here) because they used Photoshop or GIMP and wanted a way to do that easier and faster. Maybe that’s about safety and physiological needs, but maybe it was about esteem or even self-actualization (if HTM’s care about those things).

Where my simplification breaks down: Real humans learn in situated and social contexts

Our learning theory about RH’s say that they are unlikely to start a new subject unless there’s social pressure to do so (see Pat Alexander’s Model of Domain Learning). Would HTM’s feel social pressure? Maybe.

As I described in the previous blog post, much of my work is framed around sociocultural models of learning, like Lave and Wenger’s situated learning. I use Communities of Practice to understand a lot of the situations that I explore. We can only go so far in thinking about programming as just being inside of individual minds (HTM or RH). Much of the interesting stuff comes when we realize that (a) our cognition interacts with the environments and situations around us, and (b) our motivation, affect, and cognition are influenced by our social world.

Setting aside whether it’s social science or computer science, I am still driven by a paper I read in 1982, which was five years after it was written: “Personal Dynamic Media” by Alan Kay and Adele Goldberg (see copy here).  I want people to be to use coding like they use other literacies, to create a literature, and in a casual, informal and still insightful way.  Mitchel Resnick often talks about people using Scratch to write a card to their mother or grandmother — that’s the kind of thing I want to see.  I want people to be able to make small computational models that answer questions, in the same way that people do “back of the envelope” calculations today. I also want great literature — we need Shakespeares and daVinci’s who convey great thoughts with computing (an argument that Andrea diSessa made recently at the PPIG conference which Felienne Hermans blogged about here.) That’s the vision that drives me, whether I’m using cognitive science or situated learning.

 

November 12, 2018 at 8:00 am 8 comments

When do we know that a programming course is not working for non-CS majors?

There’s a good discussion going on in Facebook that I wanted to make more public and raise as a question here.  The crush of undergraduates in CS today is making it difficult to offer tailored introductory CS courses to different majors.  The problem is particularly acute when designing instruction for future CS teachers.  If you put the CS teachers in the same course as the CS majors, it’s cheaper and easier — you just teach one big course, rather than multiple smaller courses. But is it as effective?

Some of my colleagues suggest that we can design undergraduate introductory computing courses that are effective for both non-CS and CS majors.  Here’s my question: How do you know when it’s not working?  At what point would you admit that the one course option isn’t working? It’s an interesting empirical question.

Here are some possible measures:

  • Learning is a tricky measure.  For any discipline, the majors in that discipline are more motivated to learn more than the outside-the-discipline majors. You can’t expect the non-CS majors to learn more than the CS majors.  Then again, the non-CS majors probably come in knowing less.  If you do pre- and post-tests on CS knowledge, do non-CS majors have as large of a gain as the CS majors?  I don’t know, but in any case, it’s not a great measure for deciding if a class is succeeding for the non-CS majors.
  • Taking more CS courses may be an effective measure, but only if you have more than one course that’s useful to non-CS majors.  If the rest of the classes are about software development, then non-CS majors will probably not want to go on, even if the intro course was effective and well-designed.
  • Retention is a reasonable measure.  If more of the non-CS majors are dropping out from the course than the CS majors, you may not be meeting their needs.
  • My favorite measure is relevance I argued in my blog post on Monday that programming is a practice that is relevant to many communities. Do the non-CS majors see the relevance of computing for them and their community after the introductory course?  If not, I don’t think it’s meeting their needs.
  • Another tricky measure is use. Should non-CS majors be able (after their first course) to build some program that they find useful?  Certainly, if you achieve that goal, you have also achieved relevance.  How do you judge useful?  CS faculty may not be good judges of what a non-CS major would find useful, and CS faculty are most likely going to assess in terms of code quality (e.g., modularization, appropriate variable and function/module names, commenting, code style, etc.), which I consider pretty unimportant for as a measure for the non-CS students’ experience in the first course.

What do you think?  How would you know if your intro course was meeting non-CS students’ needs?

November 9, 2018 at 7:00 am 13 comments

Older Posts


Enter your email address to follow this blog and receive notifications of new posts by email.

Join 4,353 other followers

Feeds

Recent Posts

Blog Stats

  • 1,587,079 hits
November 2018
M T W T F S S
« Oct   Dec »
 1234
567891011
12131415161718
19202122232425
2627282930  

CS Teaching Tips