Sorting Is Boring: Computing Education Needs to Join the Real World, like MediaComp and worked examples 

March 7, 2015 at 8:29 am 30 comments

Agree that we get it backwards in computing education.  We ought to do more with worked examples (a form of “word problems”) — see the argument here.  The point of Media Computation has always been to focus on relevance — what the students think that a computer is good for, not what the CS teacher thinks is interesting (see that argument here).

There are people who love math for math’s sake and devote themselves to proving 1 + 1 = 2. There are more people, however, who enjoy using math to prescribe medication and build skyscrapers. In elementary school, we use word problems to show why it’s useful to add fractions (ever want to split that blueberry pie?) or find the perimeter of a square. We wait until college, when math majors choose to devote four years towards pure math, to finally set aside the word problems and focus on theory. We do so because math is a valuable skill that is used in so many different professions and contexts, and we don’t want kids to give up on math because they don’t think it’s useful.

So, why does computer science start with theory and end with word problems?

via Sorting Is Boring: Computer Science Education Needs to Join the Real World | Jessie Duan.

Entry filed under: Uncategorized. Tags: , , , , , .

UToronto TA’s and graduate student instructors on strike: Pay and teaching are inversely correlated in Universities today WiPSCE 2015 Call for Papers and Participation

30 Comments Add your own

  • 1. shriramkrishnamurthi  |  March 7, 2015 at 8:40 am


    • 2. Mark Guzdial  |  March 7, 2015 at 8:42 am

      Which? There were a couple in this piece: worked examples/word problems vs. theory; interesting problems vs. sorting.

      • 3. shriramkrishnamurthi  |  March 7, 2015 at 10:13 am

        I find all these distinctions somewhat bogus.

        Bonne (#4) and Franklin (#5) have done a nice job of explaining why this is unfair to sorting. As another example, there are these things called search engines; they find a bunch of relevant hits; but then they present them 10-per-page; and people don’t go past the first page, so the most relevant ones should go first; so you really want to the results.

        As for word problems vs theory, it feels like setting up a strawman. Obviously, presenting things as pure theory rather than in some sort of context is not a great idea for beginners. But who really does that?

        • 4. Mark Guzdial  |  March 7, 2015 at 10:19 am

          The first paper session I sat through at SIGCSE 2015 was on teaching CS1 through manipulation of a processor simulator (not a real processor). Students program it in machine language, then learn the value of assembler, and eventually, build their own compiler for a toy language in a CS1 course. The author/teacher was quite proud that his CS1 students got all the way to building a compiler in their first semester. I suspect that some of the students found this rather theoretical, and some did not understand the relevance. This is a newly published paper (as of Thursday), so yeah, I think that there are people who do that, and there are reviewers who value that.

          • 5. shriramkrishnamurthi  |  March 7, 2015 at 10:54 am

            Did they provide contextual information? For instance, at the very least, retention rates from the course, course evals, that sort of information?

            • 6. Mark Guzdial  |  March 7, 2015 at 11:00 am

              I paste here the entire results section of the paper:

              Anecdotal evidence from student feedback indicates that
              most students appreciated the project. One student stated that “the
              way the projects build on each other and produce an end product is
              very impressive.” Another student enrolled in a computer
              architecture course stated, “I’m glad I had the course last semester.
              Now in computer architecture we are delving deeper into the topics
              and I understand more than the students that did not do the

              Bottom line: No.

              • 7. shriramkrishnamurthi  |  March 7, 2015 at 11:02 am

                WOW. Well, let’s just say that’s not how I would even conceive of teaching CS1… And this says more about SIGCSE than about anything else, I think. [Btw, both these student comments seem quite good. Having incremental projects is not a bad idea, though you also need safeguards for students who fall behind and then get into a double-jeopardy situation. And it is indeed true that a student would appreciate architecture far better! The problem of course is ***everything else***!]

  • 8. Bonnie  |  March 7, 2015 at 8:49 am

    Are you talking about K12 math? I don’t see my kids doing a lot of interesting relevant word problems. The focus is on math facts – lots of Mad Minute sheets come home – and very simple constrained word problems of the “Jane and Mary had 5 apples altogether” variety. With Common Core, we see more emphasis on alternative algorithms and demonstrating understanding. But it is really all about skill development, and those simple word problems are no more relevant to my kids than sorting algorithms would be. Come to think of it, they weren’t very relevant to me when I was a kid either.

  • 9. Bonnie  |  March 7, 2015 at 8:53 am

    And how hard is it to make sorting relevant in at least that K12 math word problem sort of way? When we do sorting, my students always get a project to do in which sorting accomplishes something interesting. Back when I took CS2, way back in the 80’s, the professor worked the material into a semester project in which we were building a rudimentary word processor. Sorting is useful for so many tasks that it isn’t hard to make it relevant.

    • 10. Erik Engbrecht  |  March 7, 2015 at 1:21 pm

      I don’t think the issue is making the concept of sorting relevant. I think the issue is making the mechanics and properties of a myriad of sorting algorithms relevant. After all, if I want to sort things, I can just do this:

      >>> a = [1, 4, 5, 2, 3, 7, 9, 0, 2, 3]
      >>> a.sort()
      >>> a
      [0, 1, 2, 2, 3, 3, 4, 5, 7, 9]

      I’d argue that the vast majority of professional programmers will never encounter a time when the right thing to do is implement their own sorting algorithm, or even reasoning about which sorting algorithm to use in a direct manner.

      Many will need to reason about when in their processing chain/where in their architecture sorting should be done in order to produce a sorted result. Or when sorting is a useful step in making some larger computation simpler or more efficient.

      Knowledge of sorting algorithms is useful in such cases, but in most cases knowing some basic heuristics to guide selection is probably sufficient to get the job done.

      Of course there are jobs where deep understanding of sorting (among other things) is essential to actual duties and/or making it through the interview process.

      I think the point of studying sorting algorithms is to learn the basics of reasoning about algorithms, and I think every CS student should learn to reason about algorithms. The classic algorithms are all relatively compact and simple to implement, the input/output relationship is easy to understand, and they exhibit a wide variety of different runtime characteristics that can be examined both theoretically and empirically. But the relevance is really in learning how to think about computation as opposed to directly learning how to make a computer do cool stuff.

      • 11. shriramkrishnamurthi  |  March 7, 2015 at 1:32 pm

        I agree that the emphasis on “myriad” sorting algorithms is indeed an unnecessary legacy of 1970s/80s computing (when there was probably much less to teach). I teach two: insertion, because it is _the_ natural sorting algorithm on lists, and then quick, as a way of discussing a multitude of topics (a more efficient algorithm that solves the same problem; an illustration of algorithm analysis; a brief discussion of the role of randomness; and generative recursion as a code-structuring issue). Really, I cannot think of a pair of tasks that pack that much punch in so little code: the concept/code ratio is phenomenal, and even greater when you multiply by utility; and every one of these topics is quite essential to the course’s goals. But do students need to see six different algorithms in CS1/2? I sure don’t think so!

        I do agree with Jessie Duan on this point: “Introductory computer science education at universities tends to emphasize the technical aspects of programming, such as speed and efficiency”. We have new data that shows that beginning students are unhealthily obsessed with efficiency (the “unhealthily” part is, of course, interpretation), and a reflection of what their faculty and staff have told them to worry about. This results in a stultifying sameness of solutions, showing low-level mastery but absent high-level structure.

      • 12. Steve Tate  |  March 7, 2015 at 5:55 pm

        OK, this is going to sound harsh (but I’m in that kind of mood), but if the concern is what a “professional programmer” will do, and if someone is satisfied doing “a.sort()” without ever wanting to dig into that with the thought of “wow, how does it DO that?”, then they should be in a community college programming certificate course or in one of these private training programs. That just misses the whole “science” part of “computer science”.

        You nail it in that last paragraph, but the way you started – with a “real programmers don’t implement sorting” slant – really rubbed me the wrong way. This isn’t a vocational program, and the science doesn’t depend on what people do in jobs.

        To Mark’s point about what is motivating to students: I often do have to remind myself that my students aren’t me. Hell, I first learned about sorting algorithms close to 40 years ago, and I STILL think they’re interesting. And I think Project Euler is one of the coolest things ever. My students? Well, not so much. Depending on the day you ask, I might have different answers on how much we should pander to student interests and how much we should just go with what we – the experts after all – think is best. And I’ll tell you, with the glut in enrollment, it’s much easier to just do the latter. I’ve got enough students. I don’t need to work to try to figure out how to interest people who need special attention to motivate.

        • 13. Mark Guzdial  |  March 7, 2015 at 7:34 pm

          Steve, is your answer the same if the students are non-CS majors who don’t want to be professional programmers? Or high school students who want to see what’s interesting about CS?

          • 14. Steve Tate  |  March 7, 2015 at 9:22 pm

            Good question. My answer was really entirely from the standpoint of teaching CS majors. For non-CS majors you really need to figure out what the objectives are. I still am reluctant to say that “what the students find interesting” is a particularly high priority – certainly not the top priority. Maybe if it is a “computing for science majors” class, the objectives could be determined by a collaboration of physical science and computer science faculty. If the goal is general computational thinking skills, then consultation with a general education council or something similar might be a good idea. In general I’d say start with what you want students to learn, and then work backwards to figure out how to get there. For CS students who repeatedly deal with issue of data organization and reorganization, understanding with some depth how something like a sort works is important. For non CS majors, you probably have much more limited time (like a single class), so you have to prioritize what gets you to your objectives most quickly. That probably does not include things like details of sorting algorithms.

            For high school students, again what are the objectives? Specific skills (like a CTE class), or problem solving skills (like a gened class), or an overview of key concepts from a field (like most high school science classes)? There are probably different ways to structure a course for each of these options.

            That’s a really wishy-washy answer that’s light on specifics. Suitable for a politician, but that’s all I’ve got now…

            • 15. Mark Guzdial  |  March 7, 2015 at 9:34 pm

              We don’t want to teach only those concepts and skills the students already know are interesting. I agree with Shriram that we have to motivate whatever it is that we teach. But what motivates these students? We might be able to use position on the Google/Bing search page to motivate sorting — for some students.

              We learn what students are interested in, then use what the students find interesting to motivate them. Roger Schank used to say, “An interest is a terrible thing to waste,” then go on to explain how he could teach everything (history, mathematics, physics, etc.) to the student who was interested in motorcycles. The motorcycle curriculum uses a student’s interest to cover the curriculum.

              When we did our focus groups to design MediaComp, not one student ever said, “I really want to learn how to manipulate pixels to create filters.” When we asked them what they did with computers, many mentioned Photoshop, digital photos, and drawing programs. “Want to know how those work, and how to make your own?” That’s a starting place.

              • 16. Steve Tate  |  March 8, 2015 at 9:14 am

                I suppose where I have a disconnect here (and most likely with many of my students), is that in my own interests/motivations, the question of “what is interesting” is almost entirely disconnected from “what has a practical application.” Motivating sorting with a Google/Bing search? That’s boring as hell to me. Looking at it as a puzzle – let’s put these things in order using the smallest possible number of steps – that is cool. But I spent hundreds of hours working on more efficient ways to solve a Rubik’s cube when I was a kid, a completely useless process optimization if there ever was one. There’s just something amazing and elegant and even artistically beautiful in optimizing a process. I don’t care if the process leads to a useful application or not. But that’s why I’m a scientist and not a software developer. It is also a lesson that “what interests students” is a highly individualized matter. I’d spend all day working on Project Euler questions, but a “let’s implement flappy bird” assignment might send me looking for a different class or major.

                Anyway, back to the original topic. I probably came across a little too much on the “student interests don’t matter” side of things yesterday. Yes, you absolutely have to make connections to student interests and existing knowledge. For learning to work, it has to fit in to the context of what students know, and “what they know” is heavily influenced by the things they spend time thinking about or doing. However, I think there is a tendency these days to cross the line into pandering, and that’s not good. Thus my last post about thinking about objectives first – I think some instructors are too willing to water down the end goals because they teach too much in the moment and just want to do something “cool.”

      • 17. Rob St. Amant  |  March 8, 2015 at 3:04 pm

        I think the point of studying sorting algorithms is to learn the basics of reasoning about algorithms, and I think every CS student should learn to reason about algorithms.

        I agree entirely. I think it would be great if CS education for non-CS majors also taught how to reason about algorithms. Interestingness and relevance aside, it’s incredibly important. By analogy, I’m imagining a physics course for non-physics majors that doesn’t teach, say, Newton’s second law.

        • 18. Mark Guzdial  |  March 8, 2015 at 6:13 pm

          Why is it important, Rob? (BTW, Happy Birthday!) It’s incredibly important because…non-CS majors who program (like computational scientists and engineers) tend to write algorithms with the complexity of sorting? From the data I’ve seen, some do, but most don’t. It’s incredibly important because…that kind of reasoning comes up so much in daily life? I doubt it — most studies of “natural programming” (what lay people come up with when they are defining processes for other agents) don’t show people inventing nested loops.

          I’ve been influenced by too much Dewey (see My Pedagogic Creed) and Lave and Wenger. “I believe that the only true education comes through the stimulation of the child’s powers by the demands of the social situations in which he finds himself.” If it’s not part of a child joining a community of practice (even a “fake” one), it doesn’t belong in education.

          • 19. Erik Engbrecht  |  March 8, 2015 at 8:13 pm

            I don’t think you’re talking about a CS course for non-CS majors. I think you’re talking about a programming course for non-CS majors taught by the CS department. But I’m splitting hairs.

            Speaking as someone in industry who works with lots of engineers who write reams of abominable Matlab: Please teach them basic structured programming so they’ll stop writing everything as one giant script with the same code copied and pasted five times to deal with different variables that they provide the inputs to by editing the script. Don’t waste time on sorting.

            Also, my experience mirrors your data. A few engineers write massively complicated code (partially accidental complexity due to little or no knowledge of structured programming), but most don’t.

          • 20. Rob St. Amant  |  March 9, 2015 at 10:14 am

            Thanks, Mark.

            I think reasoning about algorithms is important because it’s foundational to computer science as a field of thought. I wouldn’t expect non-CS people to be able to do it in general, but I’d be happy if they knew enough to appreciate the idea. People will have only the vaguest idea about intractability, for example, if they’re thinking about a generate-and-test approach to evaluating efficiency (I’m just guessing that this would be natural).

            I’ve actually come across Dewey’s Creed before, but it hasn’t made an impact until now, when I can see the implications. (I imagine Dewey might be pleased at that.) This is hard for me to explain, but maybe by analogy: The “great ideas” (I’ll use Biermann’s term) in physics include the concepts of mass, force, and energy; in biology, a great idea is the concept of evolution. I think that if a student has taken a introductory course in physics or biology and those topics have never come up, the student has been short-changed, even if he or she can use the knowledge to repair a car or breed animals. Ditto CS, where reasoning about algorithms is one of the great idea.

            Maybe sorting is the wrong way to introduce the generality. Debugging or making a program faster might be a better candidate–why is this program taking so long to run?

            • 21. Mark Guzdial  |  March 9, 2015 at 11:02 am

              The challenge of the teacher and the school is to create a “social situation” where those great ideas are discussed and manipulated. That’s what Seymour Papert was saying when he talked about Logo as a “Mathland,” a place where students are naturally immersed in discussion about mathematics as part of their social situation. If you want students to learn CS Great Ideas, create a CSLand where students are immersed in CS in a social setting.

              • 22. Rob St. Amant  |  March 9, 2015 at 12:35 pm

                That sounds like a great long-range plan.

  • 23. Franklin Chen  |  March 7, 2015 at 10:07 am

    I find it hard to believe sorting is “not relevant”. People want to know things like “which recipe with the ingredients I have on hand is the shortest”, “which of my friends uses that annoying word the most in their tweets”, “which of my friends has the music collection most in common with me”, “which grocery store will enable me to spend the least money for the same bag of stuff”, etc. All this that they could compute for themselves if they stored this data in a simple parseable format. I see people doing this on pieces of paper by hand, or guessing because of the sheer number of possibilities,etc. Sorting and searching are perfect examples of real-life tasks that people do every day one way or another, and the power of computing for yourself rather than depending on a canned app is potentially tremendous.

    • 24. Mark Guzdial  |  March 7, 2015 at 10:16 am

      We can insist that something is relevant, but the decision of relevance is the student’s, not the teacher’s. Does the student see the relevance? Maybe the relevance wasn’t explained well.

      Maybe Jesse Duan (the author of the cited article) had a bar too high. She writes that 62 of the 210 high school girls said that the sorting activity was the worst part of the day. Did the other 150+ like it? (Or maybe it just wasn’t the worst part of the day for them.) What one person finds relevant, another one doesn’t.

      Jesse’s story connects to an ongoing thread in this blog for the last few weeks — we are not good judges of what will work for students without trying it out, doing pilot testing, without gathering evidence.

      • 25. shriramkrishnamurthi  |  March 7, 2015 at 10:50 am

        We don’t need to “insist”. Good teachers don’t “insist”. They demonstrate and persuade and argue (in the positive sense). They bring students along. And of course they evaluate to figure out how much they succeeded.

        Engaging pedagogy involves setting up problems—not solutions, problems—so that the solution you’re trying to get students to appreciate falls out of the setup. (Like the search engine example I gave earlier. Ask students whether they’d like unsorted “relevant” output. Ask them how long they’re willing to wait for it to arrive. Present all this in a way that _they_ argue for the need for sorting, rather than you telling them they need it. Etc.) And of course particularly good pedagogy is recognizing that sometimes you get answers that aren’t what you expected but are at least as interesting, and giving time and having the patience and willingness to explore this (to you, not to them) “tangent”.

        Even the most basic data structures and algorithms are not hard to motivate. Indeed, the most basic ones are basic precisely because they are so pervasive. But it does take some effort to surface them because they are also embedded deep inside everything we use.

        I don’t know what Jesse Duan did. I don’t know what Jesse Duan’s preconceived notions are (I’ve met people who have decided that this is all “theory land” and “theory land” is inherently inaccessible to the majority of students, and if that’s where you come from, well…). Without knowing more about the precise pedagogy and mindset, it’s impossible to ascribe any meaning to this “62 out of 210” number. It may say more about the teacher than about the topic.

      • 26. Kathi Fisler  |  March 8, 2015 at 9:35 am

        We also have to consider _when_ relevance matters to a student. Sure, I can explain up front that searching and sorting are highly relevant to googling, but when the student is stuck in the guts of a problem, can the student draw on that relevance to persevere? After all, the student (usually) isn’t seeing the code they are developing affecting the output of actual searches. In this case, we can’t use the relevance to retain students’ engagement in working on the problem.

        I don’t know whether Mark/Media Comp teachers see students falling back on perceived relevance when they get stuck. We haven’t measured this formally in Bootstrap, but Emmanuel designed our programming progression to tie every concept to a game behavior that students (a) recognize from outside experience and (b) want to see working to create their “real” game. When students start to lag, we draw them back to “the point” via their game.

        Surely there is some ed literature on the proper uses of “relevance” to engage students in learning. We seem to be missing that dimension in this discussion though.

        • 27. Mark Guzdial  |  March 8, 2015 at 11:00 am

          I think we address those issues in the MediaComp papers by Lauren Rich and by Andrea Forte. (See the Guzdial papers page here for links.)

  • 28. joshg  |  March 8, 2015 at 1:23 am

    This student’s comparison to math education is shaky at best, from a math education perspective.

    But since a comparison came up, I’m going to suggest people take a quick look at this blog post by a math teacher / researcher who has a more nuanced take on why “real world” is a flawed premise to bring to education. I suspect it’s useful for CS as well.

    • 29. Mark Guzdial  |  March 8, 2015 at 8:07 am

      Learning scientists talk about different forms of “authenticity” — see great paper by Shaffer and Resnick. The folks who best know how to construct a “real” experience from a “fake” world are the Disney Imagineers. Allison Elliott Tew and I wrote a paper about imagineering principles in MediaComp, which is quite inauthentic from the perspective of what real media programmers do, but feels relevant and authentic to the students. You can find the paper linked on the “Guzdial papers” page: Imagineering inauthentic legitimate peripheral participation: an instructional design approach for motivating computing education.

  • 30. Chuck Hodges  |  March 10, 2015 at 4:41 pm

    I’m right there with you… authentic instruction is the way to go and you included “what the students think that a computer is good for”, which is great! Authentic tasks are a hard sell to some teachers for many reasons, but we need to keep promoting them. I have been spreading the good word of authentic tasks to teachers for a while, but I am going to start including the concept of “rich tasks” as described by Aubusson, Burke, Schuck, Kearney, & Frischknecht (2014, doi: 10.3102/0013189X14537115, p. 223). Authenticity is part of their rich task description. The “rich task” terminology to those familiar with older math ed literature, but I think it deserves revisited in other contexts and as described by Aubusson et al. Do you think this structure for rich tasks would be useful in computing education?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trackback this post  |  Subscribe to the comments via RSS Feed

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

Join 10,184 other subscribers


Recent Posts

Blog Stats

  • 2,053,481 hits
March 2015

CS Teaching Tips

%d bloggers like this: