The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Wednesday, June 13, 2007

Programming like Lego? I gave that up long ago

[S]oftware is not like Lego; we still do not assemble software from ready-made components as if we were building a Lego house. Almost every programmer has to write low level stuff like if blocks, for and while loops, opening and closing files, creating and deleting resources, thread synchronization etc.

Comment on Code Reads #1: The Mythical Man-Month

I never thought of while loops or opening a file as “low level details.” Twenty-five years ago, “low level” was writing in Assembly language and twiddling bits. But times change, and what was once a high level language (C++) is now considered “bare metal,” much like Assembly was years ago.

But “while loops” and “if blocks” are low level details? I don't necessarily think so. You might be able to hide such things behind more syntactic sugar (just as “while loops” hides the goto it's built out of) but I don't think you'll ever hide them completely (exceptions are one way of hiding a goto but I think that particular cure is worse than the original disease it tried to cure).

And there are others out there who will say we have software Legothe Unix command line. A series of pre-written programs (easily over a thousand such programs) that can be linked together in millions of ways.

Actually, the more I think about it, the more I'm inclined to think that the Legoesque metaphore of software development is not the way to go. We've already been there and have gone beyond it. In its pure form, Lego has a limited number of bricks, in a limited set of colors, which can be used to build just about anything you can imagine. That is, if you don't mind your resulting thing looking a bit blocky. The closest thing we have to that in computer science? Other than the command line, the only computer language I can think of that fits that (limited number of commands is the closest analogy I can think of) is Assembly. Moving, shifting, adding (among other mathematical operations) and testing of bits comprise over 80% of Assembly language (the other 20% Shifting execution to other parts of the program and some other, really esoteric operations usually reserved to the operating system itself).

How many programmers today use Assembly daily?

Not many.

We've got tools that will take a high level concept like:

double A[2][4];
double B[3][2];
double C[][];

C = A × B;

And assemble all the Lego bricks Assembly language instructions required to express the concept (in this case, matrix multiplication). We'll do better, programming wise, to program at higher conceptual levels, than in trying to make programming like Lego bricks.

(I'm also finding Scott Rosenberg's Code Reads well worth reading)

Obligatory Picture

An abstract representation of where you're coming from]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

Obligatory AI Disclaimer

No AI was used in the making of this site, unless otherwise noted.

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.