archives

How to handle errors

Having learned C++ I thought exceptions was a new, cool thing, simply the new Right way of doing it. I just never could get it right. I thought the problem was that I had been doing C for far too many years, until I stumbled across

Exceptions considered harmful

I then realized I've always done fatal error handling by killing the currently executing thread (or process when not using an RTOS), and normal handling by return value. For most part it worked well. There was one thing I had been missing: Automatic resource deallocation, where focus on automatic is more on "you can't forget" rather than "compiler will do it for you", though I wouldn't mind if the latter could be done safely.

I then stumbled on

Flow manifesto

Using Flow concepts as basis, would it be possible to get same help with generic resource deallocation as Flow offers for memory deallocations?

Learnable Programming

Bret Victor wrote another great essay, Learnable Programming: Designing a programming system for understanding programs, in the wake of StrangeLoop.

The goals of a programming system should be:

  • to support and encourage powerful ways of thinking
  • to enable programmers to see and understand the execution of their programs

A live-coding Processing environment addresses neither of these goals. JavaScript and Processing are poorly-designed languages that support weak ways of thinking, and ignore decades of learning about learning. And live coding, as a standalone feature, is worthless.

Alan Perlis wrote, "To understand a program, you must become both the machine and the program." This view is a mistake, and it is this widespread and virulent mistake that keeps programming a difficult and obscure art. A person is not a machine, and should not be forced to think like one.

How do we get people to understand programming?

We change programming. We turn it into something that's understandable by people.

Bret Victor writes in a flowing, highly accessible, and richly exampled style that I have, perhaps unfairly, come to expect from him. This essay will be of great interest to anyone who is exploring live programming, interactive programming, augmented programming, or integration of programming language with development environment.

TOPLAP, a community for live coding since 2004, provides a little extra context for the essay.