?

Log in

No account? Create an account

Previous Entry | Next Entry

May. 18th, 2004

The fundamental difference between programming and nearly everything else is duplication. A perfectly-constructed plane has every bolt put on exactly the same way, every weld executed precisely the same, every wire attached just like every other. A perfectly-constructed program has no duplication at all, and in fact is the most complex thing possible for its size.

Comments

( Read 2 comments — Leave a comment )
chiave_trust
May. 19th, 2004 12:08 am (UTC)
Something similar could be said for stories, too.
brentdax
May. 19th, 2004 12:40 am (UTC)
Not really...

A perfect program doesn't have a pair of lines repeated--those lines have been extracted and turned into a subroutine. If something is done, it should be done once, in one place. It's as if there was one bolt holding the entire plane together, one instance of each word in the story. The redundancy and repetition inherent in most human endeavors is absent from programming. This means that programmers are essentially creating the most complicated systems possible--there is no repetition left in it.

In a way, it's like compression. A zip file works by analyzing the files being zipped; when the zipping program sees a sequence it's seen before, it replaces the sequence with a note saying "you can find this sequence at location X". By doing this, it ensures that no sequence of characters occurs more than once in the zip file. A perfect program replaces all identical sequences of lines by a note saying "you should run subroutine X here".
( Read 2 comments — Leave a comment )