August 01, 2013
No Threshold, No Limit
Why aren't computer languages part of the standard grade-school curriculum?
I have taught using all of these languages. Each language has its advantages; but they also all have major drawbacks for teaching. None scales all the way from kindergarten to college. The best advice today is for students to learn half a dozen different languages. The implication is that, to learn programming, you need to be pretty devoted to the task.
Unfortunately, for the routine teaching of regular kids in mainstream schools, the lack of a standard notation means no languages are taught at all.
Remembering LOGO and BASIC
The best "universal learning language" efforts to date have been LOGO and BASIC. BASIC is not a well-loved language today. With line numbers, goto, and a lack of encapsulation, BASIC forced you into bad habits and sloppy thinking.
However, in the years when it was popular, BASIC had the advantage that it was both the first language to learn and a language that was used to write commercial software. BASIC was everywhere. And by taking a peek at big programs written in BASIC, a student could see endless fields of possibility stretching out ahead.
LOGO is a better-designed language. Although LOGO feels abandoned and antiquated in the Internet age, LOGO also got a key thing right: the goal of "No Threshold, No Limit." That slogan meant that LOGO was both easy enough for children who want to see feedback after typing five letters, and powerful enough for advanced learners who want to build an AI.
In 2013 is there any modern equivalent to LOGO or BASIC?
Yes, there is a modern language with the easy elegance of LOGO and the practical hackability of BASIC. A single language that scales from kindergarten to pros. But it is a new language, not listed above. It is a language that does not even aspire to be an educator's language. Yet it is a language that has fortuitously appeared in the "no threshold, no limit" sweet spot.
More thoughts below....
The First Step is a Doozy
The first lesson of programming is that "the computer will do what you tell it." And to a seasoned programmer, the one-liner below seems like a pretty simple way to teach that lesson.
But if you stop and think about it, that is not a great first program. For example, it requires parentheses. That means you need to locate the curvy symbols over the 9 and 0 and hold down the shift key at the same time. Kids raised on mobile texting have no idea where to find parentheses. And if you confuse the smooth parentheses with the square or the curly ones, they don't work!
When half the students are confused by a jumble of symbols that they cannot even find on the keyboard, it is very difficult to get a classroom motivated.
Lowering the Threshold
The design of LOGO anticipates these issues. LOGO is punctuation-free until loops are introduced. For kids who cannot yet spell (or for whom English is a second language), it includes two-letter abbreviations for all important methods.
fd 100 rt 90 fd 100
Scratch and NXT-G go one step further and avoid typing altogether. You just drag blocks on the screen to assemble a program. That is what "no threshold" is all about.
But there is a problem with these visual languages.
Don't Clip My Wings
When I have tried teaching NXT-G, Scratch, and LOGO to my enrichment-program kids in Lincoln, the kids get deflated pretty quickly.
It does not take long for a motivated child to ask the question, "can I embed a Taylor Swift video" or "can I make it say Haaarg?," and no teacher wants to have to say "it can not be done."
The various visual teaching languages have their own drawbacks. For example, as terrific as LOGO was back in the day, LOGO is simply too limited in the modern world. It runs slowly. It runs in an old-fashioned environment. It doesn't connect with the libraries and media and capabilities and communities any kid will find on the internet.
NXT-G is also too limited. Is is incapable of expressing pretty simple programming concepts such as arrays, so an NXT-G program can basically have no memory. Worse, the NXT-G visual editor is buggy and too often results in a corrupted program file. My FIRST lego robotics team kids often tell me they wish they could edit their robot programs as plain text files, to avoid the clumsy visual editor.
Of the three, Scratch is the most up-to-date, but its visual approach is still limiting on the upper end: without natural local variables and data structures, algorithms are a slog in Scratch. And Scratch is not "real." You would not build a website in Scratch. Teaching kids to realize their dreams while working around the limitations of a visual educator's language can feel like teaching algebra using Roman numerals.
An Educational Wishlist
In the end, it seems, there is no winning.
I have long dreamt of designing a new teaching language with the "no threshold" sensibility of LOGO, but modernized to have "no limits" in today's terms. My wishlist:
The dream would be to make a language that serves kids from kindergarten to college. For the littlest ones, the language should serve as a game that teaches the concept of automation. In grade school, they would use it to learn arithmetic and geometry. In middle school, it would become a tool to introduce algebra, visualization, and graphing. And in high school and beyond, it would be used for simulation, multimedia productions, or building the next big kickstarter-funded app.
The Perfect Language Already Exists
What I imagined was something like Skulpt: python in the browser. But then I realized that something better already exists.
The ideal learning language was designed by Jeremy Ashkenas in 2009, and it has a very active and enthusiastic following in the Ruby community. It a language used by Dropbox and many hipster Silicon valley web hackers. It is a language that does not even aspire to be a first language. That ideal learning language is Coffeescript.
Let's take a brief look.
Coffeescript has an intuitive, punctuation-light syntax that looks like LOGO when you are a beginner.
# This is Coffeescript. fd 100 rt 90 fd 100
Then it reads like ordinary algebra as you start building logic. The concepts for "if", "then", "else", "is", "and", "or", and "not" can all be spelled out instead of coded as cryptic punctuation:
factorial = (x) -> if x is 0 then 1 else x * factorial(x - 1)
Finally, Coffeescript looks like streamlined Ruby or Python for larger programs, with reasonable syntax for list comprehensions and array slicing, and with a very clean indent-block syntax for functions, control flow, classes, closures, and JSON.
choices = (menu, sofar = ) -> if menu.length is 0 write sofar.join ' ' else for item in menu choices menu[1...], sofar.concat item choices [ ['small', 'medium', 'large'] ['vanilla', 'chocolate'] ['cone', 'cup'] ]
Next time: Filling the Gaps
The main problem with the language is that Coffeescript is new, which means that, for beginners, Coffeescript still missing a a few things.
So let's fill those gaps!
More on that next time...Posted by David at August 1, 2013 07:49 PM
|Copyright 2013 © David Bau. All Rights Reserved.|