Archive for the ‘Programming’ Category

Why Write Open Source Libraries

Thursday, January 24th, 2008

1. Exploration. I can sample platforms and sample stretch languages without sinking my stakeholders if I fail. Also, it’s easier to try something radical in a small, green field project than in a big one.

2. Altitude training (link TBD). I can make myself jump through hoops that I wouldn’t feel ethical asking someone to pay me to jump through. I did this recently with “Sequentially”:/sources/javascript/sequentially; the next time I needed to simulate concurrent processes in a more serious context, it was a lot easier.


Read the rest of this entry »

The Programmer’s Food Pyramid

Thursday, January 17th, 2008

Programmer's Food Pyramid

Update: (1) There’s a discussion (at the moment) on reddit. (2) Thanks to FusionGyro for suggesting the name change to “revising”.


Read the rest of this entry »

“Stretch” Languages, or, 28 years of programming

Sunday, February 5th, 2006

Recently I reviewed the programming languages I’ve used over the 28 years1 of my programming career. The result is shown in the chart below. (Click on the image to see it full size.)

There are some obvious trends here2. The languages are mostly getting higher level. There are a few “survivors”: languages that I’ve used over the the course of a decade, although discontiguously: C/C++, Common Lisp, and Java. Java has replaced C (except for a stint around 2000 where I went back to low-level graphics programming at Alphamask), and the scripting languages have taken over from Common Lisp — they’re slower, but they’re terse, have better libraries, and are easier to deploy.


Read the rest of this entry »

Refactoring for Fifth Graders

Wednesday, September 8th, 2004

I gave Miles a set of Logo programming problems:

  • sv 3 draws a square divided vertically into three columns
  • sh 4 draws a square divided horizontally into four rows
  • svn 3 4 draws a square with three columns and four rows

(These are going to build towards some work with fractions, but he won’t know that unless he reads my web site. Hi, Miles!)

The first thing he did was place a slider and a button on the screen. The slider ranges from 1 to 10, and the button calls sv with the value of the slider. He used these to test the program while he wrote sv, to quickly try it on different arguments without typing. When he added sh he added another button, and so on for svn.


Read the rest of this entry »

Aspect-Oriented Programming with mod_rewrite

Tuesday, August 17th, 2004

I spent part of my vacation last month working on my web site. One change I wanted to make was to put a banner on every page, and a directory-specific column on the left. Nothing fancy by web design standards, but an adventure for a hobbiest without a CMS.

The first time I had to make a number of pages with a common template was in 1995, and I wrote a Lisp program to generate them. The next time I made a web site, I used Barry Warsaw’s Python program to create some pages. (I still didn’t have access to a server with server-side includes.)

Last year when I moved my site to a modern server, I used PHP include to add navigation elements to some of the pages. But this time I didn’t relish editing a number of HTML files, and, more to the point, I was ready to try something new.

The Problem

Let’s say that software/index.html looks like this:

<h1>This is my software page</h1>
<p>Welcome to my software page</p>					
Read the rest of this entry »

Instance-First Development

Sunday, March 28th, 2004

LZX is a prototype-based language: any attribute that can be attached to a class definition, can be attached to an instance of that class instead. This is handy in UI programming, where there are a number of objects with one-off behaviors. It’s also handy in prototyping and incremental program development, where it creates the possibility for a novel kind of refactoring.

more

The following two XML documents are complete LZX applications . Each defines a view named myview, that contains a method named f. Evaluating myview.f() in either application will result in 100.


Read the rest of this entry »

A Taxonomy of Comments

Sunday, August 31st, 2003

Christian Sepulveda writes about comments in source code:

Not all comments are bad. But they are generally deodorant; they cover up mistakes in the code. Each time a comment is written to explain what the code is doing, the code should be re-written to be more clean and self explanatory.

This statement is provocative and interesting, but wrong. There are more good uses for comments than bad ones. (The rest of Sepulveda’s posting is more nuanced, and much of what I write here expands on points he makes.)

Comments are an escape hatch for expressing everything about a program that the programming language can’t. Comments therefore don’t fall into a single natural category.


Read the rest of this entry »