August 28, 2011

Programmer myopia

We like to assume that people are basically competent and rational. Computer programmers enjoy pretending they are more competent and rational than people in other professions.

In many cases neither of those assumptions is true.

Two popular memes surrounding programming languages in the 80s and 90s were the assertions that "garbage collection is too slow" and that "dynamic typing doesn't work for large programs."

Many programmers were convinced both those things were true. In hindsight they were completely wrong, as languages such as Tcl (more on the importance of Tcl in the history of programming languages in an upcoming post), Perl, Java and Python "dragged people halfway to Lisp" and changed public perception.

How could so many people who consider themselves above-average in competence and rationality be so wrong? (Assume that every programmer is indeed a special snowflake and the Dunning-Kruger effect doesn't apply).

A hermit spent 10 years writing a program. 'My program can compute the motion of the stars on a 286-computer running MS DOS,' he proudly announced. 'Nobody owns a 286-computer or uses MS DOS anymore,' Fu-Tzu responded.

Eloquent JavaScript, Marijn Haverbeke


The problem is that programmers seem unable to think even a couple of years into the future. People complaining about garbage collection in the 80s were looking back at their existing 8-bit Trash-80s instead of at contemporary computers being produced and the future computers being planned. The idea that computers can be good at automating rote tasks like managing memory and checking and inferring types never occured to them.

People have trouble imagining the future even if the trends, such as Moore's law, are in front of them. It takes a very long time for people to understand the right ideas. Just ask Alan Kay. Being able to find the appropriate point of view really is better than a high IQ.

Here are some other Lisp concepts that programmers believe out of ignorance that will take a long time to dispel:
  • tail recursion is unnecessary and makes debugging difficult
  • macro-based metaprogramming results in unmaintainable programs

August 12, 2011

Implications of self-driving cars

I predict one of the first things Google will do with self-driving cars is automate the trucking industry. This will be a huge change in terms of improving shipping efficiencies, but I don't believe that it will fundamentally disrupt the logistics industry: at most trucking companies, the turnover rate for drivers is over 100%. Truck drivers are already treated like robots.

The current passenger automobile system, on the other hand, will undergo a complete and total change.

Self-driving cars will lead to an almost complete elimination of both privately owned cars and public transportation in cities. Robot taxis will become so cheap and ubiquitous, and parking space so expensive, that it no longer makes sense to own your own car (many residents of NYC and San Francisco already find parking unaffordable today).

The first step to this is already being implemented - the automation of taxi dispatching.

Robot cars are safe. The auto insurance industry will be virtually eliminated.

Robots cars need less maintenance and will refuel themselves. Most gas stations and service shops will be consolidated into a few large service depots.

A city will have less automobiles but its citizens will use cars more often - even with peak demand, a smaller fleet of robot taxis than private vehicles can service commuter needs.

Self-driving cars have better road capacity utilization, so even with increased automobile usage the amount of paved roads in cities will be reduced, as unused lanes are reclaimed for real estate development. The same thing will happen to parking lanes and lots - even as demand for parking goes down, the price will rise as the parking spaces get reallocated to more profitable real estate development and the supply shrinks at a faster rate. This will have the effect of greatly reducing road maintenance expenses and increasing property tax income for city governments.

The layout of cities will return to the pre-automobile era, the most visible changes being narrower streets.

On the other hand, the highway system will face pressure to expand, as robot taxis will undoubtedly be used as a substitute for air, train, and bus travel. Robot taxi operators will be national or even international in scale, and who cares if a particular robot taxi was working in New York yesterday and is in Chicago today, as long as on average the operators' fleet utilization is maximized? The key ability of self-driving cars to link into aerodynamic paceline "trains" (much like bicycle racing teams) will make long-distance fuel consumption competitive with trains and buses.

The robot taxis by themselves will also be much more aerodynamic than today's cars. With the elimination of private ownership, automobile body design will no longer be driven by the status symbol desire, but by taxi operators' need to minimize fuel consumption.

What does this mean for public transit? Buses and street-level tramways will be out, but subway networks will likely remain viable because subways are not vulnerable to traffic jams and snow.

In terms of traffic, it's likely that the top speed of a journey will decrease, while the average speed increases. Robot cars can potentially negotiate intersections much more effectively than human drivers. Congestion at peak times will likely still be a problem in city centers due to decreased road capacity, but the traffic jams are likely to be shorter and involve higher average speeds.

Smart enough to predict stupidity

I think the root of your mistake is saying that macros don't scale to larger groups. The real truth is that macros don't scale to stupider groups.
--Paul Graham on ll1

People who design programming languages sometimes like to imagine an idealized "average programmer" who will employ their design. The underlying assumption being that the language designer is smarter than the "average programmer," and will set out to protect the latter from their own incompetence.

The arrogance behind this view is twofold - not only is the language designer deeming himself objectively smarter than other people, but that he will be able to predict how other people's stupidity will play out. In view of this egotism, the (lack of) quality of the end result should not be surprising.

This objection -- "but bad programmers will make a mess of it" -- is the stock objection everybody makes to every unorthodox programming construct. Since it is an objection to everything, it is an objection to nothing.
--Daniel Gackle on programming language features