Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
Programming IT Technology

What Is the Oldest Code Written Still Running? 903 903

Consul writes "What is the oldest piece of code that is still in use today, that has not actually been retyped or reimplemented in some way? By 'piece of code,' I'm of course referring to a complete algorithm, and not just a single line." The question would have a different answer if emulation, in multiple layers, is allowed.
This discussion has been archived. No new comments can be posted.

What Is the Oldest Code Written Still Running?

Comments Filter:
  • Re:I'm not sure (Score:5, Insightful)

    by jonbryce (703250) on Sunday May 11, 2008 @03:39PM (#23370842) Homepage
    I'd go for the Babbage Difference Engine in the London Science Museum.
  • Embedded microcode (Score:5, Insightful)

    by Kidbro (80868) on Sunday May 11, 2008 @03:46PM (#23370908)
    Knowing full well that I haven't got a clue, my guess would still be microcode embedded in some special purpose device - i.e. not a general purpose computer.

    I don't remember when digital watches started appearing, but I suppose there's a bit of code in there? Various industrial machines from waaay back that are still in use ought to be good candidates as well.

    Kudos to Consul for a remarkably interesting Ask Slashdot. The best one I've seen in a long while :)

  • Re:A rare topic (Score:5, Insightful)

    by mbone (558574) on Sunday May 11, 2008 @03:48PM (#23370918)
    The code in the Voyager spacecraft, at least, was extensively updated after launch and throughout the mission.
  • Re:A rare topic (Score:3, Insightful)

    by story645 (1278106) * <story645@gmail.com> on Sunday May 11, 2008 @03:49PM (#23370926) Journal

    Somehow I doubt that many of the people that would be running such old computers such as ones from before 1970 would be reading Slashdot.
    Dunno about that. My mom's employer (UPS) still runs old mainframes (and employs COBOL coders) because switching would be too expensive/time prohibitive/etc.
    Sometimes companies just have ancient systems somewhere in their infrastructure cause they can't gut them.
  • by popmaker (570147) on Sunday May 11, 2008 @03:54PM (#23370956)
    Still.. we have hundred year old humans right? And some thousand year old trees. Trees are run by a somewhat simple generative algorithm, but still... as far as age goes, they still take the cake.
  • Re:A rare topic (Score:5, Insightful)

    by WGR (32993) on Sunday May 11, 2008 @04:03PM (#23371054) Journal

    Somehow I doubt that many of the people that would be running such old computers such as ones from before 1970 would be reading Slashdot. And if you think about it, people conceptualized computers differently back then. I think you'd be hard pressed to find mention of a specific program but more of mention of a computer itself. Its too bad there is such a big disconnect between the generations of computer programmers and administrators.
    As someone who has been programming computers since 1966, I beg to differ with you. Code is more persistent than computers, since one can still run code written for an Intel 8080 on a modern dual core Pentium. The one main difference between programming them and programming now is that the cost of computers then meant that machine efficiency then was more important than human efficiency. Unfortunately too many programmers still think that way and are not willing to put in the code for security checks, clean user interfaces, etc. that are required. In many ways, computer science had a huge regression after the development of microcomputers. Instead of extending the lessons of mainframe computers like the Multics project about security, we returned to the "efficiency" goal because of the lack of power of early micros and still use that mindset when we have IPods that are more powerful than the largest mainframe of 1970.
  • logarithms (Score:5, Insightful)

    by petes_PoV (912422) on Sunday May 11, 2008 @04:03PM (#23371058)
    > What is the oldest piece of code that is still in use today

    Not quite a cheat, but I'd say that the original instructions used to calculate log tables might be close.

    It's code (well, instructions - same thing?)

    While it has been retyped many time, I'm sure the original paper-based instructions are still in a library somwwhere, and would work on a suitably old calcuator (hand-cranked, of course)

    It's definitely a complete algorithm

  • by nuzak (959558) on Sunday May 11, 2008 @04:10PM (#23371130) Journal
    True, but what's really the definition of "still running" for purposes of it being the same code? If you patch one byte, is it the same code? Sort of a Ship of Theseus problem, no?
  • Re:A rare topic (Score:5, Insightful)

    by osu-neko (2604) on Sunday May 11, 2008 @04:20PM (#23371212)

    And why should they? It works. It does precisely the job it was designed to do, and continues to do it at at least the level of ability it originally had, often better if the hardware underneath has been upgraded. Something only truly becomes obsolete when it no longer satisfies today's needs. A well designed, task-specific system could theoretically never become obsolete.

  • Re:A rare topic (Score:5, Insightful)

    by ffejie (779512) on Sunday May 11, 2008 @04:35PM (#23371310)
    If there was a power outage, they might not be able to find the guy to turn on the machine? Then it's time to upgrade.

    I agree with you that if it works, why fix it? But when a product has reached end of support because 1) the manufacturer has stopped supporting it or 2) there is no one in the working population that knows what to do with it, then you have to get it out of your infrastructure. You cannot continue to rely on products that you have no way of fixing if they break. Just because it hasn't broken in the past 30 years is no indicator that you won't hit something in the next 30 that won't break it.
  • Re:A rare topic (Score:4, Insightful)

    by Glonoinha (587375) on Sunday May 11, 2008 @05:08PM (#23371574) Journal
    Ouch. Holy crap.
    I don't know which is worse - that you were able to recite that from memory, or that I recognized it.

    I was going to come in here and give the obvious answer to the question (that answer being 'bubblesort') but I think you may have me beat.
  • by khallow (566160) on Sunday May 11, 2008 @05:14PM (#23371626)
    We probably wouldn't be as far along. Military technology, especially in times of conflict, has resulted in a great deal of progress. Among other things, there's clearly defined failures (eg, someone defeats your army in battle or you have to abandon some location or policy). In comparison, what's failure in space development? It's obvious when things blow up. But what happens when things just aren't done? Is that a failure or just something that can't yet be accomplished? As I see it, it's far easier for a space program to plug along without any real measure of success and failure. That has complicated our efforts to do things in space.
  • by DougWebb (178910) on Sunday May 11, 2008 @05:41PM (#23371816) Homepage

    It's amazing to me that NASA has the foresight to design such a remote update system years before the concept of a "firmware update" was ever applied to consumer technology.

    As both a mechanical engineer and software engineer, this doesn't amaze me at all. It's basic "CYA", applied by engineers. They were sitting around a table one day, going over failure modes or something like that, and someone said "Hey, what if we forgot something here? Can we prove that we've covered everything that could be foreseen?". They thought about that for a minute, and being practical engineers, they said "Nope; we can't prove squat, and we probably did miss something, so lets build in something to let us deal with that contingency." And that's how the remote update system got invented. It's an obvious solution to an obvious problem, once you accept that uncertainty is a constant that needs to be dealt with rather than hidden away.

  • by Haeleth (414428) on Sunday May 11, 2008 @05:53PM (#23371910) Journal

    one wonders where our technology would be today if we invested more in the space program and less in killing one another
    Sadly, we would probably never have developed any sort of rocket (beyond the toy phase) if they weren't such a darned convenient way of delivering explosives...

    if anyone is offended by that remark I apologize
    Please don't. I for one am fed up of our modern PC climate where everyone is afraid to exercise their right of free speech in case someone isn't mature enough to deal with different views. Save the self-censorship for when you're tempted to shout "Fire" in a crowded theatre, or "Jesus loves gays" in a crowded fundamentalist church, or some other speech act that's actually likely to endanger people's lives.
  • Re:Really? (Score:2, Insightful)

    by Thiez (1281866) on Sunday May 11, 2008 @06:06PM (#23372026)
    I never said such a thing, I merely (implicitly) pointed out that there there is, to my knowledge, no scientific theory that suggests that genetic code was written by some entity, instead it suggests that it is a (rather impressive) case of self-modifying code. Where (R/D)NA 1.0 came from is still unclear, but given the way science has advanced the last hundred years, it would seem reasonable to assume we'll find it out at some point in the future (and it will probably be an explanation that does not involve a supernatural being, just like the ones we have for the lightning, disease, etc.). Now if we assume that there was no writer involved in the creation of (R/D)NA, then we can conclude that (R/D)NA was not written at all. However, many religions involve some kind of creator(s). Someone believing in such a religion might believe that (R/D)NA was 'written' by such a creator. Any argument in favor of the existance of such a writer based primarily on such a religion would not be a valid argument for anyone who is not a member of that specific religion, and therefore should not be used on slashdot, where people of many different religions (and many without any religion) are present.

    Long story short: I fail to see how you conclude form my former post that religion offends me, it does not. And we're being horribly off-topic.
  • by Cesium12 (1065628) on Sunday May 11, 2008 @06:22PM (#23372152)
    The universe actually has a memory leak. It's called entropy.
  • Re:A rare topic (Score:2, Insightful)

    by mikael (484) on Sunday May 11, 2008 @07:58PM (#23372766)
    It's absolutely mind-boggling to type 'free' in a Linux system, and find out that 800 Megabytes of 1 Gigabytes is in use, with just the Desktop and browser in use.

                total used free shared buffers cached
    Mem: 1032772 888948 143824 0 66088 397432
    -/+ buffers/cache: 425428 607344
    Swap: 1052216 323804 728412
  • Re:A rare topic (Score:3, Insightful)

    Just because it hasn't broken in the past 30 years is no indicator that you won't hit something in the next 30 that won't break it.
    In almost any other industry, that's true - but in software, it's patently false. If a process is running that properly handles all of its inputs and does what it is supposed to do in every conceivable scenario that it may be exposed to, then there's no reason to expect it would break in the next 30 or 300 years. This doesn't mean that you should never replace your systems - there are other valid reasons; only that saying "it's old and may break" is not really a valid reason to replace it.
  • by EmbeddedJanitor (597831) on Sunday May 11, 2008 @10:27PM (#23373726)
    The vast bulk of computers in the world are embedded systems and the vast bulk of these are very small micontrollers in appliances like rice cookers etc.

    Some of these micros have no RAM - just registers. The need for frugal computing will continue forever.

    Yes, it is true theat Moores Law also applies, to an extent, to these micros: you get faster and bigger devices for the same price. But Moore's Law works the other way too. A fixed capability device gets cheaper and cheaper. If a rice cooker manufacturer has a 50c controller in their rice cooker and can bring that cost down to 40c they'll do the software development needed to achieve this.

  • Re:A rare topic (Score:5, Insightful)

    by tsm_sf (545316) on Monday May 12, 2008 @12:05AM (#23374338) Journal
    There are two kinds of fool.
    One says, "This is old, and therefore good."
    And one says "This is new, and therefore better."

    John Brunner - The Shockwave Rider

    and we've all read that book at least once, right? RIGHT?
  • by rhakka (224319) on Monday May 12, 2008 @12:08AM (#23374352)
    yeah, communicating effectively with people instead of flaming them is certainly cause to get "fed up".

    When you try to express a concept that might piss people off, and you aren't trying to piss people off, saying so and expressing sensitivity to their beliefs isn't "PC", it's basic technique of a civilized person in conversation.

    note the word "civilized" typically connotes that you are attempting to be a civil person. While being an opinionated asshole is easy and fun (believe me, I know!) it is not effective communication unless your goal is to intimidate your listeners.

    I share your impatience with people with thin skins; I also share on a personal level your disdain for those people's "maturity". but the fact is, people are different, and some people have thin skins for legitimate reasons you have no knowledge of. recognizing that is simply showing your listener that you have a basic respect for them as a human being, and it typically goes a lot further to achieve final understanding that just beating them about the head with their own "hot buttons".

    in short, showing a little respect, deserved or not, is what it means to be civilized, IMHO. I don't always follow this. But whining about PC stuff is old and tired. Yeah, some people suck and are stupid and wussy; and it's still cool to be cool to people, by and large.
  • Re:A rare topic (Score:2, Insightful)

    by Gr8Apes (679165) on Monday May 12, 2008 @12:36AM (#23374522)

    Its just strange to hear of such a thing when you work with computers, and there are computer systems that "never go down". Mind boggling.
    Only true for those who've never been outside the MS world. Quite common for the rest of us. Well, ok, maybe "the rest of us" are a small lot who work on 5 9s systems, but again, it's about time this quit being a shock and started to be expected. Hell, my desktop system was only rebooted once every 6 to 9 months for a kernel patch that couldn't be done live between 91 and 95.
  • Re:A rare topic (Score:3, Insightful)

    by SnowZero (92219) on Monday May 12, 2008 @01:16AM (#23374732)
    In particular, the bootloader or the software updater itself. Those are both (1) relatively simple with a fixed problem scope, and (2) more dangerous to update than other software routines.

    Not to say it can't be done, it's just highly unlikely to be worth it, so I'd expect those routines to last quite a long time.
  • by Anonymous Coward on Monday May 12, 2008 @08:43AM (#23376644)
    In 1989 I rewrote the space shuttle nose wheel steering system using Karnaugh mapping to simplify the 16 boolean inputs.

    There were some problems with the steering system on earlier shuttle flights and new requirements were created by some really smart folks that I was assigned to implement. Due to the ugliness of my implementation, unless someone completely re-wrote that software, it wasn't going to be maintained. Any changes would force a complete re-write.

    Thanks to the team who helped validate all my test cases! The Nose Wheel Steering PARTY was fantastic, at least the little that I recall. Hey Spencer, JV, KM, DC, Amy, DC2, PD, LP, SM, and the rest of the FSW guys!

    A special thanks goes to PD (God rest his soul) for all his help. PD (insiders know him), went on to lead the team that did the drag shoot deployment software and write heart pacemaker software. He died a few years ago.
  • Re:A rare topic (Score:2, Insightful)

    by jantman (967064) on Monday May 12, 2008 @01:45PM (#23380790) Homepage
    Ahhh, generators, UPSs, and tigers, oh my! I work at a University that supports close to 100,000 students, faculty, and staff. We've got lots of systems. We've got lots of backup plans. We've got multiple redundant UPSs, multiple generators, and machines with multiple PSs, split between different circuits. I'm thoroughly convinced that the only way to have a truly redundant system is to have two mirrors --- on separate continents. Murphy's Law. If you have *any* single point of failure, it WILL fail. At the worst possible time. If you have two generators, UPSs, etc. the one day the generators kick on, there WILL be a fire in the wiring closet.
  • Re:A rare topic (Score:3, Insightful)

    by I Like Pudding (323363) on Monday May 12, 2008 @02:10PM (#23381194)

    That and the "if all your RAM isn't being used, it's going to waste" crowd.
    Non sequitur much? Also, it IS going to waste if it isn't being used, hence "free" RAM is used by the OS for disk cache.

    Kids, if your ancient BMW breaks down and you don't know how to fix it after a cursory glance, do you toss it in the trash and go buy the cheapest possible replacement Hyundai you can find?
    Let me fix that lousy, broken analogy: If a room full of BMW mechanics cannot start your car, GET A NEW FUCKING CAR. Believe it or not, not being able to find people who can properly maintain an environment is a liability.

There's a whole WORLD in a mud puddle! -- Doug Clifford