Programming in Middle School?
Eating breakfast in the hotel the other morning, my father mentioned a Twitter conversation he had to join about programming courses in schools and math curricula.
Programming and math education? I just had to get involved, too.
Ben Grey and Colleen K had started talking about the value of programming courses in school. Ben and my father (initially) were against it, concerned that the skills would be obsolete before they could be used, and were not particularly transferable to most fields. Colleen and I took the pro side.
Ben and my father both pointed out that languages go extinct, which is true. But judiciously chosen languages have staying power. Basic can be run in a browser, but is obviously a fine starting point. C has been around since 1972, and it isn’t going anywhere soon. JavaScript has been around since the mid-90s and seems to hold a secure point.
What of transferability? How many professional programmers still work in the first language they learn. Anyone? Anyone? Beuller? My first language was Perl, which helped me learn JavaScript and PHP, which helped me learn Java and C. People older than me probably started with Basic. People much older than me may have used ALGOL—which was on its fourth generation by the time C was born.
But what about the majority of students who don’t want to be programmers?
Programming is a powerful, concrete interface to the two mathematical concepts that cause the most problems for students in K-12: variables and functions.
In the US, our K-12 math curriculum covers three broad areas—numbers, variables and functions. These roughly correspond to primary math (counting, operations, fractions, equalities) algebra and geometry, and (pre-)calculus.
Most students can wrap their heads around numbers, even fractions. They are relatively concrete. Some students struggle with operations like multiplying and exponents, but this is the lowest hump, the bunny hill. The majority make it down unscathed.
When does your school start losing people in the math program? It’s probably around 8th grade. That’s when most schools begin the dreaded algebra. Variables are intuitive to some, but abstract and meaningless to others. If you believe Myers and Briggs, some of us are predisposed to abstractions and generalizations (*NTJ) but is there a biological reason others are lost here? Or do math teachers and curricula need to change?
Of the people who survive algebra without hating math, how many make it past “pre-calculus” or “FST”? I’ve heard the story a dozen times myself: “I was good at math until my calculus class.” If numbers are the bunny hill of K-12 math, then variables are the green circle, and functions are the double black diamond.
Again, functions may be completely intuitive to a few of us, but they can strike terror in the heart of even the most dedicated students.
Too often, when they reach a jump in complexity and struggle, students are told “it’s OK.” They are “not ‘math people.’” This can come from parents (“I was never good at math, either.”) or even well-intentioned teachers (“Maybe you’re just right-brained!”). There is a deeply held belief in this country that “math” is some innate ability, a genetic gift, and either you’re the next Will Hunting, or you may as well not try.
How does this relate to programming? How did you learn programming? Here’s a common roadmap:
- Imperative programming; no functions or abstractions; lots of constants; instructions in linear order.
- Using variables for input or consistency/ease-of-maintenance.
- Using functions and subroutines to encapsulate repeated operations.
- Using someone else’s functions—you probably don’t see the implementation.
- Branch off to more advanced ideas like object-oriented or functional programming; lots and lots and lots of abstractions.
A remarkably parallel route. And instead of saying “x is a number,” you can say “var name holds the name the user enters!” The results are far more immediate and interactive. Play is cheap. (“What if I change this line? Oh it doesn’t work, better undo that.”) Instead of limiting functions to scary numbers and equations, more pedestrian words can be used as arguments and return values.
Programming is applied mathematics. Teachers spend much of their lives looking for new examples, better applications, to drive home the theory, when there is already a wealth of application available.
There is also a two-pronged economic argument. To paraphrase Mr. Friedman: anything that can be outsourced, will, and the new jobs created here will require deeper interaction with computers. A cursory understanding of the programming techniques underneath will benefit all students as they enter the job market, and the exposure may mean more prepared students entering computer science programs. Basically: we need more talented, creative programmers—how many art students harbor latent programming skills—and even non-programmers will benefit from the exposure and understanding.
And of course, the math skills. No subject (that is taught) is taught as badly as math in our schools. On the personal level, this translates to people who misunderstand interest and get themselves in trouble with debt; on a national level, it certainly doesn’t help when a subprime mortgage market bubbles and pops.
Even if you don’t use “math” on a day-to-day basis, it is another way of thinking, of solving problems. Algorithmic thinking, epitomized in computer programming, provides a layer of cognitive flexibility, and every layer we can add, we should.
I don’t expect every student to become a master programmer, or even explicitly use those skills—or other skills in their math courses—every day. But I do expect schools to use every tool they have to make these methods of thinking and courses of study available to everyone. We wouldn’t allow a future programmer to skip his English class, why would we allow a future writer to skip his math and programming class?
July 16th, 2009 at 4:37 pm
Very well written and right on the mark. Some fundamental exposure to elements of programming would be helpful for many subjects, and as you mention, especially mathematics. In addition to the examples of variables and functions generally, add in working with 2d or 3d graphics in a programming environment and you are set. Even in kid friendly programming environments like logo or scratch one can learn plenty about coordinate geometry,plane geometry,angles,vectors,you name it. One of the difficulties I have seen though is the separation of subject areas that have much in common and complement one another ie. “programming”, “mathematics”, “physics” into their own isolated compartments. If a student was lucky enough to be taking all three at the same time, how much do you want to bet three different teachers are involved, and at times, explain the same thing using 3 different sets of terminology. Some students will see the connections on their own and start to transfer knowledge and strategies to the other subjects. This should be good thing, but how often do they end up penalized (wrongly) for not doing a particular problem the way they were showed. (How dare they recognize a projectile motion problem as a type of quadratic equation and solve using techniques other than the standard “formulas”). Even worse, heaven help them if they figure out how to generalize a solution strategy to a whole class of problems and write a program (perhaps on their graphing calculator) that allows them to obtain solutions by supplying relevant input parameters. How many students are congratulated when they explain that the three pages of homework questions they were assigned were essentially the same and could be handled with the simple program they wrote, eliminating hours of tedious work and saving paper by generating only the answers required? Not many I bet. If there was an approach used to tie it all together, and use elements of programming to strengthen understanding of mathematical concepts it could be very powerful.
July 16th, 2009 at 5:04 pm
We did a little bit of programming at in Maths at the beginning of high school. The advantage I feel it gave me, outside Maths itself and perhaps coping better with the little bit of HTML, CSS, javascript etc that we’ve all had to deal with in life, is having some very basic understanding of the tools I use every day.
So it’s like understanding how a car works, how the weather forecast is made, or how electricity may be generated, or how the heart pumps blood around the body. Programming is so much part of our lives that I’m not sure a practical or economic argument is necessary. And of course, if kids get into it, it can be a fantastically medium for creativity and self-expression, which most people would agree is a good thing.
Congratulations on the new job, by the way!
(came here via your Dad on Twitter)
July 17th, 2009 at 10:03 am
Thank you for writing this blog and inviting me to continue the conversation. This is an important topic for which I have great passion. I particularly like the comparison you made between the study of mathematics and that of programming. There are some very strong similarities.
I teach students at a math learning center. We integrate programming with mathematics as early as kindergarten and continue all the way through high school.
Children in grades K-3 program through a robot called Roamer. Roamer is equipped with a basic Logo interpreter. Children can program Roamer to move forward and back any number of steps and turn any number of degrees. Roamer can also draw geometric figures. Computer concepts include procedures and loops. For example, when programming a square, children will first enter: fd 50, rt 90, fd 50, rt 90, fd 50, rt 90, fd 50 rt 90. A simple loop reduces the program to: repeat 4 [fd 50 rt 90].
Students in grades 4-8 program with Microworlds and Scratch. It is here that students first encounter variables and functions. Simple games, puzzles and simulations are the main focus. Number operations, probability, proportion, geometry, and linear relationships are the predominant math concepts.
Our high school students work primarily with Actionscript 3 in the Flash environment. They use what they’ve learned about functions (linear, quadratic, exponential, trig) to program various types of animation. Students have programmed amusement park rides, created spirograph curves, and modeled real world systems.
During each stage, students are highly engaged while immersed in a world of mathematics and problem solving. In general, students who have spent at least one year in the program appear to view math differently from students who have not had this experience. They see math as a tool; something they can call upon to “make things happen”, as one 7th grader stated. Students who do not participate tend to view math as an endless list of formulas and rules to memorize. This observation alone provides a very compelling reason to teach math and programming together.
Why should children learn to program in math class?
1. Programming takes abstract concepts such as number, angle, variable, and functions and makes them more tangible.
2. Programming a computer to carry out an algorithm (pemdas, GCF, LCM, etc) makes the process exceptionally clear. Students must reduce the algorithm into its most basic components.
3. When programming, math concepts arise naturally which means that advanced concepts can be accessed sooner. Rather than conforming to a predetermined order of topics, children have the opportunity to learn math on a “need to know” basis.
4. Attitudes toward math are generally more positive. This means that students are likely to continue their study of math at higher levels.
Why should children learn to program in general?
1. Learning to think logically is an innate benefit of programming. Children learn to break down large problems into smaller ones. This skill is easily transferred to other areas.
2. The ability to control a computer is becoming as important as knowing how to work with numbers and manipulate words. Those who lack this ability, as with numbers and words, will have a tremendous disadvantage.
3. Through programming and, specifically, the process of debugging, children develop perseverence and determination. The end result (animation, working game, etc) is highly motivating.
4. Programming is another form of expression, much like writing and creating music. With programming, children not only imagine any type of world they wish; they have the potential to bring that world to life. Children should have as many expressive outlets as possible.
I’m looking forward to hearing other people’s views.
July 17th, 2009 at 11:06 am
Hi,
This is one of the most f.a.q by many of my juniors, so I have collected a list of articles and sites that clarifies this. Check out this below link for the same..
http://markthispage.blogspot.com/2009/06/best-programming-languages-for.html
Also, if you want to learn more, go to home page of the blog and check the programming section — I have collected lots of good links about all the popular programming languages — Hope this helps.
July 17th, 2009 at 12:59 pm
@Trevor – You add a great point. Separating subjects the way we do does nothing to help students build connections. I was lucky enough to have the same teacher for math and physics one year who helped me really understand the connection between Newtonian mechanics and calculus. But, even as much overlap as there was in my tiny school, the “science” and “math” departments were separate. Given the deep connections between math and other sciences, how does that make sense?
@Goldfish – Welcome, and thanks! I’m honored to have you here.
Exactly. You don’t need to be a doctor or electrical engineer, but you have significantly more control over your life and interactions if you know the basics. Even if it just helps you know who to call.
@Colleen –
I cannot think of a more compelling bit of evidence. Math is a fascinating and powerful tool, and so often it’s turned into a boring and monotonous punishment, removed from all applications. Some of us take to the abstractions like fish to water, but it’s a small group. The real crime is that everyone–even those who are “good” at it—sees math as a useless, inapplicable pursuit, including the teachers.