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)
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.
WATFIV (and WATFOR, WATBOL etc) are the classic example in my mind. Made by the University of Waterloo, now languishing somewhere (at Sybase maybe?!)
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?
For any right triangle with sides of length A and B and hypoteneuse of length C,
A^2 + B^2 = C^2
Intentional Programming
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
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.
Download the friggin DDK from their site, and they have working samples for almost all their core drivers.
Stripped of a license, the samples in there are as good as OSS.
And btw, they are nice cleanly coded samples. There is just as much pressure on programmers there to keep that code clean: it's in their DDK, and they don't want to show shody samples. So I'm sure the code review processes are just as stringent.
Richard Dawkins, author of The Selfish Gene, would point out that all information, code included, survives, multiplies and mutates like genes. The code is to the gene as the application is to the organism.
Anyone remember the kernel source stuck between tags that was the color highlighted, so the whole thing was this big penguin? http://www.cc.gatech.edu/~ncb/penguin.html
Don't blame me, I voted for Kodos
This is one of the reasons for the projects to emulate historical computers. It doesn't matter whether it is a PDP-11, an IBM 360 or whatever, there is often a simulator out there. The odd thing about it is that due to the speed of modern hardware, you can often run the emulations at the proper speed.
See my journal, I write things there
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.
Incidentally I also bought Tanox (TNOX) at about the same time. Thought they could come up with some interesting immune system stuff. They did, it seems they've made a vaccine approved in Australia for getting rid of allergies (anti IgE). Still their share value lingers in the basement!
So now twice I've betted on technology, been right, and still lost.
Check E-trade account:
LHSP: -99.96 %
TNOX: -80.99 %
Seem you need more knowledge than just a bit of tech savy. Bummer.
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.
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.
I worked for a dot-bomb, and a company that is still around. I erased all of it. Not for security or copyright issues, but becuase there wasn't anything of use.
Most of the broad purpose code was like re-writing CVS (yes I'm not kidding), or gnu-E. One of my qualms in working for those companies was their hush-hush secretive attitude. And when you get past to find out what the secret is, its like "your doing that? Why not just use this GPL code right here?"
I realize my experience might be out of the ordinary, but I got rid of it just becuase I had no use for it.
__________________________________
OnRoad: Boldly reporting the SUV war from the middle of the road.
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.