Dynamic Languages for Tots


Dynamic languages (see Wikipedia if you’ve been living under a rock for the past decade or so) such as Python offer some substantial advantages over static languages such as C. I’m not going to belabor the pros and cons – folks like Jon Udell have done that for me (smartly) and some others have done so less wisely.

I’m interested in a very specific scenario in which dynamic languages could help: novices.

OK, OK, I realize that dynamic languages aren’t going to satisfy the purists who want all CS students to learn about typing and there are those who’ve argued that dynamic languages are breeding grounds for bad coding practices.

I also realize that there are probably some folks out there thinking that Python isn’t exactly the first language you think of when you think of novices. But there are a whole lot of people – people who don’t consider themselves programmers – who’ve gotten very comfortable with a host of dynamic languages. Think PHP. Think Javascript. Think VBScript. Think Perl.

But for someone who’s not a CS-track programmer – who’s just interested in coding for fun – the ability to have a more interactive programming style. I don’t necessarily mean interactive programming in the dictionary definition sense. I’m talking about a kind of cause-and-effect programming where the actions you take in code have a very tight and immediate effect on the application.

So: good, evil, or do I just not get it?

Comments (10)
  1. Mike Parsons says:

    Hi John … Microsoft is in possession of one the most powerful dynamic languages that is probably the most used by novices yet gets little respect …

    VBA

    Specifically, VBA in Office apps. VBA provides a powerful language AND development environment in the context of applications that users understand  … Word, Excel, etc.

    Now Microsoft has gone and mucked it all up by introducing the complexity of .Net and VSTO to replace VBA.

    Your time/energy would be better spent (and I mean this in a good way) making VBA easier to use for the novice/power user rather than trying to cater to hard core developers (i.e. via VSTO). 99% of what novice programmers need to do can be accomplished with VBA/Office.

    If you want to build a large exciting community around Microsoft’s Platform (Office, in this case), focus some effort on building tools that cater to novices, not placate hard-code developers.

  2. Max Battcher says:

    I think that dynamic languages are great to introduce people to programming.  I’ve been writing a lot of Python code this semester (for a class project) and I think it is something that is very easy to read.  I think Python is probably the closest to being able to fight a lot of the complaints of purists.  It isn’t explicitly typed, but it does a much better job of type tracking and "casting" than, say, PHP.  The only "real" complaints that I hear are from OO purist friends that whine the Python doesn’t enforce encapsulation.

    There are also some things that purist friends of mine will claim of Python: that its a great stepping stone to Functional Programming (which is more elite than OO Programming, or so say the purists), check out its very useful list comprehensions and generators, both of which are concepts from FP.

    An interesting "compromise" language, which is a dynamic language, is Boo (boo.codehaus.org), which is similar to Python, targets the .NET CLR, and makes good use of .NET classes.  You can teach your novices to do all the cool stuff that purists are doing in C#…

  3. Andy Wilkinson says:

    Not a "dynamic language", but for everyone who hasn’t come across this feature in Visual Studio 2005 that allows more of an interactive, cause-and-effect approach to working with C# code:

    Start up your copy of Visual Studio and select the Debug>Windows>Immediate menu item. What you get is the same Immediate window that you get when debugging – but not many people know you can use this without starting debugging.

    Now try this,

    (1) Create a new Windows Forms project.

    (2) Open the Immediate window.

    (3) Enter the following lines one by one

    Form form = new Form();

    form.Controls.Add(new Button());

    form.ShowDialog();

    Visual Studio will "interpret" your code as you enter it line-by-line. What’s more, you can create instances of any types in the currently active project (try creating a new form in the designer then showing it by typing into the Immediate window as above).

  4. There do seem to be an increasing number of high school and some university faculty looking at Python as a first language. I think the interpretive nature of the language as well as the simplicity of the UI appeal to a lot of people.

    While my first language was FORTRAN I really learned a lot on my own with an early version of BASIC that makes me think a bit of Python. I think that a lot of students really respond to the type in a line of code and see something happen way of programming. The first course (or first self teaching experience) should be all about “wow this is fun and cool – how do I learn more?”

  5. mheller says:

    I like Python. I’d consider teaching it to my kids, if they were interested.

    Other possibilities:

    StarLogo TNG (see http://www.byte.com/documents/s=9957/byt1141336941474/0306_mh.htm) and StarLogo

    Ruby (see http://www.byte.com/documents/byt1113843775910/) and the book "Learn to Program"

    The Kid’s Programming Language (see http://www.byte.com/documents/s=9552/byt1128970353339/1010_heller.html)

  6. orcmid says:

    I’ve heard raves about Squeak, and Ted Leung apparently gave up on Python for his tots and found Squeak (with its robot toys) more useful.

    I always thought Logo was interesting too.  KPL bothers me because it seems too .NET-ish and doesn’t exactly provide the same dynamic ease.

    What’s intriguing to me is that there are "Information Literacy" courses at the University of Washington (in the iSchool, I think).  I just got a copy of one of the texts: Lawrence Snyder’s "Fluency with Information Technology: Skills, Concepts, & Capabilities."  The book is not for tots but I am impressed that programming is illustrated using JavaScript.  (You can also get it much cheaper than the bookstore charges for it.)

    Since JavaScript is already available on all current PCs, that has my interest.  

    Making it work for tots takes more work.  The plus side is that JavaScript provides enough similarity for kids to go on to learn the strongly-typed, compile-link-execute sort of languages later on.  The down side is not having simple games and other kid-interesting worked examples and some kind of playpen/IDE to work and execute in.  I guess the browser is the playpen, and Snyder uses it that way.  Now you get to edit HTML, which might also be useful for older kids.  It’s also an easy escape from command-line applications to something having graphical presentations.

    I have mixed feelings about Squeak and am willing to look at it more closely just because the tools and toys may be more useful.

  7. Nick says:

    I have mixed feelings about this.  I suppose from a learning perspective it is good to get someone into programming.  But I do think that they’re a breading ground for bugs… specificaly since many of the errors that end up popping up are only found through testing code, whereas those same bugs would simply not compile in a static language.  

    And since we all know how hard it is to get seasoned programmers to thoroughly test code, imagine what its like to get a novice to do it, and do it well.

    Thats one of my gripes with .NET for instance.  Because practically everything is on the heap, it has increased Null Reference Exceptions greatly.

  8. Yes, but in "cause-and-effect programming where the actions you take in code have a very tight and immediate effect on the application"

    I think you reveal a blind spot for an important point. With novices (as with dynamic languages), I don’t think there’s always a "the" application. And even if there is a primary application, I think one of the HUGE advantages of a REPL-style environment is that it’s not just this incremental building of the primary application, but there’s an ability to wander down significant tangents.

    For instance, I haven’t internalized how Ruby constructs its arrays when "nil" values are involved and, sure enough, the other day I was facing that issue with a data structure. In the VS environment, I would have to either mess around within my big, complex-enough application, or start a "New project…" and experience this massive context switch. In a REPL environment, I can, instead, spend 5-10 minutes building arrays and arrays of arrays, etc., and then eventually cut-and-paste that code back into the guts of my main project.

  9. johnmont says:

    A wonderful observation — sometimes learning is about the process, not the end goal. Wandering through a programming environment, bumping into things that you weren’t looking for necessarily (like I found Ruby’s chomp) makes programming a kind of serendipitous experience.

  10. orcmid says:

    I just discovered that the Larry Snyder "Fluency with Information Technology" book is also used as the basis of a free on-line course (equivalent to 5 quarter hours) at the University of Washington, termed FIT100. http://onlinelearning.washington.edu/ol/

    Also, another plus of JavaScript, which I always forget, is that it blends into learning about HTML and provides a minimal simple deployment mechanism.  

    Still not tots level, but intriguing.  For novices and enthusiasts, this interests me (along with Express Editions).

Comments are closed.

Skip to main content