Immortal Code
ziani writes ""... Sometimes a piece of code is so elegant, so evolved, that it outlasts everything else." Nice article at Wired wondering how much great (and lousy) code is lost due to business failures."
← Back to Stories (view on slashdot.org)
It's nice to see some elegant code in this world of bloated redundant code... Is it me or does it seem that open source is written much more elegantly? Is this just because we can actually see the source :) I'd sit in a corner rocking back and forth if I was forced to read Micro$oft code...
Code that lasts 'forever' and gets passed along, like DNA? How unusual!
#! /bin/bash
while true; do
sleep 1
done
Come on guys this is not a story at all. Good code gets bought and reused. Thats not news thats anti-news (it would be news if people didn't do it). So thanks for alerting me to another article that doesn't matter about anti-news.
No way the code from busted companies gets lost. I'd bet that most if not all coders get themself copies of their code and keep it in their own portfolio to reuse and recycle it.
And of course you don't destroy your copies just because another dot bomb has gone off.
Imho that article is a nice myth...
One of the true beauties OSS is its immortality. Given the "deep" copying of source code from OSS projects (there're many many repositories), it's hard to believe that we will ever lose any software developed in this way. In addition, good, useful OSS is iterated over and over. Just look at Emacs for example. I like to think that Science and OSS work the same way: result/programs are published and reviewed over and over by other scientists/programmers. Some projects will achieve amazing level of perfection, just as some theories, like quantum mechanics, are exceptionally accurate and useful. It took many iterations to get that theory right, as it takes many iterations to create perfect code.
int main()
{
printf("Hello world\n");
return 0;
}
Seems like the most well known piece of code in programming history.
What other basic code pieces, used in hundreds or thousands of programs, do you know?
Joachim
People don't write Manifestos any more -- what's going on in this world? [Frank Zappa]
I'm reminded of what mathematicians call "The Book". This is based on a quote from Paul Erdos, who said that God keeps a Book in which He writes the most elegant proofs -- as a mathematician, you don't have to believe in God, but you do have to believe in The Book, and strive to make your proofs Book-worthy. Maybe God keeps a Book of Hacks, too?
Toronto-area transit rider? Rate your ride.
The system cannot find the path specified.
C:\>
... in COBOL nonetheless!
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. HELLOWORLD.
000300 DATE-WRITTEN. 02/05/96 21:04.
000400* AUTHOR BRIAN COLLINS
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
000900
001000 DATA DIVISION.
001100 FILE SECTION.
001200
100000 PROCEDURE DIVISION.
100100
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS.
100500 DISPLAY "HELLO, WORLD." LINE 15 POSITION 10.
100600 STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800 EXIT.
*nix.org - Featuring BSD, Linux, OS X, Solaris, & More!
Reply or e-mail; don't vaguely moderate. Ex-O'Reilly/MIT employee, now a full-time Google employee.
I don't think they talked to many coders. Who doesn't keep a copy of their work, especially if it is good?
Good code get reused, but in a more organic way...
I'm always curious as to what may be some of the oldest "working" code that's publicly available. Code that was written ages ago, but still used today.
I'm sure that there are other examples, but I'd like to put forward the first candidate of such code: Squeak Smalltalk.
The reason I put it forward is more because of my knowledge with it. Of course, I may be wrong also, but...
Anyway, the first time I saw the predecessor to Squeak was back at an Apple sponsored event at college in 1985. They were showing off the Macs and new Mac Plus.
One fellow there managed to have a copy of the original Smalltalk-80 image that Apple worked on with Xerox. It was a fascinating piece of software.
That image was sourced from the original work done at Xerox in the late '70s and early '80s.
When they decided to bring forth Squeak, they started with the original Apple image (which started with the original Xerox image).
So, I'd like to think, though I don't know, that there are lines of code within that Squeak image that literally date back to the late '70s and have never been changed since. Coded late at night by some hacker at Xerox and simply pulled along with the Smalltalk image, never needing to be tweaked.
No doubt there are the zillions of line of code still kicking and screaming within industry, but I'm more interested with code that is out in the wild, and still being used somewhat actively.
Any other contenders?
there are several limitations for the lifetime of code:
Perhaps we should look at it that way: If all good code would and could be reused, more than the half of all software engineers would be ou of duty soon. I think i once read a figure that less than 20% of all code written is "new".
Yours, Martin
It shows no examples of immortal code. The closest thing they mention is that when Scour got bought, the new company archived the code, but never used it.
That's hardly immortal, that's entombed.
Examples of immortality would be things like
* Bits of BIOS still in use from the original IBM PC through today's pentiums
* Bits of Multiplan that percolated through Excel
* Bits of CP/M still floating through Linux
The article makes a bigger point on how transient software is, and how 99% of what's created is tossed out. How many times, when asked to fix code, do you just rewrite it anyway?
Design for Use, not Construction!
Tom Duff once came up with this very useful yet ugly piece of C code for high-speed blitter routines, or any other instance where data must be moved as quickly as possible.
I'd post it but the Slashdot lameness filter is just that: It makes posting code like this impossible, therefore making Slashdot lame.
There is a link to a full explaination here. Damn, if only we could all be this good.
PS: Yea, I do believe it beats the living crap out of memcpy() or BlockMove() or whatever other routine your using
CAn'T CompreHend SARcaSm?
A modern-day analogy might be the line
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
that opens XSL stylesheets -- NOBODY ever types that by hand.
Cantankerous old coot since 1957.
Is it just me, or is that story just unbelievably depressing? The writer didn't really acknowledge this - those two people who spent their lives working on Dragon Dictate wound up completely hosed, and can't hack on their lifes' work anymore. I mean, *ouch*!
The code escapes on floppies and CD-Rs. Developers are always swiping copies of good code to take home. Whether they wrote it or not. Good code resurrects itself again and again.
We all know it happens. Many of us do it. We take code with us and "massage" it for the next job... or a job two years later.
In they eyes of the law and in the eyes of society, it is wrong. To me and most developers I know, it is right. Nothing will ever stop this practice.
Walla, the program now works! ...
Computers are not "smart" like humans, thus they require very specific instructions in order to do anything.
Yes, humans are able to know what you mean even when you type totally the wrong word, like "Walla".
Wonder how much well-designed assembler and punch-card code there is out there. While due to being platform-specific most would not be immediately usable, it would be nice to be able to read snippets to explore specific computer platforms for curiousity's sake.
Michel
Fedora Project Contribut
Left with nothing, Jim and Janet Baker turned to the courts. In a failed attempt to retrieve Dragon from among the L&H assets that were now locked up by bankruptcy laws, they hired the powerhouse law firm run by David Boies.
David Boies?
MAN, is that code GONE.
Blearf. Blearf, I say.
Ia! Ia! COBOL Ftaghn!
THIS CODE IS YOUR CODE - you know what tune to sing it to
This code is your code, this code is my code,
To California from the south of Finland,
From the GNU compiler, to the ELF binaries,
This code was made for you and me.
As I was trolling the threads on Slashdot,
In Unreal Tournament, I need an aimbot,
I saw before me the new KDE,
This code was made for you and me.
This code is your code, this code is my code,
To California from the south of Finland,
From the GNU compiler, to the ELF binaries,
This code was made for you and me.
Downloaded sourcecode, unzipped the tarballs,
Dot slash configure, then make-installs,
And all around me, my systems showed me,
This code was made for you and me.
This code is your code, this code is my code,
To California from the south of Finland,
From the GNU compiler, to the ELF binaries,
This code was made for you and me.
http://www.library.cornell.edu/nr/bookcpdf.html
is a great example of long-lasting heavily reused library of frely available code. I have used the eigenvalue and matrix decomposition routines directly from NRC so many times I lost count.
That article talks of Baker using statistical probability towards speech recognition.
That immediately makes me thing of the markov matrix/chain.
The two ways I would have looked at speech without having read anything on it would be FFT and neural nets, and/or markov matricies (likely also with fft).
When I first learned to use them in speech generation (either written or spoken) and also general analysis that became my favorite tool to abuse (my hammer making everything look like a nail?).
I immediately thought of how I could use them in image recognition, game ai, and stock analysis...
But mostly I used them to post to newsgroups and web discussion boards and then laughed at people responding to them as if they were regular users and usually fighting with them.
I wrote a Poe generator (would write stories/poems based on his matrix) and also a radiohead song generator.
Now my current hammer(s) are neural nets and genetic algorithms - but the markov matrix is stuff fun as all hell.
It never says straight out in the article that Baker uses those - but the general concept that is discussed seems to point at them.
(and yeah - I know the article was about losing code - but that's boring - what is cool is the code discussed)
There are some odd things afoot now, in the Villa Straylight.
My eyes! MY EYES!!
Forget the whales - save the babies.
Are we speaking of "immortal" in the sense of vampiric, blood- and money-sucking immortal code(Windows), zombie code(DOS) or of angelic/divine code(my database applications)?
is in its 25th year, and still communicates daily. I'm sure the bus has been running the same code for the whole mission, although I'm sure the payload may have had some code revisions uploaded along the way.
End of Line.
NRC is (a) not free ... you'll have to pay a hell lot of money if you use the code directly and (b) shoddy code - at least the C code. I think it's just automatically converted Fortran code...
--
All extremists should be taken out and shot.
Absolutely. When I went from my first to my second job, I foolishly took none of my source code with me. Since the second job was with the same company as the first, just a different division, I assumed I'd still have access to it. Hah. Many times, I regretted that as I had to re-create an object I should've been able to copy and paste.
When that division folded and I moved on to the next job, this time I took a little more with me. Just some of the essentials I'd need for my portfolio, though, since I felt at the time that it would be wrong of me to abscond with the company's and clients' IP. I now very much regret that decision, because the company itself is gone and the clients have no access to the source - they're stuck with un-upgradeable software.
At my current job, I am backing up everything I do. I will never touch or look at it except in case of an emergency, but this time if the floor falls out from under me I will be prepared.
"This song is Copyrighted in U.S., under Seal of Copyright # 154085, for a period of 28 years, and anybody caught singin' it without our permission, will be mighty good friends of ourn, cause we don't give a dern. Publish it. Write it. Sing it. Swing to it. Yodel it. We wrote it, that's all we wanted to do."
1000 SlashDot sigs
That beautiful piece of elegant code you wrote will be lost in a system crash as soon as you move on, if not sooner. That horrid inefficient kludge you wrote early in your career will be retained forever, and when through the vagaries of the world, you end up at the company which owns that code, you will end up responsible for maintaining it.
Not necessarily true. In India, the man who sells code might be known as the "code-walla." Therefore, his worker-bee might just be inclined to exclaim "Walla! The program now works!"
Hot Damn! It's the Soggy Bottom Boys!
As an anthropologist, I am always stunned by the misconceptions that some people have about evolution (primarily that it's just a one-time random snowstorm of debris that made man and beast out of nothing but mud).
If you believe, as you seem to, that evolution is about producing something valuable from completely random events and matter, then you obviously have not studied evolution or the theories and hypotheses behind it, but have instead simply been listening to misinformation from the likes of Jerry Fallwell.
Evolution does not function outside of one important context: the environmental context.
Given this simple caveat to your post, we can now see that all programs are actually evolving.
Consider this:
A code snippet is written. But it doesn't function. What happens? It dies -- it is deleted, removed by its environment (i.e. the programmer and project) because it serves no purpose.
Another code snippet is written. It works properly. Wow, it ends up in release 1.0! It has survived! It has a long and happy life on the retail shelf.
But lo, another programmer comes along, sees the original code snippet, and adds to it so that it runs faster. Cool! Though 1.0 was very popular in its time, the 1.0 code snippet is removed and is never heard from again -- it has been out-competed by a new, more efficient snippet which works better.
The new revision is so good, it becomes version 2.0! Soon it's everywhere; 1.0 is hardly ever seen any longer because 2.0 just works better and 1.0 keeps getting wiped and replaced by 2.0.
Voila! Evolution.
This exactly the way that natural selection (and by extension, macroevoluti) work on organic beings in the "real" world. Nature "proposes" a product by the mixing coding ideas (i.e. DNA) from different from individuals (i.e. SEX). If the result doesn't work -- if the code doesn't produce a functioning or an efficient product (i.e. individual) -- then the code dies and is never heard from again. If the code does work, then an efficient, functioning individual is born and survives into adulthood. The code lives! But now new ideas are infused into the code again (i.e. the new individual also has SEX!) and new DNA is born -- another new code snippet in the offspring. And yet again, if the code doesn't produce a viable product (i.e. individual), it eventually dies out -- removing it from the environment -- and it is never heard from again. But if the new code does produce a functioning, efficient individual, voila again! The code lives! Wash, rinse, repeat.
Every time you or anyone else makes a baby, you are writing a new version of the code. Any time two whales mate, they are writing a new version of the code. The DNA is dancing, folks. If the new product works, it finds a place in the marketplace (the environment). It survives. If it happens to work better than anything else out there (Anna Kournikova, Natalie Portman), it dominates the marketplace and everyone wants a piece of it. As the generations pass, products with better code are better at survival -- getting food, getting attention, getting mates (and as a result, the good code doesn't die out).
EVOLUTION.
It's not random at all. It is actually an awful lot like software development.
P.S...
Voila! Voila! Voila! Voila! Voila!
STOP . AMERICA . NOW