Friday, November 23, 2012

The Future Face of Code (is Now)

In my eyes, one of the greatest obstacles in learning to code is the problem of the 'delayed response.' That is, a programmer has to envision what their code will do while writing it, and only after writing a good portion of the program can they see the result. Projecting the effects of the code you write becomes an essential skill in programming, but only gained after sufficient experience.

This makes learning to code tough and learning syntax like learning a foreign language (fun fact: Columbia School of Engineering accepts a CS class as the foreign language requirement). Instantly seeing the result of using a function instead of memorizing its purpose would be a much better way to go.

Very recently, a couple websites have started attempting this, most practically, the famous Khan Academy. Their introductory video for learning CS outlines a very different approach to online CS education, one that has finally started to customize a learning environment for the subject. In this case, instead of supplying lectures and expecting the student to work through the examples on software meant for seasoned programmers, the website built the entire programming interface into the website. Not only does the example code come with a voice explanation of everything, but changes in variables and lines are instantly reflected on the canvas to the left.
http://www.khanacademy.org/cs/1-welcome-to-codecanvas/882454257
To me, this looks like the beginning of a great approach to teaching programming.

However, the man (Bret Victor) who is cited as inspiration for this approach disagrees with it strongly with it:
http://worrydream.com/#!/LearnableProgramming
His argument outlines an entire mindset towards programming. He rejects Khan Academy's explicit encouragement of the 'play with this, see what it does, and that's learning' approach to teaching to code. Instead, "programming is a way of thinking, not a rote skill" conveyed through teaching simplified versions of Javascript. He proposes that instead of helping a student learn what a function does, the purpose of the function should be clearly labeled. Not only labeled, but easily stepped-through, the hidden data should be easily visualized, and programming flow should be explicit. For concrete examples, see the link above.

This shifts the focus of learning to code from learning a foreign language's words to understanding underlying ideas. There is no concrete proof that simply teaching syntax like Khan Academy doesn't force students to think in the abstract way Bret Victor wants them to, so this subtle difference remains a split in ideology.

One point Victor makes that I completely agree with is the constant desire to simplify programming languages ('Englishify programming') for the students, with the assumption that programming is hard because it looks so alien. Changing syntax to look more like natural English is not a solution for teaching CS; it's just an attempt to skip the teaching process and also built on the assumption that the 'words' in code are foreign and learning them constitutes learning CS. One thing the human mind is good at is remembering a small number of names--the difficulty here is teaching how and why to use them.

As a final note, I attach Victor's talk that inspired Khan Academy. It's an hour long about the interactive coding interface he made.
http://vimeo.com/36579366
The first segment is similar to Khan's demonstration of interactive code, but the program he shows between 11 and 16 minutes into the lecture blew my mind. He makes Mario. Go, watch it. I can't explain it in words nearly as well as actually seeing it. The latter parts delve into abstract programming (minute 16-23), applications to engineering diagrams (23-28), how computing as we know it is vestiges of its monitor-less ancestors (28-30), intuitive animation (30-34), and more abstract implications (the rest). I recommend listening to the parts related to your interests--it might be its future.

4 comments:

  1. Wow, Victor's talk and IDE are amazing! Aside from Khan Academy, has it inspired any other educational efforts?

    ReplyDelete
  2. There are a couple rather famous websites/interfaces that are similar to the concept you expressed, and I was wondering if you have heard of any of them?:
    I was wondering if you have looked at LightTable by Chris Granger at all (http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/)? This is a new 'pseudo-interactive' coding environment that was created as a project on KickStarter, and was also inspired (or at least, I believe it was) by Bret Victor.
    Additionally there is a effort to help people learn ruby in an interactive almost 'storybook' manner (http://tryruby.org/levels/1/challenges/0) which is part of a project called CodeSchool (http://www.codeschool.com/courses).
    And there is PexForFun, which was created by the Research division at Microsoft Corp (http://www.pexforfun.com/) and Kodu (http://research.microsoft.com/en-us/projects/kodu/). MSR is currently creating other technologies that envolve as you suggested the "Englishification" of programming languages to teach people how to program when they might otherwise be inclined to not accomplish a task by themselves.
    I believe that programming is an integral skills for all individuals to learn, not just self-proclaimed 'techies.' I constantly hear about individuals who are economists, or lawyers etc. who wish that they have the skills to do basic programming so that they are not constantly forced to hire RAs and consistently monitor their work for a simple function.
    This is why I admire nations such as Estonia, where they have issued a nation-wide mandate to teach 6-19 year olds how to code (http://www.forbes.com/sites/parmyolson/2012/09/06/why-estonia-has-started-teaching-its-first-graders-to-code/). What do you think about that idea?

    ReplyDelete
  3. It's fascinating to see this debate about learning programming, syntax vs. semantics, englishification of programming languages, etc. I have seen these same issues argued for more than 40 years! I haven't had the chance to look at Victor's work, but will definitely look forward to doing so, as well as some of the other things Tara points to. The comments about Estonia lead me to wonder when i should introduce my 5-year-old grandson to programming!

    ReplyDelete
  4. I'm fairly conflicted by Bret Victor's 'LearnableProgramming' page. I do agree with the message that an ideal environment for *beginning* to learn programming would include thorough source code annotation to eliminate any chance of the student not understanding the meaning/purpose/functionality of part.
    With this said his argumentation unfairly distorts both his and KhanAcademy's teaching stances.
    While its obviously important for a lesson to educate the user on all the new details occurring in the examples, his portrayal of KhanAcademy's tinker first, ask questions later approach doesn't grant it its biggest advantage: immediately showing the student the power and significance of the lesson's contents. Opening with value demonstration then descending to information transfer puts the motivation *first*. The reverse method of providing detailed information first may work when it comes to teaching students already highly motivated to learn, but what about when this method generalizes to public education and convincing students why CS is important becomes part of the equation.
    As for the argumentation distortion I mentioned, his beginning examples and assumption of the student's former knowledge makes the necessity for thorough detail much more persuasive. In reality, this meticulous annotation does exist out there already, and its in the CS self-teaching books designed for students in square one. These true beginners don't open the book to graphics demonstrates that involve filling ellipses and rectanges on a canvas, they're learning what a integer and a string are. Assuming that a true beginner follows a linear incremental path to more difficult topics, any half-good source will explain the new items along the way. So the reality, as opposed to Bret's distortion, is that proper lesson progression from the basics to graphics would prepare the student. If you're at graphics and are wondering "what do these numbers after 'fill' mean", (source: http://is.gd/WpTA5e) i.e. you don't what function PARAMETERS are, then you are lost.
    I don't have much to say about his distortion of Khan Academy's approach, besides it being a great source for educating people on what Straw Man Fallacies (http://is.gd/0qxAlZ) look like. I had two examples but went over the character limit, so here's my favorite
    1) The microwave analogy! http://i.imgur.com/LUwDP.png
    He begins by talking about how Khan Academy's tutorials don't label variables in functions like fill yet encourages the student to tinker and see what changes. Then he equates this strategy (shown in screenshot) to a cookbook advising readers to randomly hit unlabeled buttons to learn cooking. WOW, that made me laugh. If you've watched a single math video on Khan Academy its painfully obvious by Sal's adoration for the word that they believe intuition is the key to understanding. Knowing that, its pretty clear that, by not labeling the numbers, the tasks may be striving for intuitive understanding of numerical representation of color or coordinates. Not to mention the motivation first teaching style I mentioned earlier.
    Providing thorough detail along with demonstration, and withholding the majority of detail and focusing on motivating the student and driving intuition are in reality just two ways to skin a cat. I love what Khan Academy is doing in respect to CS education and exposure. All that's necessary to potentially stimulate a long-lasting relationship between a person and Computer Science is an understanding of the basics, a development environment (any computer), a resource for clarifying and inquiring about functionality (google), and *motivation to learn* which KhanAcademy does a fantastic job at.

    ReplyDelete