20 July 2009

Why I love Quickscript. (One of several reasons.)

"Give me a lever which is long enough," Archimedes exclaimed, "and I will lift the earth."

To everybody who has seen and understand the "Pirates of the Caribbean" movie trilogy it is abundantly clear that even the most insurmountable goals can be accomplished, once you have enough leverage. For me, even after studying English in school for eight years, regularly reading and writing English for nine years, and now living in an English-speaking city for two years, expressing myself clearly has been an insurmountable goal. When I am relaxed and speak without thinking of the language, I will regularly be interrupted by people's "what was that?" and even a repetition won't make me understood. I have to repeat again, or spell out the word that I can't pronounce or try to use another word, which I am hopefully pronouncing better. This is a distraction that throws my stream of thoughts off-track, makes me nervous when I continue, and slowly eats away my confidence in my ability of having a normal conversation.

Quikscript shall be the leverage that is needed to teach me the English language --as it is spoken-- once and for all.  For me, being a visual kind of person, Quikscript is the written face of spoken English, it is the key to see the language, and thereby memorize and master it.

Best of the Fringe

Just two plays which I might see because I missed them in the main Fringe.

As You Puppet
By William Shakespeare and adapted by Hank’s Toy Box Theatre
UPSTAIRS AT BERKELEY: Thursday July 23 – 7pm · Friday July 24 – 7pm · Saturday July 25 – 7pm
Stuffed animals spring to life! When a clever bear named Rosalind is banished by her evil uncle Frederick the crocodile, she and her best kitten friend Celia run away to the forest in search of adventure. Meet a giant orangutan, a prissy hippo, a brave teddy, and a comical bunny named Touchstone in Shakespeare’s “As You Like It” for kids!

A Singularity of Being
By T. Berto
BERKELEY MAINSTAGE: Thursday July 23 – 7pm · Friday July 24 – 7pm · Saturday July 25 – 7pm
*Winner 2009 New Play Contest* Roland Mathers is a brilliant physicist consumed with unraveling Einstein’s Grand Unified Theory. A Singularity of Being explores the life of a genius who’s pursuit to uncover the secrets of the universe unravels the lives of everyone around him. When he develops a life threatening and debilitating disease, Roland sacrifices his happiness on the altar of science.

Tickets are $16.50 each and are available starting July 14, 2009
416.368.3110 or www.canstage.com.
The Berkeley Street Theatre - 26 Berkeley St.
http://fringetoronto.com/fringe09/bestoffringe.html

11 July 2009

learn to drive before you build a car, learn to read before you write

Although Computer Science as an education is widely available since several decades, many software-development- and in particular programming-jobs are still done by people with a different educational background. Computer Science (CS) departments are struggling to attract as many students as there is demand for educated Computer Scientists, but it seems that the more students they attract (on top of those who would take CS anyways), the more students will fail during their studies. While recruiters say "we need more graduates with CS degrees", professors whine "we are accepting to many students that have no talent."
In programming in particular there seems to be a divide between programming nerds who just seem to understand programming to a point of completing their assignments, while some others always seem to be estrange to programming and struggle even with simple assignments as soon as some variation into problems is introduced. The question which I want to write about here is: how can we teach programming in a way that helps all students?

I have been helping out with teaching programming since I was an undergrad myself. Seeing how awful student programs looked in the first year I helped with the programming lab, I decided to publish some of the best assignment solutions so that the students would have an example to imitate and an idea of how elegant programming solutions can be. Assignment submissions got much better in the second year!

Since that time, Pascal as a beginner's language has been replaced by Java, and Java by Python, but the problems are still the same. I asked one student with a particularly awful program where she he learned the particular construct which she was abusing there. "Oh, that's from my high school teacher."

When after more than half the course was over, the instructor finally taught students about testing. At that point, I started realizing one of the things that went wrong from the beginning: in our course, students were mostly taught to program little functions, but they were never taught how to use those functions properly and how to test them. I could write an entire blog post on the "test first" paradigm of programming, especially it's important in languages like Python which have no static checking whatsoever. But here, let's concentrate on something more fundamental: the actual understanding of programs, what they do, and how they work.

Most students seem to learn by example and the only official good examples of programs that they see in a typical university course are code snippets small enough to fit on a single lecture slide! Given that material, they are supposed to write entire programs with interworking parts. If I contrast that approach with other disciplines of writing, it just seems ridiculous! In literature, students will read entire novels plus probably some secondary literature, before they write essays of their own. In science, students will read a couple of text books plus tens of journal articles before composing a paper of their own. Furthermore, the first writings of students are usually of secondary nature themselves: summarizing, interpreting, or commenting on some primary work (i.e. an essay about a novel, or a paper about some previously published scientific findings). In programming on the other hand, students will get no reading material, and they have to compose primary works starting from their first labs and assignments!

Here are some ideas how to improve this deplorable situation.
  • A large part of the exercises and assignments has to be devoted to reading and understanding programs that have been hand-selected by the instructor as examples of good programming.
  • Possible exercises which train this are: writing documentation for a given (substantial) piece of code, writing test cases for a given program, write an example use for a given program module, and finally, extend a given program by a small feature.
  • Writing of documentation has to be split into external (what does it do) and internal (how does it work).
  • Testing can first be done for a programm that works according to its documentation, and as soon as the students can do this well, let them test and debug an incorrect (but still well-designed!) program.
The important part about all this, is that students have to read and really understand a large corpus of existing code that has specifically been chosen for its good design. Students will then appreciate how easy it is to understand, extend, and debug really well-written code. They will also see how the different programming constructs they know from lectures are best fit together.

I don't know how many of our field's education problems this approach to teaching is going to solve. But I am sure this is the way to go!

10 July 2009

Sunday is going to be my Fringe Day

Here's a list of shows I might go see on Sunday. I will see at least two of them, let me know, if you want to come or have any praise or advise to drop of!

5 July 2009

Python 3000 migration

I think it's a good thing that Python as a language removes some of its deprecated features and old special cases which no longer make sense.
Few programming languages make such a bold move, although more should. A language that grows ever more complex with time becomes a huge liability. Much of this complexity is unavoidable, but the avoidable one should be avoided! Making the necessary non-backward-compatible changes to a language is an expensive investment because the migration of existing libraries and applications becomes a project of its own for each of those libraries and applications. On the other hand, this investment also has an immense payoff in maintainability and extensibility in the long term.

Now, it has been more than six months since Python 3.0 has been released, but a naive search on Google doesn't turn up any migration information yet! Some people seem to have plans for migration, but there's no experience-report yet. Also, there is no list of libraries that have already moved or are planning to move. Unfortunately it seems that no application or library can be migrated until all of it's dependent libraries have done so. Of course, a project could migrate to 2.6, import feature from future and use the -3 compatibility checking option. But it seems that most are still waiting for the "upstream" projects to move.

Here are some references:
After the 3.0 release it quickly turned out that GvR's original advice: "start all your new projects with Python 3000" is unrealistic: the libraries are just not there yet. But what's realistic (and what I will do) is to write all new code with Python 2.6 and make it as much future-compatible as possible. Then the port to 3.x will be completely automatic, once the new libraries have come out.