Slashdot Mirror


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."

354 comments

  1. Man this was in WIRED weeks ago by TerryAtWork · · Score: 0, Offtopic

    I have always gotten my story submissions rejected. I must remember to suggest ancient stuff.

    --
    It's Christmas everyday with BitTorrent.
  2. It's nice by e12532 · · Score: 3, Funny

    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...

    1. Re:It's nice by TerryAtWork · · Score: 2, Insightful

      That might be the case. I once had a BBS utility out there in the bad world but I never released the source code as it, frankly, embarrassed me.

      --
      It's Christmas everyday with BitTorrent.
    2. Re:It's nice by Anonymous Coward · · Score: 5, Insightful

      How can you tell if something is written elegantly if you cant see the source? Elegant code does not imply well working code and well working code doesnt mean that it is written elegantly. You can have a program that works great and never crashes but is written poorly and does not use the system efficiently. You can also have very buggy code that is written beautifully.

    3. Re:It's nice by josepha48 · · Score: 5, Insightful
      Well I can't see M$ code so I can't say. However the biggest advantage I see in open source is if the API is not clear you can look at the source to see exactly what the f*** is going on. I find this helps the most. (Debuggable, cause you have the code.)

      Also in open source, I find that if I write something someone else may have a mod that they want in it or they may make their mod on the code and then ask me to include it. I then review thier mod and determine the best way to include it in my code. They may also review my code and offer suggestions on how to improve the code. This does not happen all the time at corporations. I can't speak for all companies, but some that I have worked for, it is more important (read moneywise) to get the code done and to the client than to do it right and nicely. (Code review, by someone trying to modify it or by the owner?)

      Lastly in open source, developers are more likely to rewrite code and drop bad API's (gtk1.0 -> 1.2 -> 2.0 just look at the text widget, notebook and a few more) and do it right the second time around no matter how long it takes than private companies. (Rewrites and screw the client they'll get over it!). I think that this is becase in windows it has traditionally been much harder to have multiple copies of similar dlls than UNIX (not impossible, just more difficult, IMHO). Glibc is a good example of shared libs that you can have many versions of. M$ has a tendancy to wrap its API's on top of each other and keep old baggage around so you have no idea of what you are actually calling, or to change the API and then not tell you.

      --

      Only 'flamers' flame!

    4. Re:It's nice by Anonymous Coward · · Score: 5, Insightful

      I think it has to do with pressure of business that causes cruddy code. Often in my company we're asked to write full projects in 60 days or less -- that kind of tight schedule doesn't produce great code. Let's also not forget that open source code "matures", whereas in the corporate environment we rarely touch working code unless it's to add a new feature (in a day or two). It's a crying shame (and I frequently find myself crying), but we are just not allowed the time to go back and make the code "good".

      Rev 1.0 of any software is not as elegant as it could be; even in OpenSource. OpenSource has the luxury of not needing to move on to the next project ASAP to be profitable.

    5. Re:It's nice by Pieroxy · · Score: 3, Informative

      I think a hell of a lot of nice code will never be used. I remember in my former company (a dot-com), the only thing worth a look was the engineering team. Their very nice code (some of which is mine) will never be used considering the useless people in all the other parts of the company (CEO-VPs...)

      The company will probably be - according to the CEO himself - out of business in a couple of month. And all this beauty will be forgotten forever.

    6. Re:It's nice by Anonymous Coward · · Score: 5, Insightful

      "You can also have very buggy code that is written beautifully."

      I guess it depends on your definition of beautiful code. For me beauty is not in the formatting or the intricacy... but in simplicity. The same aesthetic that favors art with clean flowing lines that is punctuated with edges and corners or melodies and harmonies that smoothly slide in and out of each other applies to beautiful software. There are, believe it or not, beautiful pieces of Fortran IV out there --
      they do the job cleanly and efficiently while being easy to read and follow -- elegant. Elegant code tends to be less buggy because you can see what it's doing.

    7. Re:It's nice by DeadSea · · Score: 3, Informative

      The code that the article is about is neither concise nor elegant. The article is about Dragon speech recognition software which as miraculously survived several companies and failures. The article refers to it as "deep" code. Code that to hard to do over from scratch. The code in question is archived on 5000 CDs (the version control repository).

    8. Re:It's nice by pVoid · · Score: 4, Interesting
      you can't see microsoft code because you don't look.

      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.

    9. Re:It's nice by scot4875 · · Score: 3, Insightful

      M$ has a tendancy to wrap its API's on top of each other and keep old baggage around

      Granted, but the 'have no idea of what you are actually calling' part would only be applicable for someone who doesn't read documentation.

      or to change the API and then not tell you

      I call BS. Can you give an example?

      --Jeremy

      --
      Jesus was a liberal
    10. Re:It's nice by Anonymous Coward · · Score: 0

      Lost? Why? Am I the only person out there that keeps copies of his code/scripts and takes them with him on a regular basis? I re-use things I've done over and over again..usually not word for word...but, I always refer back to 'my' little library of tricks and such...and re-use on new jobs. None of my code...at least what's worth keeping has died...I keep it....

    11. Re:It's nice by twisty7867 · · Score: 1

      You have 16 hours a day that you can devote to going back and making the code "good" under the same revenue model that OSS is produced - none at all! As a programmer who receives or doesn't receive a very large bonus relative to the profit margin of my company, I have NO interest in "good" code - my interest is in the code which intersects minimum cost with maximum salability. This doesn't mean it's not important to code the Right Way, because bad coding often increases costs down the line, but often, it just doesn't matter.

    12. Re:It's nice by Mandomania · · Score: 1

      Hey, I didn't know you worked here. Where do you sit?

      --
      Mando

    13. Re:It's nice by Lodragandraoidh · · Score: 2, Insightful

      That must make you feel conflicted - giving your best for something that will not see the light of day.

      I feel that alot of coders *don't* give their all - for fear that their nuggets will be tied up and misused for profiteering via patent/copyright enfringment cases. They hold back their best work for open source or private projects - hence the blecherous state of most code bases. I earnestly pray that is the case, because it is more distressing to think of the alternative...

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
    14. Re:It's nice by Anonymous Coward · · Score: 5, Informative

      >>or to change the API and then not tell you

      >I call BS. Can you give an example?

      Here you go:

      MSDN Library (which came with Visual Studio), ODBC 3.51 Programmer's
      Reference, API Reference for SQLGetDiagRec():
      BufferLength
      [Input]
      Length (in bytes) of the *MessageText buffer. There is no maximum
      length of the diagnostic message text. If the value returned in
      *MessageText is of a Unicode string (when calling SQLGetDiagRecW),
      the BufferLength argument must be an even number.

      Freshly downloaded Microsoft Data Access 2.6 SDK,
      same ODB 3.51 Programmer's Reference, API Reference for SQLGetDiagRec():

      BufferLength
      [Input]
      Length of the *MessageText buffer in characters. There is no maximum
      length of the diagnostic message text.

      It took me few days to figure that one out.
      Oracle ODBC call was corrupting heap.
      If length is in characters, no corruption.

    15. Re:It's nice by Anonymous Coward · · Score: 0

      OpenSource has the luxury of not needing to move on to the next project ASAP to be profitable.

      Maybe you think "open source" means "stuff I do for fun in my spare time". You probably got this idea from looking at a place like Sourceforge, and seeing that 99% of the projects there are crap like this.

      In fact, "open source" just means it's, well, open source. It doesn't mean some of us aren't paid to write code, add features, or that it isn't written under deadlines.

      There's nothing magic about "open source" that causes it to automatically have good design 100% of the time. If it ends up with good design, it gets there the same way proprietary programs have good design: because somebody designed it well.

    16. Re:It's nice by Anonymous Coward · · Score: 0

      They did announce that change- it was part of (I think) the transition from ODBC 2.x to ODBC 3. If the Devstudio docs still say the length is in bytes that's a documentation error since the API was changed and announced years ago.

    17. Re:It's nice by spitzak · · Score: 5, Insightful
      Thus code that a programmer knows many others will look at appears to be well-written. This is as good of an argument for OSS as any other.

      I think if you look at a typical closed-source driver written by a hardware manufacturer based on this code you will see some really bad stuff. While open-source Linux drivers, even if based on sample code for other drivers, is a lot better. Closed-source linux drivers seem to be as bad as non-MicroSoft Windows drivers and crash a lot.

    18. Re:It's nice by ruzel · · Score: 1

      This true because it's true of all projects, not just code. I have a design firm and we do both traditional media work (printing, posters, collateral, advertising) as well as some coding for Flash, Director, Scoop and PHP. The client dictates the quality of the product from the outset by deciding to listen/not listen to our recommended price and schedule. Clients that heed our experience end up with well thought-out, elegant materials. Those who are in a hurry get hurried thought and hurried results, which are simply never award winning.

      As for clients that completely put money before quality, well, we're a successful enough design firm that we can fire them. And we frequently do because history shows that those clients (also read: bosses) who are only concerned with money have no problem skirting on bills and the like. People who appreciate quality never have a problem paying for it. Cheapskates, by their nature, do not understand what quality is.

      That is not to say that good work cannot be done for free, but in the case where free is involved, deep love is as well.
      _______________________________

    19. Re:It's nice by dcmeserve · · Score: 1

      > You have 16 hours a day that you can devote to going back and making the code "good" under the same revenue model that OSS is produced - none at all!

      But OSS offers other benefits. The glory possibility is one. But also, since the code is not going to be imprisoned inside some company (or project within a company) that may well go kaput in a few years, it can be inherently more satisfying to write. That can be enough incentive to go write it with some of your extra 16 hours/day instead of watching TV.

      Closed source offers *only* the revenue as reward. Yes, of course, if you've got a revenue/overtime-based bonus plan, or you're in a central position within the company (e.g. founder), that's can be a hell of a lot more incentive than what OSS offers. But if you're just a regular-joe programmer in a big company, doing the 8hrs/day that gets you all the revenue you're gonna get, OSS can be an attractive use of the other 16.

      --
      "Orthodoxy is unconsciousness" - Orwell
    20. Re:It's nice by jbanana · · Score: 1

      I'm perturbed by the fact that at the end of a project I am given time to document what I've done, so I can explain to some future maintenance programmer what's wrong with my code, but I'm not allowed to fix it because it's working well enough to go live. If I change the code at that point they'll have to regression test it, and there's no time for that.

    21. Re:It's nice by dcmeserve · · Score: 1

      I can offer a little info on what MS code is like -- at least, what it *was* like, as of 1993, when I was an intern there for one summer. That was on the Excel team.

      This was back when Bill Gates was merely a $6 billion-dollar man, and the Excel team still used a Borland code-editor program running on OS/2 (I assume they've changed that since then). The code was still 95% straight C code, though they were using a C++ compiler on it, and a lot of the comments I saw were of the // style.

      They used the "hungarian" variable-naming convention. Which, when I got used to it, I rather liked a lot. It lends a certain amount of self-documentation/consistency/navigability to the code, no matter who writes it. I still use a simplified version of it today. Unfortunately, what I saw there was a very, VERY heavy reliance on that aspect -- *actual* comments were very few and far between.

      But the most striking aspect of the code, that I could tell, was what I came to call it's being "upgraded beyond all recognition". I could see the remnants of what was once an extremely elegant, well-organized program. But those parts of the code were like a skeleton swimming around inside an 800-pound person. So many features had been added everywhere that it was really turning into a mess -- for example, there were whole multi-level data structures added where you could only get get to them by following a miscellaneous pointer shoved into the struct's of older data structures.

      I want to point out, by the way, that this was still a really excellent team of engineers. A lot of fun personalities and just really smart people. But they were subject to the whims of, oh what were they called -- the Program Directors?? Those were a whole other team of people who were totally non-programmers -- their job was to just keep thinking of new features to add, I guess based on user comments, market research, maybe their own "wouldn't it be cool" ideas as well. They would write up some sort of specification of the new features in a standard format, and give them to the programmers, who then had to find some way to stick them in.

      When I was there, they had just finished inserting OLE into Excel. My mentor on the team called that "the worst thing that ever happened to the program".

      I wonder what's happened since then? :)

      --
      "Orthodoxy is unconsciousness" - Orwell
    22. Re:It's nice by theLOUDroom · · Score: 2, Informative

      They did announce that change- it was part of (I think) the transition from ODBC 2.x to ODBC 3. If the Devstudio docs still say the length is in bytes that's a documentation error since the API was changed and announced years ago.

      Now I call BS:
      If it's not in the API documentation, then it's undocumented.

      Maybe there's a note about it somewhere else, but things like changelogs are not an API reference. Documentation is meaningless unless it's in the right place. I'm not saying MS did this on purpose, but you've got to concede that he gave a valid example. You were just setting yourself up anyways. Did you really think that no one on /. would have a single example of an undocumented API change?

      Is it really that hard to believe that large software projects can have mistakes in their API documentation? It seems rather obvious to me. Whenever a project gets big enough, there are going to be a few bugs. OSS makes it easier to trace these bugs, because you don't have to blindly rely on documentation (which may be flawed). If something seems awry, you can look at the source. Then you know what you are actually calling.

      --
      Life is too short to proofread.
    23. Re:It's nice by Anonymous Coward · · Score: 0

      I was forced to work M$ code too, and it sucks, and swore never to look at that crap again, and havent. If you want proof, just look at MFC files, litterred (literally) with Macros... it should be re-named to Macro Foundation Classes. These are the people who gave C++ a bad name.

    24. Re:It's nice by Anonymous Coward · · Score: 0

      Well explains why Windows is successful on the desktop and Linux isnt. Linux GUI = Lousy GUI

    25. Re:It's nice by 21mhz · · Score: 1

      I agree on samples, but looking into some dark corners of the MFC sources raises my hair. For a vivid example, look at the code for some OLE helpers.

      It's hardly a comforting thought to suppose that some patchwork like this still creeps under glossy new frameworks with punctuation characters in names.

      --
      My exception safety is -fno-exceptions.
    26. Re:It's nice by Aviancer · · Score: 1

      Yeah, sourceforge is where I do "fun stuff in my spare time". Paid programmers on OSS projects just get the codebase going though. The hobbists are the folks who fix glaring errors that "work" well enough, but are eyesores or personal peeves. I agree with you that there is no magic that gets OSS perfect design, especially on the first rev or two -- it just allows a larger creative body to attack problems.

    27. Re:It's nice by sparkz · · Score: 1
      F/OSS also has the benefit of not having to call itself "1.0" on release.

      I am convinced that this helps coders and users - look at Phoenix 0.5 - it's the best browser I have ever seen, but I'll forgive it for crashing (twice since 0.2, IIRC) because it's not 1.0

      Still the best browser on the planet, IMHO (and for what I want, of course).

      --
      Author, Shell Scripting : Expert Re
    28. Re:It's nice by Wile+E.+Heresiarch · · Score: 1
      There are, believe it or not, beautiful pieces of Fortran IV out there --
      You better believe it. If we're looking for long-lived code, we should start looking at Netlib. Netlib is full of beautiful code -- beautiful in part because it is beautifully written, but also because it expresses beautiful ideas. What makes the bazillions of lines of C++ and Javascript disposable is that it's mostly about ideas that might just as well be forgotten.

      My nomination for the Beautiful Fortran Award would have to be ARPACK. It is clear, concise, elegant, efficient, and TOTALLY ROCKS. Eigenvalue problems are not easy, which only increases the beauty of any solution.

    29. Re:It's nice by Anonymous Coward · · Score: 0
      I think it has to do with pressure of business that causes cruddy code.

      Interesting. At my work, I feel less pressure to rush code out the door because the schedule is *so* laughably optimistic that, even if it were coded in quick n' dirty fashion, it *still* wouldn't be done in time. (Sad isn't it. We tell them it's hopeless. They won't listen.)

      But then, when the original goals/timeline inevitably gets sh*tcanned and work starts on VerySimilarProject, I can at least re-use good code instead of starting everything from scratch. If you keep a regular progress report (and make good progress on your end), nobody can blame you for the original failure.

    30. Re:It's nice by Fallen_Knight · · Score: 1

      code can be to simple, so simple it isn't Elegant anymore

      I'm in university takeing a advanced C++ course (well i don't call it advanced at all cuz its really just teaching C++ to java coders and i sleep thru it) and i know C, and a fair but of C++ already.

      in the assingment i can do this:
      printf("%9d%23s%6.2f", int, str, float);
      to get my formattaed line, witch i read fine, and maybe its just me but gets what that line is going to look like to a reader preatty fast.

      But i have to use cout and it ends up being 9 lines of couts and it takes alot more thinking and looking at it to figure out what its going to look like on the screen.

      The prof says only cout, no printf allowed, at all. its the 'new' way to do things and its better then the 'old' way says he.

      but i find the printf much more elegant, thou yet not as simple as cout.

      id like for someone to tell me what is just so great about cout (and its similar classes)

    31. Re:It's nice by JonK · · Score: 2, Informative
      Here's what's so great - consider:

      printf("%9d%23s%6.2f", int, str, float);

      which will, as you'd expect, print out an integer, a string and a number. Now, what happens when I type (by mistake) this:

      printf("%9d%23s%6.2f", str, int, float);

      The compiler's quite happy with it, isn't it. So, how about:

      printf("%9d%23s%6.2f", float);

      Again, the compiler's quite happy with it. So, that should be lesson #1: the compiler can't help you with printf() format strings. Instead you're on your own - better make sure you got them right. It becomes even more fun when the format string's being constructed elsewhere and then passed to you - better make sure that you and the guy who's coding the format string builder are singing from the same hymn sheet, 'cos otherwise it'll get messy.

      Secondly, what's the format specifier for a complex number?

      printf("%9d + %9di", myComplex.real, myComplex.imaginary);

      Not very pretty, is it? How about a matrix?

      Because you've overloaded operator << appropriately for your custom types, your types can behave the same way as the native C++ ones - this was, and is, one of BS's drivers for the C++ type system. printf() gives none of these guarantees, and imposes a whole heap of extra work on you - plus it's got this artificial model where emitting output to a file is different from emitting it to a buffer is different to emitting it to screen (yes, I know that the last one's not entirely true, but you get the idea). Then you get a second set of printf() functions to handle wide characters, such as you'd find in Unicode, or the MBCS encodings.

      Oh, and why are you using nine lines of couts - you can chain streams (operator << should always return a reference to a stream) so you get, instead of your example above:

      cout << setw(9) << myInt << myString.substr(0, 23) << setprecision() << setwidth() << myFloat;

      or even:

      cout << setw(9) << myInt << setw(23) << myString << setprecision(2) << setw(6) << myFloat;

      Take-home message: wake up in class and start thinking the C++ way - it's not C, and it's not Java either. It's a completely different language - it just so happens that most C programs are valid C++ programs too, and you can use C++ as a Better C, but you're missing out on all the fun...

      --
      Cheers

      Jon
    32. Re:It's nice by some+guy+I+know · · Score: 1

      cout can be better than printf for outputing datatypes other than those that printf supports directly.
      For example, for a complex variable c, "cout << c;" is better than "printf("(%g,%g)", c.r, c.i);".

      --
      Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
    33. Re:It's nice by z01d · · Score: 2, Informative

      id like for someone to tell me what is just so great about cout (and its similar classes)

      by using cout, you can write the operator<<() for you own class, so the code looks a little bit more elegant than use printf():

      cout << instance;

      printf ("%s", instance.toString());

      and cout can prevent novice programmer to write printf (str); which may leads to unpredictable result.

      further more, cout is a instance of ostream, which means you can take the advantage of so called "polymorphism":

      ClassName::dumpTo (ostream &os);

      you can pass the cout as the parameter, you can use a ofstream too. well, i know you can use fprintf to do the job in C-style. but by write your own class which inherited from ostream, you can dumpTo socket/database/screen...you got the point.

    34. Re:It's nice by Anonymous Coward · · Score: 0

      It's you - by and large Open Source code is VERY poor from a professional point of view.

      The vast majority of Open Source software I've seen (and I've seen a lot, worked on a lot) has at least some of the following sins:

      - Vastly differing or simply poor coding styles.
      (I've more than once seen code with
      absolutely no blank lines or spacing and
      I once saw a ternary operation that went 14
      levels deep!)

      - Poor source documentation.
      (Remember... source code is written for
      HUMANS not computers. You should be able
      to read it and understand it and
      documentation goes a long way to achieving
      that.)

      - Irrelevant comments
      (one piece of code I saw had a GROCERY LIST
      in it and an ongoing conversation about
      where bleach was on sale!)

      - Old code that has not been removed (alternately, new code that hasn't been used).

      So, no... I'm NOT impressed by Open Source code because most of it is total crap that may get the job done but which leaves much to be desired from the point of view of it being "good code"

    35. Re:It's nice by Wolfrider · · Score: 1

      --Speaking of rocking back and forth in a corner:

      >> "Even an old Cobol system can end up pushed out onto the Web, driving a new site," says Grady Booch, chief scientist at Rational Software and an expert on programming practices.

      --COBOL?! God save us!!

      ( I can say that, I took TWO YEARS of Vocational Cobol. ;D )

      --
      .
      == WolfriderV6 == I'm willing to admit that *I just might* be wrong... Are you??
    36. Re:It's nice by Fallen_Knight · · Score: 1

      Hmm, now i see why my teacher is all for it, it does make it much harder to make a mistake. Also easier to learn.

      i almost never make a mistake with the format string, and the few times i have it was damn easy to find, when your expected output string is 1/2 done and your program crashes you know what did it:) Also if your useing GCC it'll catch that kind of error....

      cout does have its place, but for simple formatted output like above printf is cleaner and easier to read because if only its less to read.

      thou for my school we have to use MSVC and putting everything one 1 line like that doesn't work. Coplie errors

  3. Like DNA? by Overand · · Score: 4, Insightful

    Code that lasts 'forever' and gets passed along, like DNA? How unusual!

  4. reverse code... by Anonymous Coward · · Score: 0

    Yeah....that's why I always my code backward...

  5. Re:Your Sig by e12532 · · Score: 0, Offtopic

    Offtopic, but there's an online peition for Palladium or whatever they're caling it now, here

  6. Here's some REALLY immortal code by Anonymous Coward · · Score: 5, Funny

    #! /bin/bash

    while true; do
    sleep 1
    done

    1. Re:Here's some REALLY immortal code by buzzsport · · Score: 5, Funny

      ^C

    2. Re:Here's some REALLY immortal code by Anonymous Coward · · Score: 1, Interesting

      For any right triangle with sides of length A and B and hypoteneuse of length C,

      A^2 + B^2 = C^2

    3. Re:Here's some REALLY immortal code by marko123 · · Score: 2, Funny

      ^Z
      bg

      move along. nothing to see here...

      --
      http://pcblues.com - Digits and Wood
    4. Re:Here's some REALLY immortal code by poot_rootbeer · · Score: 4, Funny


      Immortal? Hardly. I was able to kill it.

    5. Re:Here's some REALLY immortal code by vadim_t · · Score: 1

      This reminds me of a funny program I wrote once. It made shutting down Win9x really impossible. This is because Win9x has no tools to do the equivalent of kill -9 instantly. It first asks the program nicely, and if it doesn't react lets you kill it.

      So what my program does is starting several copies of itself, and re-executing itself and terminating when it gets a nice request to terminate. Unless you're *very* fast, or have a tool for it you're not going to get rid of it.

      WinNT/2K/XP has the task manager, so it's not effective there.

    6. Re:Here's some REALLY immortal code by josh+crawley · · Score: 1

      Does (DEFUNCT) mean anything to you? It's hard to kill the undead.

    7. Re:Here's some REALLY immortal code by Anonymous Coward · · Score: 0

      Here's some from the old TRS-80 Color Computer days. It's immortal and annoying, especially when you would do it one of the demo machines at the front of the Radio Shack:

      10 FOR A=1 TO 1000:NEXT A
      20 SOUND 10,10
      30 GOTO 20

      Time to RUN RUN RUN!

    8. Re:Here's some REALLY immortal code by xod · · Score: 1

      Cute....sort of. This should never have been moderated all the way up to 5.

    9. Re:Here's some REALLY immortal code by the+way,+what're+you · · Score: 1
      For any right triangle with sides of length A and B and hypoteneuse of length C,

      A^2 + B^2 = C^2

      Not on a sphere...

      --
      example.org - powered by Linux!
    10. Re:Here's some REALLY immortal code by gmuslera · · Score: 1

      10 PRINT "Hello World!"

    11. Re:Here's some REALLY immortal code by Alien+Being · · Score: 1

      Did you wait for the zombie?

    12. Re:Here's some REALLY immortal code by Anonymous Coward · · Score: 0

      Whew. +5 Funny for 2 characters. M4d pr0ps. :-)

    13. Re:Here's some REALLY immortal code by Spellbinder · · Score: 1

      you can easily hide programs from taskmanager... or protect them

      --


      stop supporting microsoft with pirating their software!!!!!
    14. Re:Here's some REALLY immortal code by AndrewRUK · · Score: 1

      you forgot the
      20 GOTO 10

      or, if you're of the "who needs whitespace" mentality,
      1?"Hello world!"2GOTO1
      will do nicely.

  7. Good one by Anonymous Coward · · Score: 1, Funny

    Refreshing, like the "In modern-day France..." ones.

  8. What was the point of that article? by jj_johny · · Score: 4, Insightful
    I read it and it says that people buy assets of failed companies and sometimes those assets are - oh mi ga - software code. Well I was as suprised as I have ever been that you could buy the software code assets of failed companies.

    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.

    1. Re:What was the point of that article? by Anne+Thwacks · · Score: 2, Insightful
      Good code gets bought and reused

      Generally, if the programmer who wrote it has been laid off, the code is binned.

      --
      Sent from my ASR33 using ASCII
  9. Excuse me? by Anonymous Coward · · Score: 5, Insightful

    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...

    1. Re:Excuse me? by On+Lawn · · Score: 5, Interesting

      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.

  10. OSS and Immortal Code by Peter_Pork · · Score: 5, Insightful

    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.

    1. Re:OSS and Immortal Code by horza · · Score: 1

      it takes many iterations to create perfect code

      s/perfect/sphagetti/

      Phillip.

  11. Elegant code like this? by StevenMaurer · · Score: 4, Funny

    int main()
    {
    printf("Hello world\n");
    return 0;
    }

    Seems like the most well known piece of code in programming history.

    1. Re:Elegant code like this? by JHMirage · · Score: 1
      Actually, in my mind the most classic piece of code was one I always found running on TRS-80s and such in RadioShack years ago:

      10 PRINT "YOU ARE DUMB"
      20 GOTO 10

      Where "YOU ARE DUMB" could, of course, be replaced by any number of swear words, etc.

      --

      A man talking sense to himself is no madder than a man talking nonsense not to himself.
    2. Re:Elegant code like this? by JimDabell · · Score: 4, Funny

      So well known that you forgot a bit of it :)

      #include <stdio.h>
    3. Re:Elegant code like this? by Anonymous Coward · · Score: 0

      You forgot the comma between Hello and world, Steven. Note the comma before Steven in the previous sentence? Same deal here. It's good punctuation and it's how K&R wrote it.

    4. Re:Elegant code like this? by Anonymous Coward · · Score: 0

      On the other hand, this is an example of bad code:

      int main()
      {
      printf("Fuck you, world\n");
      return 0;
      }

    5. Re:Elegant code like this? by Kryptoff · · Score: 1

      This reminds me of a funny happening where some friends told me of an interesting problem: Write a program that writes (on the standard output) the listing of the program!

      They showed me some quite interesting C and Pascal source code to do that. But then I realized that the simplest way was to use the best language for the job:

      10 LIST

    6. Re:Elegant code like this? by teslatug · · Score: 1

      I cut off its head (er), don't you know that's how immortals die.

      There can be only one.

    7. Re:Elegant code like this? by PhxBlue · · Score: 2, Funny

      Wot, no commenting? :)

      --
      !#@%*)anks for hanging up the phone, dear.
    8. Re:Elegant code like this? by Anonymous Coward · · Score: 0

      Not as well known and widely distributed as worms and viruses.

    9. Re:Elegant code like this? by Anonymous Coward · · Score: 0

      Doesn't ANSI C mandate either "void main(void)" or "int main(int,char**)"???

    10. Re:Elegant code like this? by Anonymous Coward · · Score: 0

      Actually, in early versions of the C compiler, the #include wasn't necessary.

      The original Hello World program from the 1st edition K&R book doesn't have it, and on my PDP-11 emulator running 7th Edition UNIX, cc compiles the program just fine without it.

      Putting it in creates an "undefined control" error...

    11. Re:Elegant code like this? by CaseyB · · Score: 1
      10 PRINT "YOU ARE DUMB ";

      Would give you a better effect in most BASICs, as it would suppress the trailing carriage return and fill the whole screen instead of just the left side.

    12. Re:Elegant code like this? by Pathwalker · · Score: 1

      Atari basic could do one shorter than that:

      10 L.

  12. Immortal code - which do you know? by jschrod · · Score: 5, Interesting
    There are code pieces I think might get immortal. Henry Spencer's regexp routines come to mind.

    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]

    1. Re:Immortal code - which do you know? by Anne+Thwacks · · Score: 4, Insightful
      The BSD TCP/IP stack - this must be the most re-used software ever - its in everything that does internet - and it has the famous BSD licence.

      --
      Sent from my ASR33 using ASCII
    2. Re:Immortal code - which do you know? by Anonymous Coward · · Score: 0

      X11R6, dude!

    3. Re:Immortal code - which do you know? by mandolin · · Score: 1
      The BSD TCP/IP stack - this must be the most re-used software ever - its in everything that does internet

      Except for Linux (and the Hurd, which borrowed Linux's stack).

    4. Re:Immortal code - which do you know? by LadyLucky · · Score: 1

      Except for windows. It hasn't used the BSD TCP/IP stack in a really long time.

      --
      dominionrd.blogspot.com - Restaurants on
    5. Re:Immortal code - which do you know? by jschrod · · Score: 1
      I didn't mean complete programs that are used again and again and again. I meant code that is incorporated in many programs and thus get's immortal.

      The TCP/IP-stack, or zlib are very good examples; I should have thought of them. Once there was getdate.y - but I don't know if that's still used nowadays.

      --

      Joachim

      People don't write Manifestos any more -- what's going on in this world? [Frank Zappa]

  13. Obligatory Userfriendly Comic by Indras · · Score: 1, Funny
    --
    The speed of time is one second per second.
  14. The Book by s20451 · · Score: 4, Interesting

    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.
    1. Re:The Book by Anonymous Coward · · Score: 0

      I'd think that God would use the same book since math == code after all.

    2. Re:The Book by Anonymous Coward · · Score: 0

      God does not care about our mathematical difficulties. He integrates empirically.

    3. Re:The Book by galactic-sludge-merc · · Score: 1

      Now that's elegant. :)

    4. Re:The Book by Anonymous Coward · · Score: 0

      Didn't Erdos used to refer to people who do maths as "humans.", implying that anyone who didn't was less than human. What a fucking charmer he was...

    5. Re:The Book by jbanana · · Score: 1

      As Erdos was Hungarian, the pronounciation of his surname is not obvious. Here's a helpful limerick.

      A question both deep and profound
      Is whether a circle is round
      In a paper by Erdos
      Written in Kurdish
      A counter example is found

    6. Re:The Book by kubrick · · Score: 1

      Yeah, the man was a nutter. Still a genius, though.

      --
      deus does not exist but if he does
    7. Re:The Book by tree_frog · · Score: 1

      Isn't it called "The Art of Computer Programming", currently maintained by Donald Knuth ?

    8. Re:The Book by stanmann · · Score: 1

      Erdos I don't know, however your comment reminds me of one of my favorites.

      Anybody who cannot comprehend mathematics is not fully human. At best he is a tolerable subhuman who has learned to wash, cook food, and not make messes on the floor.--RAH

      --
      Food not Bombs is a nice platitude but it breaks down when you notice that the Bombees are usually well fed
  15. Re:Immortal code by Anonymous Coward · · Score: 5, Funny
    C:\>/sbin/iptables -I FORWARD -p udp --dport 1434 -j DROP
    The system cannot find the path specified.

    C:\>

  16. Hello World, of course! by Amsterdam+Vallon · · Score: 5, Funny

    ... 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.
    1. Re:Hello World, of course! by Anonymous Coward · · Score: 0

      UMMM COBOL, there was something neat about COBOL. But there is plenty to say for python, like:
      print 'hello, world!'

    2. Re:Hello World, of course! by Anonymous Coward · · Score: 0
      The Tao gave birth to machine language.
      Machine language gave birth to the assembler.

      The assembler gave birth to the compiler. Now there
      are ten thousand languages.

      Each language has its purpose, however humble. Each
      language expresses the Yin and Yang of software.
      Each language has its place within the Tao.

      But do not program in COBOL if you can avoid it.
      The Tao of Programming
  17. Doubtful by dubbayu_d_40 · · Score: 4, Insightful

    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...

    1. Re:Doubtful by Anonymous Coward · · Score: 0

      Organic?! You found the secret formula to turn bits into fetilizer!!!!

    2. Re:Doubtful by dubbayu_d_40 · · Score: 4, Insightful

      Good algorithms transcend the media on which they are stored and their language of implemenation.

    3. Re:Doubtful by Mr.+Slippery · · Score: 3, Informative
      Who doesn't keep a copy of their work, especially if it is good?

      Those who are afraid of being crushed by lawyers for violating NDAs, that's who.

      Last time I was job hunting I was asked for a code sample...all I could produce was a 2000 line Perl hack I did for my own amusement. Which was about all the Perl I've ever written, I'm a C/C++ guy. But I can't share anyone of the stuff I've done professionally, it's all copyrighted to my employers and trapped under non-disclosure agreements. (Well, some of the stuff I did back in grad school might be publically available somewhere.)

      --
      Tom Swiss | the infamous tms | my blog
      You cannot wash away blood with blood
    4. Re:Doubtful by Salamander · · Score: 4, Insightful

      Good for you. Just last week a guy I was interviewing showed me (unasked) a spec he'd done, as a sample of his work. The copyright/confidentiality notice for a very large company was clearly printed right across the top. Needless to say, I told him to put it away and made sure he progressed no further through the interview process. I'm all for people distributing their own code freely, but I can't condone giving away someone else's trade secrets.

      --
      Slashdot - News for Herds. Stuff that Splatters.
    5. Re:Doubtful by Anonymous Coward · · Score: 1, Insightful

      You've NEVER written code just for you? Not once? My fucking god, no wonder today's apps suck so much - all the coders are in it for the money, not because they enjoy the job.

    6. Re:Doubtful by chworktap · · Score: 3, Insightful
      Good point. (Poorly made, but good point).

      The best programmers are the ones who program at least partially because of its intrinsic rewards. Whenever I interview a potential programmer, I always ask them to describe the last coding project they did purely for fun. The best developers I know always have several projects going on in the back of their heads.

    7. Re:Doubtful by DickBreath · · Score: 1

      Good algorithms transcend the media on which they are stored and their language of implemenation.

      But some extremely clever hacks are deeply tied to the language of their implementation, or the microprocessor instruction set, or to a bizarre aspect of the innards of Win 3.1.

      --

      I'll see your senator, and I'll raise you two judges.
  18. YEAH LIKE WATFIV! by Mainframes+ROCK! · · Score: 2, Interesting

    WATFIV (and WATFOR, WATBOL etc) are the classic example in my mind. Made by the University of Waterloo, now languishing somewhere (at Sybase maybe?!)

    1. Re:YEAH LIKE WATFIV! by mrtroy · · Score: 0

      go waterloo. ownage

      --
      [I can picture a world without war, without hate. I can picture us attacking that world, because they'd never expect it]
    2. Re:YEAH LIKE WATFIV! by biobogonics · · Score: 1

      WATFIV (and WATFOR, WATBOL etc) are the classic example in my mind. Made by the University of Waterloo, now languishing somewhere (at Sybase maybe?!) .

      NO! Open Watcom 1.0 Release Candidate, which contains C, C++ and Fortran 77 compilers was just posted to www.openwatcom.org.

      Now there are some things missing, like Fortran sample and include files, but so far this looks and works remarkably like Watcom's 11.x line. I don't know if there are MFC libraries and I do know that the STL is left out, but it's far from dead and buried. And it's open source.

      Why this did not get reported on Slashdot is a total mystery to me. Maybe because it's about a DOS/Windows product instead of Linux :-(.

    3. Re:YEAH LIKE WATFIV! by Xenu · · Score: 1

      WATFOR and WATFIV ran on time-shared IBM mainframes (360 series), at least when I used them many years ago. I'm not sure what they have in common, if anything, with WATCOM FORTRAN-77.

    4. Re:YEAH LIKE WATFIV! by biobogonics · · Score: 1

      perhaps WATFOR & WATFIV are not from the same codebase as WATFOR-77, but WATFOR has maintained two major features from the old mainframe days:

      1) its use as a debugging compiler
      2) "load and go" mode

  19. Re:Like DNA? PUN Alert by Anonymous Coward · · Score: 0

    That one probably survived because it pre-dates those pesky NDAs...

  20. In the end... by balthan · · Score: 1

    there can be only one.

  21. Who Is the Greatest Programmer? by Anonymous Coward · · Score: 2, Funny
    One of the first lessons that a student learns in his basic programming class is attention to detail. After typing in a program that I've given them, it is not uncommon to hear a number of students claiming that the program doesn't work. I reply, "If it doesn't work, it is because you didn't type it in correctly." This usually results in a great debate until I walk over to their computer and point out the missing parenthesis, spelling mistake, etc. Walla, the program now works!
    input "Your name is?" n$
    for x=1 to 100
    print "Hello ",n$
    next
    print "\n All done!"
    A computer program is simply a set of instructions that tells the computer what to do. Computers are not "smart" like humans, thus they require very specific instructions in order to do anything. These instructions must be entered precisely in a specific programming language (BASIC, JAVA, C++, etc.), and if a command is misspelled or a character is missing, the program will not run correctly (or at all).

    To write a program, it takes knowledge of the programming language, an understanding of logic, the discipline to pay strict attention to detail, and creativity. Programmers marvel as they sit back and watch the computer program "come to life" as it runs before their eyes. In the process of brainstorming, debugging, and thinking critically, they also gain a great respect for those who program on a regular basis.

    In fact, those who do program for a living or for their passion may wonder who the greatest programmer is. After all, programming is a science and art that requires time and skill. Who has the "bragging rights" to be the greatest programmer of all?

    To recognize the greatest programmer, we must first identify the greatest program. Is it Microsoft Word®? Is it Windows®? Is it Linux? Maybe it is the GCC compiler or Emacs. Maybe it is some top-secret program being written at the NSA. Maybe the greatest program is the one created to operate the greatest computer.

    So, what is the greatest computer? This may not seem to be an easy question as super-computer technology continues to improve at a swift pace. However, there is one computer that remains far more advanced than all the rest. We call it the human brain.

    Scientists will quickly agree with me that the brain is far more advanced than any computer we have to date. When you are reading this text, your brain is accomplishing a task that programmers can only dream about - true language comprehension. When you walk out to get a snack or drive your car to the store to refill the refrigerator, you outperform the most advanced computers money can buy. Therefore, is it safe to say that the "program" that operates your brain is the greatest program of all?

    What is this program that operates the brain? DNA. The amino-acid chains that form the DNA molecule store the "blueprints" and the "operating system" not only for the brain, but every cell and organ in your body. This incredible "program" is responsible for the formation and operation of the greatest computer in existence. So, who is the programmer?

    According to some of our great computer programmers, nobody. That's right, the program just happened. It was the random jumbling of atoms and molecules over millions of years that finally resulted in the greatest program and the greatest computer of all kind. We call this evolution.

    Computer programs evolve - we see it all the time. Each time a new version is released, it has hopefully evolved to include new features and bug-fixes since the last version. We are thankful for the intelligent programmers who work hard to improve their programs and add new features. However, how many programs evolve by the random shifting of bytes of data? In all my experience, these program "mutations" either result in either a dysfunctional program or a computer crash.
    In fact, we've been performing an experiment in evolution for years using computers. It is natural for data to randomly be scrambled due to everything from power surges to cosmic radiation. At the rate at which data is transmitted over our world-wide Internet, surely we should have seen some form of natural program evolution, if even on a small scale. According to those who support evolution, man evolved from ape which evolved from lower mammals which long ago originally evolved from single-cell organisms in the sea. Following this theory (and that's all evolution is), simple programs like text editors should someday evolve into operating systems or even some form of computer intelligence. Why don't we see this?

    A great programmer by the name of Richard Stallman wants the world to call Linux by the name of GNU/Linux. He wants the world to know that Linus Torvalds only created a small (but important) part of the overall Linux operating system. Much of what we call "Linux" is based on supporting GNU tools. He wants the credit due him for the intelligent, purposeful design behind the programs used to make Linux a complete operating system. In fact, most programmers would probably not take too kindly to not receiving some form of recognition for their work. Yet both Stallman and Torvalds (and many others) deny recognition to the greatest programmer of all, God.

    If I were to tell you that nobody wrote Microsoft Windows®, or Linux for that matter, but instead it just "happened" due to the random shifting of bytes in my computer's memory, you would wonder if I was attempting some form of dry humor. However, many people so easily accept the notion that both the greatest computer and the greatest program originated in just such a way. Logic dictates that if the simplest of programs requires intelligent, purposeful design, then so does the most advanced and complex program in existence. To say otherwise is foolishness.

    The answer to the question, "Who is the greatest programmer of all?" is quite simple - it is God. It baffles me how programming and atheism often goes hand-in-hand when the programmer shares the very character of God in his creativity and purposeful design. Therefore, it is God whom I honor above all other programmers, because God's "program", His creation, was perfect (not anymore, thanks to sin) and to this day has no equal.

    RMS talks about "Free as in Freedom." True freedom is knowing the creator. As a programmer takes pride in their work, so does God take pride in and love His creation. You are very special to God, and He waits for you to seek Him and find Him. If you don't know God but you would like to, I invite you to visit the Billy Graham website. Billy Graham is one of the most respected evangelists of our century and speaks the straight truth. I also encourage you to talk with the pastor at a local church, or a friend who knows God. Most importantly, talk to God - He's listening.

    "But if serving the LORD seems undesirable to you, then choose for yourselves this day whom you will serve, whether the gods your forefathers served beyond the River, or the gods of the Amorites, in whose land you are living. But as for me and my household, we will serve the LORD." Joshua 24:15
    1. Re:Who Is the Greatest Programmer? by jridley · · Score: 4, Funny

      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".

    2. Re:Who Is the Greatest Programmer? by bmalia · · Score: 2, Funny

      Why did you turn computer programming into bible study?

      2Pet.2
      [16] But was rebuked for his iniquity: the dumb ass speaking with man's voice forbad the madness of the prophet.

      --
      There's no place like ~/
    3. Re:Who Is the Greatest Programmer? by calethix · · Score: 1

      whoah.

      And I thought I was bored at work today.

    4. Re:Who Is the Greatest Programmer? by Bill+Currie · · Score: 1

      Considering the bug count, I'ld say you're waaaay off base :)

      --

      Bill - aka taniwha
      --
      Leave others their otherness. -- Aratak

    5. Re:Who Is the Greatest Programmer? by kgarcia · · Score: 1

      And I bet you were just wating for an article like this to hit "cut and paste" on your beautifully-formulated-christian perspective article on just what creationism is, right?

      or maybe you'll just start cutting-pasting this excact post into every programming related article you see on /. now, right?

      Lemme tell you something man, your above posts makes the rest of us creationists look bad. Because of ppl like you, we are ridiculed, called fanatics, and the like. Start by some simple christian witnessing... attend parties, get to know people, be outgoing... in other words, associate with everyone, not with your holier-than-though bretheren...

      well... now that i've burned karma for no apparent reason...

      i'm off

    6. Re:Who Is the Greatest Programmer? by Anonymous Coward · · Score: 1, Funny

      The answer to the question, "Who is the greatest programmer of all?" is quite simple - it is God. &gtsnip&lt

      RMS talks about "Free as in Freedom." True freedom is knowing the creator.


      I would have said "well done", except that you were unable to work RMS and god into the same sentence. So close to perfection, and yet so far away...

      try again tomorrow, child.

      -RMS

    7. Re:Who Is the Greatest Programmer? by Flamerule · · Score: 1
      According to some of our great computer programmers, nobody. That's right, the program just happened. It was the random jumbling of atoms and molecules over millions of years that finally resulted in the greatest program and the greatest computer of all kind. We call this evolution.
      You call it evolution -- an intelligent person calls it a strawman.

      Do yourself a favor: take half the time it took for you to write that screed, and spend it educating yourself.

      Come back with a convincing argument they don't have an answer for at talk.origins, and I'll send your trolling ass a check for $1000.

    8. Re:Who Is the Greatest Programmer? by PhxBlue · · Score: 2, Insightful

      I don't agree with the premise that DNA is "the program that operates the brain." DNA is the hardware; my personality, what makes me who I am, is built over that. A gene in my family that predisposes me to alcoholism doesn't automatically make me an alcoholic--it simply means there's an exploit in my OS which may be exploited through excessive alcohol use. The final decision on who I am, however, rests with me.

      True, some people are content to be nothing more than their DNA or their background dictates. But we can reprogram our brains, just as we can reprogram any other computer.

      --
      !#@%*)anks for hanging up the phone, dear.
    9. Re:Who Is the Greatest Programmer? by PhxBlue · · Score: 1

      Incidentally: Given Einstein's statement, "God does not play dice;" and given that most programming languages have an rnd() function; God cannot exist. When he vanishes in his "puff of theological smoke," please, blow off with him.

      --
      !#@%*)anks for hanging up the phone, dear.
    10. Re:Who Is the Greatest Programmer? by Anonymous Coward · · Score: 0

      I see nothing uncromulent with Walla, but I think we all know he really meant Viola ;-)

    11. Re:Who Is the Greatest Programmer? by lyle_hanson · · Score: 2, Funny
      well... now that i've burned karma for no apparent reason...

      No problem, you're a Christian, you don't buy into that karma stuff anyway, right?

      --
      :q!
    12. Re:Who Is the Greatest Programmer? by lyle_hanson · · Score: 2, Funny
      It is natural for data to randomly be scrambled due to everything from power surges to cosmic radiation. At the rate at which data is transmitted over our world-wide Internet, surely we should have seen some form of natural program evolution, if even on a small scale.

      I'd like to introduce you to my friend, TCP Checksum. I don't think it's very probable that you'd see much 'evolution' based on random scrambling, since we're careful to guard against it. However, you should look into artificial life and genetic algorithms... now even atheists can play god!

      --
      :q!
    13. Re:Who Is the Greatest Programmer? by delcielo · · Score: 3, Funny

      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!
    14. Re:Who Is the Greatest Programmer? by Anonymous Coward · · Score: 0

      Why would he have meant a stringed instrument? Perhaps you meant Voila.

    15. Re:Who Is the Greatest Programmer? by Anonymous Coward · · Score: 0

      http://www.walla.co.il or http://www.walla.com

    16. Re:Who Is the Greatest Programmer? by aardvarkjoe · · Score: 1

      Actually, if you are a good example of one, I would be led to believe that creationists utterly lack a sense of humor.

      --

      How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
    17. Re:Who Is the Greatest Programmer? by Anonymous Coward · · Score: 0

      Die you ignorant piece of shit

    18. Re:Who Is the Greatest Programmer? by Anonymous Coward · · Score: 0

      This analogy is moronic.

    19. Re:Who Is the Greatest Programmer? by PhxBlue · · Score: 1

      The "God is the Great Programmer" analogy was even worse. What's your point?

      --
      !#@%*)anks for hanging up the phone, dear.
    20. Re:Who Is the Greatest Programmer? by Anonymous Coward · · Score: 0

      Ah, but a computer cannot generate genuinely random numbers - you're talking about pseudo-random.

    21. Re:Who Is the Greatest Programmer? by PhxBlue · · Score: 1

      Good point. Would that point to the possibility of a pseudo-Deity, such that the odds of His existence are randomly scattered between 0 and 1?

      --
      !#@%*)anks for hanging up the phone, dear.
  22. Oldest working code... by Anonymous Coward · · Score: 5, Interesting

    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?

    1. Re:Oldest working code... by Frobnicator · · Score: 5, Insightful
      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.
      How about DNA?
      --
      //TODO: Think of witty sig statement
    2. Re:Oldest working code... by jridley · · Score: 4, Interesting

      There are millions of lines of code running in financial institutions from possibly as early as the late 50's for which the source is lost. That's why there are emulators. I've heard that some places have emulators running emulators running emulators running their original compiled code.

      Much of it may be replaced by now but when i was taking my CS classes back in the 80's I was told this was true.

    3. Re:Oldest working code... by Mainframes+ROCK! · · Score: 1
      what may be some of the oldest "working" code that's publicly available.

      There are emulators such as Hercules for old mainframes and some of the code, which is freely available, goes back to the early 60s. One example that springs to mind is the IBM Algol-F compiler, circa 1965.

      Complete source code of compilers for the Neliac programming language are printed in the book "Machine-independent computer programming" by Maurice Halstead. Circa 1962.

    4. Re:Oldest working code... by Anonymous Coward · · Score: 0

      So 20 years ago you heard a rumor about this from your college buddy? Sounds reliable to me...

    5. Re:Oldest working code... by n__0 · · Score: 2, Interesting

      Space war has been running since the 60s I think, on a website somewhere there is an emulation of the original machne running in java using the complete original code. I may be wrong though.

    6. Re:Oldest working code... by Blikbok · · Score: 2, Informative

      http://agents.www.media.mit.edu/groups/el/projects /spacewar/

    7. Re:Oldest working code... by Anonymous Coward · · Score: 0

      Unfortunatly all we have is the object code. Someone should contact the author and see if he's willing to GPL the source.

    8. Re:Oldest working code... by Anonymous Coward · · Score: 1, Interesting

      European Center for Nuclear Research has CERNLIB which is has some ancient Fortran routines in it. Also, there is an old beast named SAGE that simulates particle decay distributions -- it was certainly written Fortran IV. I knew someone who used the SAGE precursor. I think the oldest comment I ever saw in SAGE was about 1966, but it might have been 1969.
      With respect to the original article, SAGE is immortal but somebody should have put a stake through it's heart years ago. Inside it looks like it's still trying to run on a machine with 64kb RAM and plays all the dirty EQUIVALENCE tricks necessary to do so.
      This necessitates the question: is the probability of becoming immortal code related to the code itself or what it does?

    9. Re:Oldest working code... by mike3411 · · Score: 1

      Not really, DNA is very much a source code, it must be "compiled" by other molecules to create working a working program (life) or run subroutines (proteins). RNA is interesting in that it can self-replicate without the need for other parties. All in all, I'd have to say RNA/DNA is much more elegant and intelligent than other coding languages.

      --
      Mod me down, and I will become more powerful than you can possibly imagine!
    10. Re:Oldest working code... by Tokerat · · Score: 1


      Heh, yea next time my girlfriend comes over we'll try out that compiling part, thanks. :-)

      --
      CAn'T CompreHend SARcaSm?
    11. Re:Oldest working code... by Sinical · · Score: 3, Interesting

      Not exactly out in the wild, but not exactly purely for an industry, are mathematical routines and the like.

      For instance, a lot of aerodynamics code I've seen is written in Fortran IV or Fortan 77. It's often not the nicest formatting and stuff, but Fortran compiles cleanly, and the code still does it's job, so people still use it: it's also easy to interface Fortran and C/C++, which is a bonus. So you build on the core of this hard mathematical stuff that was written long ago.

      Of course, part of that's bad, because there's a chance there're some gotchas still in there that wouldn't be understood anymore, but thankfully a career in my industry is quite long typically, so there's often a gray-haired sage that you can consult.

      I think things that do math (even financial calculations) are more likely to last, because those kinds of operations endure.

    12. Re:Oldest working code... by Anonymous Coward · · Score: 0

      Yeah right.

      Like any girl would ever want to get within 100 yards of you.

      Dream on, loser.

    13. Re: Oldest working code... by Black+Parrot · · Score: 1


      > Heh, yea next time my girlfriend comes over we'll try out that compiling part, thanks. :-)

      Actually, it's probably the linking part that you'll be eager to try.

      If she's old-fashioned she might insist on a binding right afterward.

      --
      Sheesh, evil *and* a jerk. -- Jade
    14. Re:Oldest working code... by jstott · · Score: 3, Informative
      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?

      Try www.netlib.org. It's all mathematical libraries, the old stuff is all in Fortran, and it does still get used even though some of it goes back to the late 60's and early 70's. Completely debugged code is hard to find, and when you get your hands on it, you hang on to it forever.

      -JS

      --
      Vanity of vanities, all is vanity...
    15. Re:Oldest working code... by sjames · · Score: 1

      Perhaps, but I do know that there are many places running code old enough that the hardware is no longer available. Financial institutions are good examples. The math hasn't changed and the auditors have found all of the math errors (including rounding problems). In many cases, the source has been gone for years (possibly when someone dropped the deck) and every change since then has been done by patching the object code (manually!).

      In part, that is a legacy of immature code maintainance and the fragility of punched card storage. Another part was that there was no 'configuration file' in those days. It was EXPECTED that your programmers would modify the code to suit your specific needs. An upgrade was a painful procedure that involved rewriting all of your local modifications to fit the new version. A lot of newer code has either been slowly modified until it bears no resemblance to the older version, or was replaced outright when the machine that ran it was decomissioned.

    16. Re:Oldest working code... by rabidcow · · Score: 1

      DNA is very much a source code

      DNA is object code. It can pretty much only be read (as in understood) by the machine where it executes. Converting it to a list of proteins that it will produce (microcode dispatch, btw) is roughly analogous to converting machine code to assembly. You still don't really know what it *does*.

      It's not source until you can see a call to CreateRedBloodCell().

    17. Re:Oldest working code... by Anonymous Coward · · Score: 0

      Yeah right. Loser.

  23. the only truly "immortal" code... by Anonymous Coward · · Score: 2, Funny

    is BAD code, as bad code never dies... right?

    1. Re:the only truly "immortal" code... by Jack+Greenbaum · · Score: 1
      All joking aside, it is definitely the BAD CODE that lives forever.

      It lives forever because it is the code too ugly to remove because you might never get the system working again if you do. It was written by that smelly guy who hummed while he noisily chewed powered donuts and burped out loud when he finished his coke. That guy that everyone was glad left the company -- until they had to maintain his code. -- Jack

  24. SlashWired by Travelr9 · · Score: 1, Funny

    This is the third recent posting to Slashdot from the current issue of Wired Magazine: the 'Year the Music Dies' cover piece, the 'Civil War Within Sony' piece, and now this. Sure, they're all interesting, but do we really need the editors to hold our hand and lead us to the biggest and most famous computer/culture magazine? Aren't we geeks? Let me summarize for the slow: READ WIRED!

    If you do need guidance in finding cool Wired articles, check out this 1996 gem on hacker tourism and the laying of fiber optic inter-continental cables by SF god Neal Stephenson, Mother Earth, Mother Board

    1. Re:SlashWired by Flamerule · · Score: 2, Insightful
      Sure, they're all interesting, but do we really need the editors to hold our hand and lead us to the biggest and most famous computer/culture magazine?
      At the upper-left corner of http://slashdot.org/, it says "News for Nerds. Stuff that matters." /. receives submissions on news stories the editors believe will be of interest to readers, and posts those stories. These stories come from many different sources, and save readers the task of browsing dozens or scores of websites to get content.
      READ WIRED!
      I read /. so that I won't have to read Wired... and Ars Technica, and C|Net, and any other online news source.
      [...] by SF god Neal Stephenson [...]
      Neal Stephenson is not a god.
    2. Re:SlashWired by Travelr9 · · Score: 1

      [...] by SF god Neal Stephenson
      [...] Neal Stephenson is not a god.

      Depends on your definition. Mine happens to be, 'one who sees farther and more clearly than other mere mortals'. Stephenson definitely qualifies.

      That doesn't mean he's necessarily a great writer -- but as a sad litany from Aristophanes to Hemingway demonstrates, great writers are usually all too human.

  25. Intentional programming by Anonymous Coward · · Score: 1, Interesting
    1. Re:Intentional programming by Anonymous Coward · · Score: 0

      I recomment you download and view that asf video on IP as this is some cool stuff for an IDE.

    2. Re:Intentional programming by Anonymous Coward · · Score: 0
  26. Funny, I never thought of it this way... by Anonymous Coward · · Score: 0

    OK, so I thought that this was a poorly written article, but this quote about sums up the stupidity:

    "Yet if coders are happy to toss out what their predecessors create, and lawyers are pleased to hear about it (after all, property rotting in the garbage rarely leads to lawsuits)..."

    Sure, lawyers hate lawsuits... I still don't understand this...

    1. Re:Funny, I never thought of it this way... by Anonymous Coward · · Score: 0

      It only sums up your stupidity.

      The point of the statement is liability: some lawyers get paid for reducing liability for their customers. That's why corperations have legal staff.

  27. Lifetime of code... by mseeger · · Score: 4, Interesting
    Hi,

    there are several limitations for the lifetime of code:

    • Hardware lifetime: hardware specific code may loose its usefullness once the hardware itself becomes obsolete.
    • Purpose lifetime: A lot of code serves a temporary purpose. Once the purpose is achieved or dropped, the code will die.
    • Language: A code in an obsolete programming language will probably be dropped as there is no one to judge the elegancy of it.

    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

    1. Re:Lifetime of code... by stripmarkup · · Score: 2, Insightful

      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

      In that case, a "software engineer" would be someone dedicated to designing and building systems by putting together building blocks of code, instead of writing code from scratch. Software would start to resemble other engineering disciplines.

      --
      See charts for twitter trends on Trendistic
    2. Re:Lifetime of code... by mseeger · · Score: 1
      In that case, a "software engineer" would be someone dedicated to designing and building systems by putting together building blocks of code, instead of writing code from scratch. Software would start to resemble other engineering disciplines.

      Would this be a good or a bad thing? This would probably depend on the personal view. I know a lot of software engineers who see it as an art and would loose all interest once it would become real engineering.

      I already thought ten years ago hat this was about to happen. Instead i see today more lousy code from more lousy coders than ever.

      Yours, Martin

    3. Re:Lifetime of code... by Mr.+Slippery · · Score: 1
      I know a lot of software engineers who see it as an art and would loose all interest once it would become real engineering.

      I've just about come to the conclusion that "engineering" is simply not the right way to think about creating good software.

      Not that we can't steal tricks from the engineers, of course, but there are large gulfs between software and "engineered" creations. Compare software with bridges:

      • People have built plenty of bridges, that vary only in parameters: pick a type, height, and length, and a good civil engineer can easily work out the details. Most interesting software products are unique efforts - if it's been done before often enough, it gets put into a library, and the target of the next software project grows by an order of magnitude.
      • No one has to port a bridge to a new processor architecture or operating system. No one changes the semantics of rivets.
      • Software is made out of words, words that have to communicate to no only a machine but to other humans. This brings artistic considerations into scope, not just in making the overall design pretty but making the infrastructure and the parts beautiful.

      Good software design and development requires not only engineering skills, but poetic ones as well.

      --
      Tom Swiss | the infamous tms | my blog
      You cannot wash away blood with blood
  28. The article never makes its point by unfortunateson · · Score: 5, Insightful

    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!
    1. Re:The article never makes its point by Anne+Thwacks · · Score: 1
      Bits of CP/M still floating through Linux

      There is probably more CPM in Windows than in Linux.

      The original version of Collosal Cave, reputedly the second ever computer game (Lunar Landings was first), written in Fortran for the PDP11, is still found on all BSD, and most Linux systems. And its still one of the best ever games!

      --
      Sent from my ASR33 using ASCII
    2. Re:The article never makes its point by horza · · Score: 1

      It shows no examples of immortal code.

      The bubble sort. No matter how hard you try and kill it, there is always a fresh crop of undergrads that thinks it's ok to use in production code. It'll never die, despite there not being any excuse for ever using it.

      Phillip.

    3. Re:The article never makes its point by some+guy+I+know · · Score: 1

      Bubble sort is fine for sorting "almost sorted" lists.

      For example, let's assume that we have a bunch of objects in a deque, sorted on some field.
      During the operation of the program, this field is incremented or decremented by 1.
      After changing value, the object "bubbles" itself to a new postion in the deque, if necessary.

      Another place where a bubble sort might be appropriate is for lists of very few items, say, five or six.

      I agree, however, that the BS is used far too often.

      --
      Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
  29. We call them design patterns by Anonymous Coward · · Score: 0

    Unless you are talking about the Clone method of immortallity (copy, paste) in which case you should be retired forcibly.

  30. AJH 68K Asm by Anonymous Coward · · Score: 0

    Andy J Hertzfeld's 68K asm code for various Mac user interface components (we're talking Mac original/ancient stuff now) is a pure joy to read.

    It takes a while to comprehend but it's extremely small, sleek and witty.

  31. Saving code by www.sorehands.com · · Score: 1

    In some cases, I save source code in the file code by commenting it out. There are some cases where I remove features, but leave the code behind where I think it may be brought back in the future.

    1. Re:Saving code by borgboy · · Score: 1

      Heaven forbid you use some crappy old revision control system. That would make the current code set readable and legacy code retrievable. Ewwww.

      --
      meh.
  32. Most elegant code I've seen... by LePrince · · Score: 1

    I ain't no programmer but one of my colleague wrote a stress-test perl script, that looked something like this :

    while (1 == 1)
    {
    some i/o, memory, disk-intensive commands
    }

    It had to run 48 hours on a server before he plugged it on the network, to be sure it was stable. If it survived, well, it was ready ! :-)

    1. Re:Most elegant code I've seen... by Anonymous Coward · · Score: 0

      I ain't no programmer

      You aint smart either.

    2. Re:Most elegant code I've seen... by ethereal · · Score: 1

      That code's going to run a lot longer than 48 hours - you forgot the punch line about how long it took your friend to figure it out :)

      --

      Your right to not believe: Americans United for Separation of Church and

    3. Re:Most elegant code I've seen... by LePrince · · Score: 1

      Well, he KNEW that was supposed to run forever you know. It was a stress-test, and he stopped it after like 48 hours HIMSELF. You know, CTRL-C. ;-)

    4. Re:Most elegant code I've seen... by ethereal · · Score: 1

      Yeah, I know. But the initial incorrect mental image was so humorous I felt the need to share.

      --

      Your right to not believe: Americans United for Separation of Church and

  33. It's just an AD!!! by Anonymous Coward · · Score: 0

    for DragonDictate~

  34. Duff's Device by Tokerat · · Score: 3, Interesting


    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?
    1. Re:Duff's Device by Junks+Jerzey · · Score: 1

      PS: Yea, I do believe it beats the living crap out of memcpy() or BlockMove()

      It's one of the fastest ways to do this in C, but if you've ever looked at the source code to an OS-level memory copying function, then you'll often see much faster, system specific methods. On the PowerPC, for example, you can get a signficant speedup by using cache manipulation instructions.

    2. Re:Duff's Device by Tokerat · · Score: 1

      Very true. Assembly would make this even faster, and in fact makes such a construction obsolete. But it's just so weird and yet so fast, and quite easy to implement once you've learned how it works.

      I really never grasped how this doesn't choke a compiler to death but then again I've never written a complier, nor do I know the first thing about it.

      That made me think of an interesting question: Is it the code or the algorithm which is actually immortal?

      --
      CAn'T CompreHend SARcaSm?
    3. Re:Duff's Device by Chocolate+Teapot · · Score: 3, Interesting
      Judging by your reference to BlockMove(), I take it you are a Mac programmer? In which case, you would gain a lot more by:

      a) Moving 32 bits at a time instead of 16

      b) Use four source pointers and four dest pointers, allowing the pipelining to really scream on the PPC

      c) Consider using Altivec (very Mac specific though)

      d) Lose that f***ing % operator, which will do a lovely job of stalling the integer pipelines while it computes the modulo. ( count & 0x03) does the same thing much quicker.

      In some cases, you can easily beat BlockMove(), especially if you know that your memory was nicely aligned on 4 byte boundaries. However, pit you code up against BlockMove() with mis-aligned data (especially if both the source and dest are on weird alignments) then BlockMove() will whip your sorry ass. My $0.02

      --
      Modest doubt is called the beacon of the wise. - William Shakespeare
    4. Re:Duff's Device by Chocolate+Teapot · · Score: 2, Insightful

      In my other response I omitted the cache manipulation stuff. That really rocks if you get it right. Assembly will seldom beat a good optimiser these days, but a good knowledge of disassembled code will help you write C/C+ code in such a way as to make life easy for the optimiser, whilst still maintaining a degree of portability to your code.

      --
      Modest doubt is called the beacon of the wise. - William Shakespeare
    5. Re:Duff's Device by hughk · · Score: 1
      Actually, Duff did this the most elegantly in C. However, I had seen the equivalent in assembler much earlier. The buffer mover used by the RSX11-M executive running on the 16-bit PDP-11 used the assembler version and was written in the seventies. I'm sure that other implementations were written but Digital's highly configurable executive had todelivered in source form.

      The author was a certain David N. Cutler. He works for Microsoft now.

      --
      See my journal, I write things there
    6. Re:Duff's Device by giel · · Score: 1

      I'm sure it does.
      Unaware of the fact that the idea existed, I've developed the same mechanism for graphics routines back in '90.

      Besides from the optmized example I think small pieces of C like these are quite immortal:

      1.) while (*d++ = *s++) ;
      2.) *s++ = pushv;
      3.) *--s = popv;
      Yes, they are blatantly obvious, but so is cutting when you have a knife. Funny thing about these is that the assignment statements map one on one with machinecode instructions found on the CPU's of the old PDP-11, on which C and Unix were born.

      And there are brilliant algorithm's for greatest common divizor calculation, multiplication and divizion... Not to mention Bresenham's Algorithm, which is a very elegant way to draw lines. It's very usefull too for changing sampling rates when writing music software.

      But an important point the article is focused on, is what makes code immortal... It seems the mortality of code is controlled by the greedyness of industry. Companies willing to kill each other for reaping and stealing code. Vultures! Well if code is free you cannot steal it. If it lives everywhere you can't kill. Open Source Software.

      --
      giel.y contains 2 shift/reduce conflicts
    7. Re:Duff's Device by Anonymous Coward · · Score: 1, Insightful

      > d) Lose that f***ing % operator, which will do a lovely job of stalling the integer pipelines while it computes the modulo. ( count & 0x03) does the same thing much quicker.

      Or lose whatever compiler won't optimize "% 8" into "& 7" for you. Certainly any one written in the last 20 years will do that (at least if you have optimization enabled)

    8. Re:Duff's Device by Anonymous Coward · · Score: 1, Informative

      This is pretty cool, jumping into an unrolled loop. I have seen this done in assembly many times before, but not in C. BTW, the division can be done with n >> 3 and the modulo can be done with n & 7.

    9. Re:Duff's Device by giel · · Score: 1

      In my experience compilers (nowadays) are quite good at deciding which to use:
      n % 8 or n & 0x7
      and stuff like:
      a + a, 2 * a or a .

      --
      giel.y contains 2 shift/reduce conflicts
    10. Re:Duff's Device by Anonymous Coward · · Score: 1, Informative

      PS: Yea, I do believe it beats the living crap out of memcpy() or BlockMove() or whatever other routine your using ;-)

      rep movsd used to be pretty swift. (in fact, I'm not sure why it isn't still the fastest method, the chip designers could make it just do cache line moves or whatever, couldn't they?)

    11. Re:Duff's Device by Anonymous Coward · · Score: 1, Informative

      Isn't there a quadword rep mov now? In any case, mov with a rep prefix will trash that little C trick on any Intel processor starting from about the 286. memcpy uses rep mov but does extra checking to make sure your blocks aren't aliased. If you know they aren't up front, an unchecked rep mov is about as fast as you can get.

    12. Re:Duff's Device by Chocolate+Teapot · · Score: 2, Interesting
      In my experience compilers (nowadays) are quite good at deciding which to use:
      You would think so, wouldn't you, but last time I looked at this (last year) CodeWarrior didn't do this. Probably an old version I expect. AFAIR though, the Microsoft compiler seemed to benefit from explicitly using & in place of % as well. IMO, it's always worth double checking the disassembled output if the code is speed critical. You never know what a change in a compiler or it's flags might do. (Of course I meant & 0x07, not & 0x03)
      --
      Modest doubt is called the beacon of the wise. - William Shakespeare
    13. Re:Duff's Device by Bill+Currie · · Score: 1
      Due to how parsing works, you actually have to jump through hoops to get the C compiler to complain about Duff's Device. Duff's Device is a natural by-product of the very simple rules used to construct the grammar. You would have to do things like detecting whether or not there are intervening nesting levels between the switch statement and the case statements. It certainly can be done, but (IMO), it's not worth the effort.

      NOTE, I have implemented a compiler :)

      --

      Bill - aka taniwha
      --
      Leave others their otherness. -- Aratak

    14. Re:Duff's Device by Anonymous Coward · · Score: 0

      rep movs vs a tight loop

      Depends on your intel cpu. Some pentiums, due to pipelines etc... will actual move memory faster with a tight loop instead of rep movs. Hand optimizing is much more difficult since the 486 because you can't just add up the clocks anymore. Pipeline stalls are much more important.

    15. Re:Duff's Device by Anonymous Coward · · Score: 0

      Nothing special... Not until you starts using the A0-A6, D0-D7 and if possible floating point registers for memory moves.

    16. Re:Duff's Device by Tokerat · · Score: 1

      Judging by your reference to BlockMove(), I take it you are a Mac programmer?

      Unfortuantely I have been out of the loop for a logn while as far as programming goes. I'm still trying to catch up on all the new things I need to know about OS X :-/ but yes, I am a Mac programmer.

      Moving 32 instead of 16 is nice, but IIRC the PowerPC can move 64 in one instruction (note this may take 2 cycles)? I cant' find any of my reference material anywhere, but I could have sworn the 604e and higher can move a double straight up. Ahh I'll look it up later. A book about Mac game programming called "Sex, Lies, and Video Games" is actually where i first learned of Duff's Device and in this book, as part of the advanced graphics chapter, Duff's Device is expanded apon to utilize the larger-than-a-byte moves which are possible. Unfortunately the book was written long ago and is well obsolete.

      I'm not familiar with PPC pipeline optimizations, know a good source of reference?

      AltiVec wouldnt' really offer very much unless you're doing mass mathmatical operations while transfering (add 0 and move 128 bits at once? or does the answer go to a register or the original memory location? can you access memory directly with AltiVec?). Might be nice for some kind of Geiss/G-Force type effects though. Again I'm not familiar with AltiVec in the least, except that it makes complex math fast because it's many mathmatical operations in parallel, and it's only availible on the G4 (and hopefully higher).

      Yea, % sucks. No question there.

      Another lesson in that book was that when blitting it was actually a huge optimization to modify the copy rectangle's boundries so it would copy from an even 4-byte boundry to another even 4-byte boundry. That has improved some of my code 300%.

      --
      CAn'T CompreHend SARcaSm?
    17. Re:Duff's Device by Chocolate+Teapot · · Score: 2, Informative
      Moving 32 instead of 16 is nice, but IIRC the PowerPC can move 64 in one instruction (note this may take 2 cycles)? I cant' find any of my reference material anywhere, but I could have sworn the 604e and higher can move a double straight up
      In my experience, using the FP registers in this way did not yield any performance increase on the PPC. In some cases it was slower.
      I'm not familiar with PPC pipeline optimizations, know a good source of reference?
      I guess Google is the best place to start. Basically though, the PPC (currently) can perform up to four integer operations in parallel and one floating point operation (hence my suggestion that you use four src & dest pointers, adding 4 to each pointer every time round the loop). If your code requires the completion of a floating point operation before further integer operations can continue, then you could be delaying all four integer pipelines.
      AltiVec wouldnt' really offer very much unless you're doing mass mathmatical operations while transfering (add 0 and move 128 bits at once? or does the answer go to a register or the original memory location? can you access memory directly with AltiVec?). Might be nice for some kind of Geiss/G-Force type effects though. Again I'm not familiar with AltiVec in the least, except that it makes complex math fast because it's many mathmatical operations in parallel, and it's only availible on the G4 (and hopefully higher).
      AltiVec needs to obtain it's data from somewhere. Consequently, it has 128-bit load and store operations (last time I looked at BlockMoveData() in MacsBug, I noticed that it used them when available. Check out Apple's AltiVec HomePage for a bunch of useful information. It also covers cache optimisation and memory alignment techniques. This (off-topic) sub-thread has kind of assumed that we are only talking about memory copies. Many of the optimisation techniques discussed also apply to other operations on large blocks of memory (e.g. masked copies). We haven't even touched on overlapping memory blocks :)
      --
      Modest doubt is called the beacon of the wise. - William Shakespeare
    18. Re:Duff's Device by psavo · · Score: 1

      BTW, the division can be done with n >> 3 and the modulo can be done with n & 7.

      This is so basic compiler stuff that it's actually taught in uni here. Which means it've been implemented in all compilers since 1970.

      --
      fucktard is a tenderhearted description
    19. Re:Duff's Device by swillden · · Score: 4, Interesting

      Actually, Duff did this the most elegantly in C. However, I had seen the equivalent in assembler much earlier.

      Duff had also seen, and written, the same construct in assembler many times. His Device was born out of frustration that he would have to drop down to assembler to unroll his loop. His fit of genius led him to try to construct it in C, and he was surprised when it compiled without complaint and ran perfectly.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    20. Re:Duff's Device by mav[LAG] · · Score: 1

      I disagree. A knowledgable human using assembly will nearly always beat any optimiser, be it a compiler or a human tweaking a high-level language. For a start he can cheat by using that good knowledge of disassembled code. Write good code in HLL, examine compiler output and improve it. Compilers are getting good at fast copies and simple maths routines but they know jack about your customised graphics inner loop which has to run like a speed demon. They will generalise and that's where Assembly Dude (tm) can step up and start optimising by hand.
      Assembly Dude also knows more about his algorithms and data than the compiler does - yet another unfair advantage - not to mention the various quirks of processor pipelines and AGI conditions if they exist. I agree that a good knowledge of compiler output helps you write better HLL code while keeping portability but for speed (and often size) a good asm programmer can run rings around any compiler.

      --
      --- Hot Shot City is particularly good.
    21. Re:Duff's Device by Foresto · · Score: 1
      "His fit of genius led him to try to construct it in C, and he was surprised when it compiled without complaint and ran perfectly."
      I agree that Duff's Device is clever, but I'm puzzled as to why he was surprised that it worked. Perhaps I can only say so because I learned C after it had been around a while, but his code looks totally straight forward to me. What's so amazing about it? Is it just that the programming community at that time hadn't fully explored the ways to exploit C syntax?
    22. Re:Duff's Device by grammar+fascist · · Score: 1

      ACK!

      I consider Bresenham's algorithm to be brilliant and immortal - but those others make me want to puke.

      Why? They are not blatantly obvious. Sure, if you know them and have mentally parsed and stepped through them in the past they are, but what if you haven't? Why curse your future maintainers with little "tricks" that do nothing but slow them down, and have very little (if any) positive benefit?

      The only nice thing I can say about them is that they're good logic puzzles for first- or second-year CS students.

      I'd rather my programs read more easily than that, thank you very much. Bresenham, Dijkstra, et al, get my respect; but the users of those monstrosities ought to be shot.

      IMO, of course. Not you, of course. If you've used them. Or not. Whatever.

      --
      I got my Linux laptop at System76.
    23. Re:Duff's Device by swillden · · Score: 1

      Looking back at his original comment, I overstated the "surprise" part. What Duff said was:

      Of course, if I were writing assembly language code, I'd just jump into the middle of the unwound loop to deal with the leftovers. Thinking about this yesterday, the following implementation occurred to me:

      [...]

      Disgusting, no? But it compiles and runs just fine. I feel a combination of pride and revulsion at this discovery. If no one's thought of it before, I think I'll name it after myself.

      It amazes me that after 10 years of writing C there are still little corners that I haven't explored fully. (Actually, I have another revolting way to use switches to implement interrupt driven state machines but it's too horrid to go into.) Many people (even bwk?) have said that the worst feature of C is that switches don't break automatically before each case label. This code forms some sort of argument in that debate, but I'm not sure whether it's for or against.
      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    24. Re:Duff's Device by nothings · · Score: 1
      Duff's Device is pessimal in the face of an optimizing compiler. By jumping into the unrolled loop, you prevent the compiler from moving code across the branch entry points. Duff's Device turns the unrolled code from a single long basic block to a sequence of basic blocks identical to the original non-unrolled code, which will optimize identically to the original non-unrolled code.

      A lot of the value of unrolling comes not merely from reducing the loop overhead (which Duff's Device still does) but from the ability to rearrange the code within the loop, such as moving loads forward and stores later. On a modern processor, out-of-order execution reduces the importance of such simple rearrangements, but it's still the case that it prevents any significant optimizations across the basic blocks.

    25. Re:Duff's Device by Anonymous Coward · · Score: 0

      You might also want to look into some English "code." It's been around for ages. For example you say you are (or you're) using not your using.

    26. Re:Duff's Device by Anonymous Coward · · Score: 0

      It would never occur to me that the do/while loop could span cases like that. As you say, it is an exploitation of C syntax. In other words, you're not supposed to write code that way, but the language kinda, sorta lets you anyway and seems to do something reasonable.

      Anyone who would write such bizarre looking code in a real system would get reamed out at a code review.

    27. Re:Duff's Device by hughk · · Score: 1
      It appears that Duff was working on the VAX, it suprises me why he didn't code the thing so that on a VAX, it produces the instruction:

      MOVC3 cnt, src dst

      Yes, the good old VAX could do some pretty awesome things as instructions (it was the king of CISC). This particular instruction is in the architecture so it will work whichever model you use. There was also a MOVC5 which would allow you to give different sizes for src and destination and if srclen was In later times, we would use an #ifdef to either use Duff's device or use the single instruction version.

      Another varient of Duff's device is the long multiply (much used for public key encryption). Instead of moves, you have an add carry and multiply sequence.

      --
      See my journal, I write things there
    28. Re:Duff's Device by p3d0 · · Score: 1
      I agree that Duff's Device is clever, but I'm puzzled as to why he was surprised that it worked.
      I'd be surprised too, because the loop and switch constructs are not properly nested: parts of the switch construct are inside the nested loop. That seems bizarre until you stop thinking of the switch as a construct and start thinking of it as a series of labels; and that is an unusual step. (I'm hard-pressed to think of another language that would accept code like that.)
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    29. Re:Duff's Device by some+guy+I+know · · Score: 1

      What most of the other repliers to this post are failing to notice is that he was using this code to move a block into an I/O register, i.e., the code was copying the source to a single memory address, not to sequential memory addresses.
      (Note the lack of ++es after the tos.)
      So memcpy, BlockMove, the Vax single byte-copy instructions, etc., are all inappropriate comparisons here, because they all copy to sequential memory locations.

      Now, if you want to modify his code so that it does a memory copy, then some of the other agruments in this thread may have some merit.

      --
      Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
    30. Re:Duff's Device by Anonymous Coward · · Score: 0

      But please, don't use Bresenham in music software unless you're short on CPU. The aliasing! Argh, my ears! Linear interpolation at least, but please Cubic Splines... and if you have enough cpu, there is a time and place for pre/post-filtered windowed sinc, you know, and that's in making it not suck.

    31. Re:Duff's Device by swillden · · Score: 1

      Duff was copying from a buffer to an I/O port, so MOVC3 was inapplicable; If you google for his original example, you'll notice that he doesn't increment the destination pointer. You'll also notice that he didn't bother with loop unrolling until he'd profiled, found the hot spot, looked at the assembly and focused on the two instructions that were the bottleneck. It was neither premature nor ineffective optimization. As Duff said later:

      The alternative to genuflecting before the god of code-bumming is finding a better algorithm. It should be clear that none such was available. If your code is too slow, you must make it faster. If no better algorithm is available, you must trim cycles.

      I took a class in VAX macro assembler and you're right, it's so CISC it's damn near a high-level language. Pretty cool stuff, and the vector processing on the VAX9000 I was playing with (for fun, the class never covered that) was really powerful. I could do Mandebrot set calculations unbelievably quickly...

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    32. Re:Duff's Device by hughk · · Score: 1
      Ah yes, that would certainly explain things. MOVC3 also ties up some registers.

      I loved that VAX macro but was rarely allowed to use it because of portability issues. The joke is that Digital wrote a Macro-32 compiler to get VMS up on the Alpha. It was sufficiently high level that it could be converted without too many problems. I loved that assembler though, like the PDP-11, the archiitecture was orthogonal so everything kind of made sense.

      Regrettably our high end VAXes couldn't be used for anything like Mandlebrots as the QA people had to vet all migrations into production. I managed to do some neat things elsewhere on the smaller systems that we had in development though.

      --
      See my journal, I write things there
    33. Re:Duff's Device by swillden · · Score: 1

      Regrettably our high end VAXes couldn't be used for anything like Mandlebrots as the QA people had to vet all migrations into production.

      I had my own troubles... it was a University machine and, technically, we had CPU budgets. They were just funny money, though, used for tracking which departments were making use of the system, but I nearly lost control of my bodily functions when I was presented with a $2.5M bill for my CPU usage and asked why I had basically monopolized 95% of the CPU time for nearly two months.

      I explained what I was doing (basically screwing around, but I dressed it up as "mathematical research"; hardly anyone knew what fractals were in 1988, so they didn't question me) and pointed out that I had my processes set to run at the lowest priority level available, so I was basically just sucking up all of the unused cycles. Since the machine was brand new, and most users hadn't even migrated over from the VAX 8700 that was being phased out, there were a *lot* of unused cycles.

      They asked me to please keep my usage down, but said that I could continue running my programs 24x7. When I pointed out that my usage would automatically decline as more load was placed on the machine by other users, they grumbled but told me to that was okay. I'm just glad they didn't look at my paper/ink usage on the big color plotter...

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    34. Re:Duff's Device by Tokerat · · Score: 1

      Spot on, I hadn't even noticed that in the sample code given on Duff's explaination page. IIRC (short on time, I'll look it up later) the code was meant to interface with a hardware blitter, making writing everything in serial fashion to an I/O register a reasonable thing.

      Modifying it to move memory blocks to other memory blocks does give it a valid comparison, at least it did on the old hardware I used to code for (68K->PPC 604e). Once I get back into the game (which I plan to quite soon actually), perhaps I will test this out.

      Who needs OpenGL? Long live 2D gaming! ;-)

      --
      CAn'T CompreHend SARcaSm?
  35. ZLib by Anonymous Coward · · Score: 0

    ZLib is everywhere.

  36. Makefiles by HisMother · · Score: 4, Interesting
    This story reminds me of the old saw that there is only one Makefile; everyone edits it for their own projects. There is grain of truth in that.

    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.
    1. Re:Makefiles by sparkz · · Score: 1
      Doesn't the autoconf/automake stuff diminish this rule? In that Makefile is generated from Makefile.in? I must admit, I tend to build Makefile by hand.

      I stopped editing other peoples' Makefiles once I spotted the importance of <TAB> (ie, within a day of encountering a Makefile)

      --
      Author, Shell Scripting : Expert Re
  37. Unbelievably depressing? by mellon · · Score: 5, Insightful

    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*!

    1. Re:Unbelievably depressing? by bandy · · Score: 1

      Totally and utterly screwed, left out in the cold by the new "owners".

      --
      "You might as well get your son a ticket to hell as give him a five string banjo." -unknown minister
    2. Re:Unbelievably depressing? by FuzzyBad-Mofo · · Score: 1

      I feel really bad for the developers they mentioned, but really, what were they thinking? Selling out their life's work, as you say, for stock options in a dot-com company? Ouch indeed.

    3. Re:Unbelievably depressing? by mellon · · Score: 1

      It's easy to see in retrospect that it wasn't a good idea, but this was back before all the corporate scandals, and people were a little less wary. I just hope they sold some of that stock before it completely lost its value, although if they did that's unfortunate for whoever bought it. Sigh.

    4. Re:Unbelievably depressing? by poot_rootbeer · · Score: 1


      Well, maybe they shouldn't have sold out to a large and crooked corporation then...

    5. Re:Unbelievably depressing? by npendleton · · Score: 1

      Planning ahead with contracts and BSD license could solve this. Letting the Bakers keep a "doomsday" source code archive and writing contracts that allowed the Bakers to "break glass" and open their code if the souce code buyer (H and L) defrauded them (manipulated stock price by more that 75%) or went bankrupt would largely resolve this sort of problem.

      Mac Refugee, Paper MCSE, Linux Wanna be!

    6. Re:Unbelievably depressing? by tellezj · · Score: 1

      I don't think they ever really coded anything. The article mentions a developer that changed companies with the code. Given their background, I bet they did a lot of the theoretical work and had someone else put it into code.

      --

      End of Line.

    7. Re:Unbelievably depressing? by prockcore · · Score: 1

      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*!

      If there was one story that advocated open source, this was it.

    8. Re:Unbelievably depressing? by ronfar · · Score: 2, Informative
      I find these types of stories amusing in an ironic sense, much the way gallows humor is amusing (I mean amusing to the person who is about to die). Dragon (which was devoured by the company that later imploded due to massive fraud) gets added to the list of companies that were destroyed when they were transfered from people who had pride and love for what they do into the hands of people who saw them as revenue streams, like Atari, Infocom, TSR Hobbies, and so on.

      You can always understand why the people did it. Warner Brothers assured Nolan Bushnell he would still be in charge of Atari before they forced him out. Many of TSR's problems were caused by Gary Gygax's sneaky venture capital guys (not to mention his vindictive ex-wife and the widow of a former partner). Some of the people at the top of Infocom from the very start were only interested in big bucks and wanted to enter the lucrative business software field and leave games behind. The founders of Dragon thought they would have time and money to pursue other projects related to their interests.

      Another thing, any company with a successful software product needs to be worried about embrace, extend and extinguish, not just from Microsoft, but from other big software companies. Look at Bleem! versus Sony. You'll always have to look over your shoulder for big, politically connected competitors with an unfair advantage in our mercantilist legal system. Money can help here, money can get you through frivolous lawsuits designed not to be won but to drain the life out of you. Money can even help you when your well-heeled competitors use pressure tactics at retail locations if they stock your product instead of theirs. Face it, in software or videogames and in most other businesses small only remains an option if you manage to remain under the big comglomorates and monopolists radar.

      Even a small company can face a hostile take over if any of its operating or startup expenses come from outside sources.

      --
      All the creatures will die, And all the things will be broken. That's the law of samurai. (Jubai, 1605)
    9. Re:Unbelievably depressing? by sparkz · · Score: 1
      I write code for my company; if I leave the firm, or if they go down, the code is gone.

      I would have no qualms in using the code as a demo of my ability (I wrote it) but couldn't use that code again.

      Coding is just typing, though. My current project has taken about 2 years (of my time - it's a 1-man project, really) of which maybe 2 weeks is coding. The skill is in the research, knowing what to do, and how to do it. That knowledge is mine, it lives in my head. The code is trivia. Coding is typing. Knowing what to type is understanding.

      OMG, this is starting to sound like Zen, but there's something in that, I suppose. The loop doesn't matter, it's why it's a loop that matters.

      --
      Author, Shell Scripting : Expert Re
    10. Re:Unbelievably depressing? by ediron2 · · Score: 1
      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*!
      It's just you.

      First off, they broke their own long-standing rule, and tried to sell their life's work for $300 Million. Who the Fsck needs 300 mills, considering that they could have had a much greater control over their life's work if they'd accepted a pheaper price? THEY SOLD THEIR LIFE'S WORK. THEY CHOSE TO SELL OUT. THEY DID NOT SELL LICENSES. THEY WERE CASHING OUT OF THE BUSINESS. Anything less of a goal would have a cheaper price-tag and more legal recourse now.

      Second, they could go 'a couple dozen exits' up the road and APPLY FOR A JOB. Sheesh, I should feel sorry for these people?! They're arguably expert in the field, and they live near the code's owner. If the new owner doesn't hire them, then some competitor will.

      Third, they could start over. Lessons learned come cheap the second time around. Ironically, I'd point to this when they started thinking of taking VeeCee money.

      Fourth, fifth, and sixth: Open Source, frequently release old versions to open source, and did I mention Open Source.

      No, it doesn't tear my heartstrings out. They grabbed at a damned valuable prize, and nowhere does the article talk about their current net worth. Somehow, I suspect this is because they are worth a STINKLOAD. Pity the poor rich capitalist? Not I. The ideas and knowledge they have are intact. The problem isn't solved. They could resume their pursuit of the goal, and they no doubt are financially well enough off that this won't be a hardship for them.

      On the other hand, 40000 companies went bankrupt in 2001. Assuming small-businesses dominate that list, for an average of just a few people per company, that still is a fraction of a Million people who are out of work. That's pain and suffering. This isn't. This is whining about ending up a millionaire instead of a billionaire, and MAN, I don't have time to listen to it...

      (waves hand) These are not the suffering masses you're looking for. Move along, now.

    11. Re:Unbelievably depressing? by Paradise+Pete · · Score: 1
      those two people who spent their lives working on Dragon Dictate wound up completely hosed, and can't hack on their lifes' work anymore.

      They had already given that up. For money. Now they have neither, but walking away from their work was their own choice.

  38. The code is not lost by Anonymous Coward · · Score: 5, Insightful

    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.

    1. Re:The code is not lost by frozenray · · Score: 2, Insightful

      > The code escapes on floppies and CD-Rs. Developers are always swiping copies of good code to take home.

      If Palladium* makes it onto the developers' PCs by order of the PHBs, these will be fond remembrances. Good for IP, bad for freedom and progress.

      Raymond

      *or whatever it's called today - a turd by any other name is still a turd

      --
      "There are already a million monkeys on a million typewriters, and Usenet is NOTHING like Shakespeare." - Blair Houghton
    2. Re:The code is not lost by Anonymous Coward · · Score: 0

      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.

      have you forgetten what happened to wen ho lee? its enough to make me think twice about taking my code w/ me. from the site: "solitary confinement in a cell in a New Mexico jail 23 hours a day for nine months . . . was shackled any time he is out of his cell, at his waist, his ankle and his wrist except when he is meeting with his lawyers (and even then he must wear an ankle chain). A chain around his belly connecting to his handcuff prevented him from raising his hand above his head."

  39. Elegant code by salimma · · Score: 3, Insightful

    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
    1. Re:Elegant code by hughk · · Score: 2, Interesting

      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
    2. Re:Elegant code by NaturePhotog · · Score: 1
      GEOS, developed at the soon to be defunct Geoworks is some beautifully designed 80x86 assembler. Its future is uncertain post-Geoworks because of Geoworks' flexible UI patents, and parts are dated because it was designed to work on an IBM XT (yes, pre-emptive multi-tasking and a single Postscript-like imaging model on a 4.77MHz XT), but the OS contains some very elegant code. The version 1.X kernel (task management, memory, file system, basic graphics, etc.) fit in a single 64K segment.

      Of course, it also contains some scary code like the self-modifying code in the video drivers, and the specific UI code wasn't the prettiest, either...

    3. Re:Elegant code by salimma · · Score: 1

      For interesting machines, at least.. together with forgotten code there are forgotten platforms out there :) (and some are still being sold, even - just try getting a Quicktime player on your Linux/alpha box... )

      You remind me of the Hercules emulator though - emulates the IBM System/370 through to zSeries mainframes. Apparently runs OS/370 pretty decently on recent hardware (preferably dual-processor, at least 1GHz), and during the beta testing for Redhat 7.3 a RH engineer actually invited people to try installing Redhat/S390 on it!

      That, apparently, was slow :p You can read Moshe Bar's account of it at Byte.com

      --
      Michel
      Fedora Project Contribut
    4. Re:Elegant code by salimma · · Score: 1

      Whoa. Wish I had the chance to try it; I thought DOSSHELL in MS-DOS 4 was pretty neat :p

      A bit hard to have decent UI on an XT anyway considering most of them shipped with 4-colour monitors?

      --
      Michel
      Fedora Project Contribut
    5. Re:Elegant code by NaturePhotog · · Score: 1
      Four color? Many were two color...Hercules and CGA (in glorious 640x200mode). Most all the UI widgets had two or three sets of code, one for drawing in B&W, one for drawing in color (a mighty 16 VGA colors), and one for drawing on squished displays like CGA.

      You can still try it out, there's a demo/light version at Breadbox.

    6. Re:Elegant code by salimma · · Score: 1

      Neat, thanks! Going to have a look once I get this little bit of overdue coding out of the way :p

      Quite surprised to see a company still selling GEOS - last time I heard about it was a few years ago.. aimed at the personal organizer market AFAIR.

      Would be interesting to see if OS/2 variants will still be around in... say, 15 years' time.

      Thanks,

      --
      Michel
      Fedora Project Contribut
  40. You call that elegant? THIS is elegant. by Dthoma · · Score: 1

    /* This will actually compile, and it uses neat li'l tabs! */

    #include <stdio.h>

    int main()
    {
    printf("Hello, world!\n");
    return 0;
    }

    --

    Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".

    1. Re:You call that elegant? THIS is elegant. by ethereal · · Score: 1

      Tabs are evil. That is all.

      --

      Your right to not believe: Americans United for Separation of Church and

    2. Re:You call that elegant? THIS is elegant. by Anonymous Coward · · Score: 0

      Here's another that will compile.

      int main(){return 0;}

      One simple little line. Elegant.

    3. Re:You call that elegant? THIS is elegant. by Anonymous Coward · · Score: 0

      haha nice troll

      Come back when you've written more than 20k LOC.

    4. Re:You call that elegant? THIS is elegant. by ethereal · · Score: 1

      I have. Try maintaining many times that mych code where half the people used tabs, the other half didn't, and all the tab users didn't actually agree on how many spaces mad up a tab anyway.

      Sure we could re-indent everything, but that's going to make all of the diffs versus previous versions unreadable, which isn't good either.

      Tabs are only if your text editor isn't smart enough to auto-fill a tab character with spaces.

      --

      Your right to not believe: Americans United for Separation of Church and

    5. Re:You call that elegant? THIS is elegant. by Lars+T. · · Score: 1

      That's your mistake right there: a tab isn't made up of spaces.

      --

      Lars T.

      To the guy who modded me down from perfect to terrible Karma - Apple haters still suck

    6. Re:You call that elegant? THIS is elegant. by ethereal · · Score: 1

      Wow, I misspelled a lot in that past post :)

      Of course a tab isn't made of spaces; that's the whole problem. Three spaces displays as three spaces on any developer's machine and editor. One tab displays differently in every situation. Some people, not noticing that the previous author used tabs, space out their new code to the tab spacing that they see, making it incredibly irregular for the next person to edit.

      If everyone uses tabs, uses the exact same indent style, and uses the same editor settings, then tabs are not too bad. In the real world, tabs are instruments of the devil, and source code should be indented with 2, three, or X spaces. A decent source editor will even replace tabs with the right amount of spaces, thus effectively solving your conundrum.

      --

      Your right to not believe: Americans United for Separation of Church and

    7. Re:You call that elegant? THIS is elegant. by Lars+T. · · Score: 1

      But using spaces doesn't solve the problem. Only "intelligent" editors do. All human made indentation by two or more individuals with different styles will fuck up the code, even if they only use spaces.

      --

      Lars T.

      To the guy who modded me down from perfect to terrible Karma - Apple haters still suck

    8. Re:You call that elegant? THIS is elegant. by ethereal · · Score: 1

      Sure, but at least that human editor can see that they're going against the existing indentation structure. With tabs it's easy to think that you're going along with the structure when really you're totally against it, just 'cause your tab stops are set differently.

      --

      Your right to not believe: Americans United for Separation of Church and

  41. the naturally speaking code by MadFarmAnimalz · · Score: 3, Funny

    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.
  42. Oh, come on... by ashitaka · · Score: 1

    You had to be artistic...

    10 FOR I = 1 TO 1000000
    20 PRINT TAB[I]; "** GREG WAS HERE **"
    30 NEXT I
    40 GO TO 10

    --
    If you don't want to repeat the past, stop living in it.
  43. GPL license is immortal by axxackall · · Score: 1

    You cannot change the license of GPLized code. Therefore, GPL license is immportal.

    --

    Less is more !
  44. obligatory slashdot business plan by greechneb · · Score: 1, Offtopic

    1. Start Software Company
    2. Spend enormous amount on R&D
    3. Sell few copies
    4. Downsize company to just you
    5. Wait until other companies use your codebase
    6. Sue claiming stealing of IP
    7. Profit!!!!

  45. My personal favorite... by DanCo · · Score: 1

    Well, I'd post the source, but the lameness filter refuses to take it - not sure if that says anything... If you have vim installed, check this out: /usr/share/vim/vim61/macros/maze/maze.c

    That's where it is on all the installations I've seen - YMMV...

    For those without, I'll try to describe it best I can - it's C source code that generates a maze, but hears the kicker - the source itself spells out the word "MAZE" in the whitespace! Really, if you get the chance check it out!

    --
    It's not my fault - greatness was thrust upon me.
  46. memes by Anonymous Coward · · Score: 1, Interesting

    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.

  47. Maybe it is getting interesting again... by hughk · · Score: 1
    I gave up on WIred after they went through a spate of cutting edge graphical design which carefully made the text almost impossible to read - and that was the paper edition. On attempting to read the electronic edition, yes, the content was more visible but generally it wasn't that good.

    Maybe it is time to start reading WIred again, so it is good for people to let us know that it is worth looking at.

    --
    See my journal, I write things there
    1. Re:Maybe it is getting interesting again... by thenightfly42 · · Score: 1

      I've been subscribing to Wired, and I think there are 2 or 3 articles in the current issue that *haven't* been posted to Slashdot. Makes me almost wonder why I need to check this page.

    2. Re:Maybe it is getting interesting again... by ethereal · · Score: 1

      I'll agree with that - it used to be very hard to read online, with the stories split into many small ad-loading pages. The newer look is more like how Wired used to look - spare but high-tech. I don't know if maybe three stories in a week is too much, but I've enjoyed all of them so far.

      --

      Your right to not believe: Americans United for Separation of Church and

  48. Immortality? (ObLovecraft) by Dr.+Photo · · Score: 5, Funny
    "That is not dead which can eternal lie, Yet with strange aeons, even Death may die."

    Ia! Ia! COBOL Ftaghn!

  49. From the article-- by Anonymous Coward · · Score: 0

    "But reusing pieces of code is like picking off sentences from other people's stories and trying to make a magazine article. It might make your point, but not very well."

    Ha! Like that would ever happen.

  50. Everybody Sing Along With Me by Anonymouse+Howard · · Score: 5, Funny

    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.

  51. Re:Here's some REALLY immortal code for /. by Anonymous Coward · · Score: 0

    int main()
    {
    Z: printf("MS is bad...\n");
    goto Z;
    }

    Immortal code would be any of the lame out of date UNIX/POSIX api's which never ever ever get fundamentally rethought into a MODERN api (BeOS or for those geezers out there, mach)

  52. MODS ON CRACK part 222548782 by Anonymous Coward · · Score: 0

    So none of the mods here still see NIMDA/Code red hits.

    Hint: Parent is FUNNY (well mildly amusing).

    Sheeeeesh.

    1. Re:MODS ON CRACK part 222548782 by Anonymous Coward · · Score: 0

      Well I did my part to mod it up as funny, but there are just more clueless mods who don't get it than those who do.

  53. MOD PARENT UP by Anonymous Coward · · Score: 0


    C'mon, it's insightful.

  54. what about artistic code? by i.r.id10t · · Score: 2, Interesting

    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
    1. Re:what about artistic code? by AssFace · · Score: 1

      that is for sale as a poster on thinkgeek.com and I have it up at my desk right now here at work.
      hot damn.

      --

      There are some odd things afoot now, in the Villa Straylight.
  55. Nash Equilibrium, optimisation, annealing, systems by totierne · · Score: 1

    A whole pile of systems, local vs global optimisation, strange attractors, economics and equilibrium things I have not yet completely forgotten, what is left is like the cheshire cat grin from, damn I cannot nail the reference, I am sure it can be googled...

    Hey how googleable is a search for functional code with no searchable function names...

    Now I am disassociating... but it is slashdot.

  56. best quote of the article by kisrael · · Score: 1

    "Software works best in its own environment so we always take the server." -- Marty Pichinson

    A very pragmatic attitude reflecting an unfortunate truth. It can be very difficult to duplicate dev and production environments even when you have people to talk to who set it up in the first place...add in the mystery and history of Company X and you might really be in a bind.

    --
    SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
  57. Numerical Recipes in C (NRC) library by obnoximoron · · Score: 5, Informative

    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.

  58. is there anything that a markov matrix can't do? by AssFace · · Score: 5, Interesting

    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.
  59. Ack! by M.C.+Hampster · · Score: 5, Funny
    ... in COBOL nonetheless!

    My eyes! MY EYES!!

    --
    Forget the whales - save the babies.
    1. Re:Ack! by Anonymous Coward · · Score: 0

      ...The goggles, they do nothing!

    2. Re:Ack! by Foresto · · Score: 1

      LOL. That's what I was saying to myself (aloud) as I clicked the link to see your reply, and waited for the page to load.

    3. Re:Ack! by Anonymous Coward · · Score: 0

      Ze goggles they do nothing!

  60. Speaking about "deep code/knowledge" by jeorgen · · Score: 2, Interesting
    ...I bought Lernout and Hauspie (LHSP, the company featured in the article) shares in their heyday, thinking the tech was good. But all the technology isn't worth anything if they screw up other parts of their business.

    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.

    /jeorgen

    1. Re:Speaking about "deep code/knowledge" by Anonymous Coward · · Score: 0

      I'm in the same bag, except my portfolio was virtual (I have a long held believe that the stock market is a zero sum game for anyone with less than a couple million to invest); My sure bets were:

      Richochet
      Lucent
      Breezecom
      (and a few others who also tanked but who's names I've forgotten)

      Always track the human element... after all, that's where the greed is.

  61. Scansoft by hqm · · Score: 0, Flamebait

    Scansoft's CEO is Paul Ricci, a slime-breathing pond-scum who used to be an executive at Xerox. It doesn't surprise me that they are giving the
    original creators of the software the shaft. Ricci managed to fail his way upwards out of Xerox, and is probably busy driving Scansoft slowly out of business now.

  62. Here's some immortal code... by jayrcee · · Score: 1

    void main()
    {
    printf("Hello World");
    }

    Because they're stupid, that's why everyone does everything.

    --
    "Because I have balls like atom bombs, two of them, 100 megatons each. Nobody fucks with me."
    1. Re:Here's some immortal code... by Dionysus · · Score: 1

      No longer valid. It should be

      int main()
      {
      if (printf("Hello World") < 0))
      return 1;
      else
      return 0;
      }

      --
      Je ne parle pas francais.
    2. Re:Here's some immortal code... by rsearle · · Score: 2, Funny

      Unfortunatley, void main() has never been valid ANSI/ISO C. The standard states that main() shall return an int. Also note that the latest standard (C99) requires the type specifier to be present; you can no longer rely on main() defaulting to int.

      Output is not guaranteed to be displayed until either a newline is encountered, or a call is made to fflush(). So it is perfectly possible that the user will never see anything.

      For maximum portability, it is recommended that you return EXIT_SUCCESS or EXIT_FAILURE from main(). So, here is the correct version:

      #include <stdio.h>
      #include <stdlib.h>

      int main(void)
      {
      if (printf("Hello, World!\n") < 0))
      return EXIT_FAILURE;
      else
      return EXIT_SUCCESS;
      }

  63. DOS? or what? Clarification requested. by Anonymous Coward · · Score: 3, Funny

    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)?

  64. Voyager by tellezj · · Score: 4, Interesting

    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.

  65. Re:is there anything that a markov matrix can't do by kisrael · · Score: 1

    I recently rolled my own Markov chain generator in Perl...it was easier than I thought. I'd always wanted to feed one with the love poems from my community-based love poetry site... people thought Mark V. Shaney was a real guy, though they noticed he cribbed some phrases from their own work.

    It's sometimes tough to find good raw input for Markov Chains, (tho not as tough as it was a decade ago...)-- my attempt to use the site's message board was hampered by the way every message starts with another user's username, the recepient of the message.

    --
    SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
  66. No! by Moonbird · · Score: 3, Informative

    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.
  67. It was a cool story... by gregfortune · · Score: 1

    I'm not sure it fit the title of the /. post very well, but the story was really cool. I hadn't heard an in-depth discussion about the business happenings helped bring Dragon to life and it was just a good read.

  68. Fear and Loathing by Lodragandraoidh · · Score: 2, Funny

    I think the breadth and depth of Eastereggs in a project is directly proportional to the inelegance of said project. Microsoft excels in this area exceedingly.

    --

    Lodragan Draoidh
    The more you explain it, the more I don't understand it. - Mark Twain
  69. I learned my lesson by Anonymous Coward · · Score: 3, Interesting

    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.

    1. Re:I learned my lesson by sparkz · · Score: 1
      My attitude is:

      If I wrote it, I should take a copy of it.
      If I'm very proud of it, I should document it well, and take copies of the code and the documentation. That is my work. The code itself belongs to my employer, but while I work for them, I have no problem with having a local copy on my PC (hey, I'm giving the company a free backup).

      Should the terrible happen (I leave, or the company dies), I've got a record of what I've done. If the company dies, I'd feel bad just throwing the existing code into a new company, but re-using the ideas is not a bad thing.

      A trivial example:

      At one firm, I cut my Unix teeth. I wrote a bunch of shell scripts to make my life easier. I still have some of them (unfortunately, not all). They technically belong to that company, but if I hadn't felt the need to write them (for myself) the would not have existed, and would not have belonged to them (I'm talking about v. small scripts in ~/bin here, stuff like re-titling an Xterm window, though I've also got some copies of a script for rebuilding a [snip]UX kernel to various parameters (back in the day when [snip]UX kernels needed rebuilding, not just tuning).

      [snip]UX does not even exist any more (at least, it was never Y2K certified, and you can't buy it), but if someone has managed to keep it going, and needs a kernel rebuild, I can do it for them. All I am using the hard disk for, is as an archive for my brain. I can't remember all the details involved (why should I bother?) but the script does remember it all. I'm just making allowances for my disability (I can't remember scripts I wrote 10 years ago) here, and using my own PC to assist me to overcome that disability.

      If [snip]NX was still maintained and on sale, with a PS staff to support it, maybe I'd be taking money from those people, but it isn't.
      Nobody has asked me for the service, anyway. One person did ask me if I had a tape of a slightly older OS, which I'm sure I did have, once, but couldn't find the goods when asked.

      --
      Author, Shell Scripting : Expert Re
  70. Woody Guthrie on copyright. by EdlinUser · · Score: 5, Funny

    "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."

  71. tasteful by Anonymous Coward · · Score: 2, Funny
    the campus shaped like a gigantic inner ear.

    The heck with black leather couches - this HAS to be the new gold standard in flameout prediction.

  72. code as a source of business failure by porky_pig_jr · · Score: 1

    when I've worked at BBN Planet (currently Genuity, in Chapter 11 status, being acquired by Level3), I had to write some code to monitor the end to end Tier1 performance. An asshole who controlled the project (has PhD in math but had no idea that a source code should probably be indented, to say the least) did not want me to spend any time to properly documenting the code, make it modular, easy to maintain, etc. I hope the code I left to them was partially responsible for the current state of affairs at Genuity.

  73. Re:is there anything that a markov matrix can't do by AssFace · · Score: 1

    a great source for raw data is the Gutenberg (sp?) project (always makes me think of he Police Academy series).

    I used that when I originally got into using the MMs for breaking the Poe Challenge back in '99 (I wasn't the first one, there were at least 3 that did it before me).
    That was when I discovered that all of Poe's works and most of his known letters and poems are all online in digital form... makes it easy to get all of his stuff.

    When I made the radiohead song generator (or I should say "THE" generator - I have no clue if it is the only one - but the one I wrote at least), it tends to say the same things a lot since there is a pretty small amount of data with which to build the MM.

    That is why newsgroups and discussion boards are so much fun.
    I would train it on the religious newsgroups and math newsgroups and then have it post randomly to either of them.
    Also had a few bots that would post on a fitness discussion board.

    --

    There are some odd things afoot now, in the Villa Straylight.
  74. Terrible article on an interesting subject by John+Harrison · · Score: 1

    I reconsideried my subscription to Wired after reading this article. The story is presented haphazardly and you are never quite sure what it is about. The code might be elegant and wonderful but this article is not.

  75. Good grief, what a ridiculous article! by njdj · · Score: 1

    Slashdot is supposed to be selective! As in, pick out the "stuff that matters" from all the hype and codswallop.

    The Wired article was almost bad enough to be funny. My nomination for most outrageous hyperbole of the month - no wait - let's get into the spirit of the article - of the eon:

    "... It's extremely meaningful. It took billions of years to build it. Deep programming is the result of that kind of effort."

  76. I told my son exactly this. by ashitaka · · Score: 1

    I wrote some great code in years past. PL/1, FORTRAN, Assembler (I still have the print out of my first program, framed and hanging on the wall.)

    However, it wouldn't be much use even if I still had the code (which I don't).

    I just don't happen to have an IBM 2501 card reader sitting around the house.

    --
    If you don't want to repeat the past, stop living in it.
    1. Re:I told my son exactly this. by salimma · · Score: 1

      My first program was BASIC code at school.. on one of those old computers - never figured out the make - that boot off tapes, had tiny monochrome green-on-black 8" screens, and we had to type those silly line numbers...

      You can hang the punched card on the wall in lieue of the printed code, I suppose?

      I'm afraid the only thing I know about PL/I was that it was used to write Multics.. dang, we are missing out. Wish there is a course on historical programming languages I can take.

      --
      Michel
      Fedora Project Contribut
  77. Why it must be... by zozzi · · Score: 1

    the Obfuscated N-queens problem of course!

    int v,i,j,k,l,s,a[99];main(){for(scanf("%d",&s);*a-s;v =a[j*=v]-a[i],k=i<
    s,j+=(v=j<s&&(!k&&!!printf(2+" \n\n%c"-(!l<<!j)," #Q"[l^v?(l^j)&1:2])&&++
    l||a[i]<s&&v&&v-i+j&&v+i- j))&&!(l%=s),v||(i==j?a[i+=k]=0:++a[i])>=s*k&&
    ++ a[--i]);printf("\n\n");}

    blah blah blah this avoids the lameness filter blah blah blah truppitipupitup han geoooep fillin what a waste of time..

    --
    ---
  78. Walla? WALLA? by Anonymous Coward · · Score: 0

    OK dipshit, and just what the fuck does your made-up word "walla" mean?

    Perhaps you meant to use an existing word "voila" but are too smug to notice you can't even speak properly?

  79. Murphy's Law of Immortal Code by russotto · · Score: 3, Funny

    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.

  80. COPYRIGHT INFRINGEMENT by Anonymous Coward · · Score: 1, Informative

    This piece was actually written by Michael Surran, the man who was featured on Slashdot last week. It is available here

  81. The J Incunabulum by Jayson · · Score: 1
    This is great code that was once lost, but has resurfaced. Taken from Roger Hui's An Implementation of J:
    One summer weekend in 1989, Arthur Whitney visited Ken Iverson at Kiln Farm and produced -- on one page and in one afternoon -- an interpreter fragment on the AT&T 3B1 computer. I studied this interpreter for about a week for its organization and programming style; and on Sunday, August 27, 1989, at about four o'clock in the afternoon, wrote the first line of code that became the implementation described in this document.
    More imformation is available at A Tribute to Roger Hui . Arthur's one-page interpreter fragment is as follows:

    typedef char C;typedef long I;
    typedef struct a{I t,r,d[3],p[2];}*A;
    #define P printf
    #define R return
    #define V1(f) A f(w)A w;
    #define V2(f) A f(a,w)A a,w;
    #define DO(n,x) {I i=0,_n=(n);for(;i<_n;++i){x;}}
    I *ma(n){R(I*)malloc(n*4);}mv(d,s,n)I *d,*s;{DO(n,d[i]=s[i]);}
    tr(r,d)I *d;{I z=1;DO(r,z=z*d[i]);R z;}
    A ga(t,r,d)I *d;{A z=(A)ma(5+tr(r,d));z->t=t,z->r=r,mv(z->d,d,r);R z;}
    V1(iota){I n=*w->p;A z=ga(0,1,&n);DO(n,z->p[i]=i);R z;}
    V2(plus){I r=w->r,*d=w->d,n=tr(r,d);A z=ga(0,r,d);
    DO(n,z->p[i]=a->p[i]+w->p[i]);R z;}
    V2(from){I r=w->r-1,*d=w->d+1,n=tr(r,d);
    A z=ga(w->t,r,d);mv(z->p,w->p+(n**a->p),n); R z;}
    V1(box){A z=ga(1,0,0);*z->p=(I)w;R z;}
    V2(cat){I an=tr(a->r,a->d),wn=tr(w->r,w->d),n=an+wn ;
    A z=ga(w->t,1,&n);mv(z->p,a->p,an);mv(z->p+an,w->p,w n);R z;}
    V2(find){}
    V2(rsh){I r=a->r?*a->d:1,n=tr(r,a->p),wn=tr(w->r,w->d) ;
    A z=ga(w->t,r,a->p);mv(z->p,w->p,wn=n>wn?wn:n) ;
    if(n-=wn)mv(z->p+wn,z->p,n);R z;}
    V1(sha){A z=ga(0,1,&w->r);mv(z->p,w->d,w->r) ;R z;}
    V1(id){R w;}V1(size){A z=ga(0,0,0);*z->p=w->r?*w->d:1;R z;}
    pi(i){P("%d ",i);}nl(){P("\n");}
    pr(w)A w;{I r=w->r,*d=w->d,n=tr(r,d);DO(r,pi(d[i]));nl() ;
    if(w->t)DO(n,P("< ");pr(w->p[i]))else DO(n,pi(w->p[i]));nl();}

    C vt[]="+{~<#,";
    A(*vd[])()={0,plus,from,find,0,rsh ,cat},
    (*vm[])()={0,id,size,iota,box,sha,0};
    I st[26]; qp(a){R a>='a'&&a<='z';}qv(a){R a<'a';}
    A ex(e)I *e;{I a=*e;
    if(qp(a)){if(e[1]=='=')R st[a-'a']=ex(e+2);a= st[ a-'a'];}
    R qv(a)?(*vm[a])(ex(e+1)):e[1]?(*vd[e[1]])(a,ex(e+2) ):(A)a;}
    noun(c){A z;if(c<'0'||c>'9')R 0;z=ga(0,0,0);*z->p=c-'0';R z;}
    verb(c){I i=0;for(;vt[i];)if(vt[i++]==c)R i;R 0;}
    I *wd(s)C *s;{I a,n=strlen(s),*e=ma(n+1);C c;
    DO(n,e[i]=(a=noun(c=s[i]))?a:(a=verb(c))?a:c);e[n] =0;R e;}

    main(){C s[99];while(gets(s))pr(ex(wd(s)));}
    1. Re:The J Incunabulum by Anonymous Coward · · Score: 0


      How is this great? Sure, it's nice that it was written so quickly. But it's an unreadable mess, horribly unmaintainable, and thus grotesquely inelegant.

  82. Too many extraneous details by westfirst · · Score: 1

    The article was okay, but it was filled with all of those crazy details that writers are always including to make you feel as if you're in the room. Like who gives a flying f&*&# about whether you take a left turn or a right turn to get to the headquarters? But that's the beginning of the story!!!

    I hate when writers lard up with stuff like that. They should stick with the meat.

  83. Love your sig. by Black+Parrot · · Score: 1


    > Mod me down, and I will become more powerful than you can possibly imagine!

    Heh heh.

    --
    Sheesh, evil *and* a jerk. -- Jade
    1. Re:Love your sig. by mike3411 · · Score: 1

      lol, thanks, i copied it off someone else so i'll be sure to pass along the kudos if i ever remember who :)

      --
      Mod me down, and I will become more powerful than you can possibly imagine!
  84. Re:The Book, and what it might contain by cpeikert · · Score: 1

    Martin Aigner and Gunter Ziegler have taken a crack at what a few chapters of The Book might look like. The result is "Proofs from The Book," which is both an excellent tribute to Paul Erdos and a beautiful collection of simple and elegant proofs from several branches of mathematics. It's a great book, and accessible even to those with just a high school math background.

    Here's one place to get it: http://www.amazon.com/exec/obidos/tg/detail/-/3540 678654/

  85. Do not mod funny. This is a troll by Anonymous Coward · · Score: 0

    And this is the fourth time I've had to read it. Stop modding it up and wasting space!!! A cut and paste hack I tells ya, not worth the mod points.

  86. The book is freely available, but not the code. by obnoximoron · · Score: 2, Informative

    Moonbird, thats true.
    http://www.nr.com/otherstufftop.html links to some of their public domain code such as wavelet routines, but the rest of the code is licensed. I ought to correct my post as 'freely available code documentation'.
    I had used the NRC routines about a decade ago (our univ department had licensed copies of it) and yes, they were not all gems of programming, but I could use them a basic recipes, starting points for brewing own code.

  87. Chill by Xenu · · Score: 1

    The code dates back to the PDP-11 era. You know, 16-bit CPUs, magnetic core memory, UNIX V7, etc. So no, it doesn't take advantage of the 256-bit quantum stabilized hyper-transport bus in your PC.

  88. stdio.h? by LogicFlow · · Score: 1

    int main() {
    puts("No header needed.");
    }

    puts() and gets() is unloved, but eh.

  89. Re:Duff's Device: ala 1982 on 6809's by ssclift · · Score: 1

    A similar cute trick on a 6809 was to set one of its two stack registers to the source of the copy, one to the destination. Then for the amount to be copied pop all registers from the source, and push to the destination (excepting one register for keeping track). The push/pop was encoded in one instruction, and all the remaining registers would be loaded or stored in one cycle per register. You therefore got about 90% bus usage on the copy.

    This was used a lot on Radio Shack Color [sic] Computer games to move or scroll graphic frames in a hurry.

  90. Its just poorly translated. by Ayanami+Rei · · Score: 1

    Its the kind of translation they probably spent a hours doing with the NRF sources and an undergraduate "learning C/C++" text.

    I always rewrote the code using their code as a model. I mean, the technique of QR decomposition, power-of-2 length FFT, these are not copyrightable. And there's only a few ways it can appear in C, with some variation in variable names. I especially did not appreciate their fortran-compatible array indexing. Quite cumbersome.

    In any case, that's some code that needs to DIE. If they were going to make all the code from each edition to look the same, the should have just done pseudo-code like Cormen used in "Introduction to Algorithms"

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  91. Re: oh please... by rimmon · · Score: 1

    ...that can't be true: I'm at work, forgot my password (which is safely at home). So I post as AC and I get a +5,insightful. What a bummer. I sure will remember that password from now...

    Anyway, back on topic: Yeah, you're right, that's a case I didn't think of, but it sure as hell has happend to me.
    But I think they're talking about "good" code. Nothing against your CVS Second Edition but code like that is another (sad) story.
    I don't think that your experience is out of the ordinary. Been there done that. Not with CVS but just as bad as that.
    But you can be sure I have copies of everything that is in any way reusable or just interesting (well, in some cases it's just funny :-) read: my best endless loop and stuff like that).


    ps: please mod me up, I just got +5 on an ac post. shit.shit.shit. I deserve that karma. It's mine. Please. Pleaaaase.

    Wow. Am I pathetic or what?!

  92. It wouldn't be a simple markov matrix. by Ayanami+Rei · · Score: 1

    There would be sets of matricies that represent that probabilities of state changes, each tied to some internal state (word boundaries?). I imagine these numerous matricies are also very sparse, or that the matrix is updated through some sort of word->word transformation.

    I doubt that the a static markov predictor would suffice for guessing phonemes, because it would provide you with too many equiprobable phonemes in your output vector; I (believe) phenomes are close to equally distributed over all speech.

    FFTs are used of course to split the voice into energy bands, which are then used as to distinguish the phonemes with varying certainty. It would seem you can't do jack in signal processing without the FFT (unless you can waste CPU time doing a whole buttload of correlation and filtering)

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  93. Another person who doesn't understand evolution. by aussersterne · · Score: 3, Informative

    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
  94. Unbelievably depressing! by giel · · Score: 2, Informative

    Yes. I find it very depressing. It's because of human nature. I'm not talking about you, me, or anyone in particular but individuals in general. It shows that we are a disgusting bunch of raping, stealing, exploiting, killing and reaping vultures. We do nearly anything if we might benefit from it. It doesn't really matter if it comes down to intellectual property, animals, geologic resources or just the power to rule. We consume and thereby destroy.

    Immortality might be achieved by sharing. Explain why widely published and available algorithms or OSS products and unpatented/copyrighted work outlasts all kind of proprietary and strongly protected software. If an individual gets lost, its properties get lost, just by getting forgotten or falling into the wrong hands, anyway it's lost for the public. In the end the public should decide what is usefull. That's good because only some (brilliant) individuals introduce new ideas and the (average) public should adopt or abandon. That's the way traditions and culture work.

    I'm not against copyright or patent. Copyright was invented only to share visions respecting the one who came up with them. Patents were invented only to prevent people with big resources to produce someones invention at large scale and so run away with the possible profit - correct me if I'm wrong; I always seem to confuse copyright, trademark and patent. Both are very good socialistic ideas, but in a liberal world they don't work. I could simply hire someone to 'steal' ideas. Put a copyright or patent on them before their creator does. And that's what happens at large scale, most contracts disown programmers/developers from their intellectual property involved during their employment.

    Nowadays copying and sharing of ideas has become very cheap. No wonder owners of valuable ideas are scared to share them. But... sharing them is the only way to let them become immortal. If - for example - Microsoft looses its strong ruler it will crumble. Nobody (except those who were involved) will know anything about the structure of the OS. There will be nobody able to adapt the products to new techniques and ideas, because they will be prevented by copyrights and patents.

    We have to deal with a new phenomenon, digital media. The current opinion on 'rights' will have to change in order to get software and information industrie really productive and continues.

    --
    giel.y contains 2 shift/reduce conflicts
  95. Re:is there anything that a markov matrix can't do by posternutbaguk · · Score: 1

    This sounds like my sort of stuff since I mainly program evolutionary code and other esoterica: can anyone reccomend a good web-site?

    Yeh I searched google but it sure lists a load of dry math info, give me some more readable info!

    Can't wait to code the 'automatic pro-M$ flame generator', sure make life a lot a lot easier for some /. posters!

  96. Outstanding! by Nick+Driver · · Score: 1

    This is the best parody lyrics I've seen here since Trollmastah's musings.

    I hereby nominate this tune to become the Official Slashdot Open Source Song. If Woody Guthrie were alive today, I bet he'd get a kick out of it.

  97. Re: the Goggles!!! They do nothing! Nothing! by Anonymous Coward · · Score: 0

    ...the Goggles!!! They do nothing! Nothing!

    I had to type this... had TO!

  98. Some code is mandated by law. by crovira · · Score: 1

    Several algorithms for calculating payroll and other revenue source tax deductions or for calculating pension contributions are mandated by law.

    The COBOL code was written and approved, probably before many of you were born, and you're NOT going to change it. Fuggedaboudit.

    --
    MSBPodcast.com The opinions expressed here are my own. If you don't like 'em... Think up your own stuff.
  99. Re:is there anything that a markov matrix can't do by David+Gould · · Score: 1


    ...that became my favorite tool to abuse (my hammer making everything look like a nail?).

    Gould's First Law: A sufficiently powerful hammer can turn any problem into a nail.

    --
    David Gould
    main(i){putchar(340056100>>(i-1)*5&31|!!(i<6)<< 6)&&main(++i);}
  100. The difference... by sparkz · · Score: 1
    I stand by your professional conduct.
    If the "very large company" was a dot-bomb, though, would you have the same qualms?
    I've been developing some software (only a few thousand lines, but contains a *ton* of work) for the past few years. If my employer went bust, I'd have no problem with showing that code to somebody else in this (interview) scenario. I wouldn't rush off and decide to GPL it just because it happens that I wrote it and I have a copy, but I'd certainly put it, its feature list and sample output in my portfolio if an interviewer asked what I'd done before.

    What am I supposed to do? Say "I've done lots of cool stuff, but I can't tell you about it. Do I get the job?"

    If I'd worked on, say, MS Works, I could say so, and depend upon the fact that people remember it. If I've worked for a company who never made it, I couldn't make those assumptions - I'd have to do the whole "the code is good; the business model was bad" thing. The only way to prove that (without refering to a product they know) is to show what I've done.

    Of course, if I'd worked for IBM on some proprietary stuff and wanted to move to HP, there would be no excuse for showing HP any IBM code (whether released or not).

    --
    Author, Shell Scripting : Expert Re
    1. Re:The difference... by Salamander · · Score: 1
      If the "very large company" was a dot-bomb, though, would you have the same qualms?

      That's a really good question. My gut reaction is to say that I would still refuse to look at it, but perhaps not take quite a hard line wrt terminating the interview process. Somebody else probably still owns that code but it is possible that the applicant believes or knows the code has been well and truly abandoned with no realistic possibility of its putative owner being affected by the disclosure of secrets they never cared about, and the code may be the only thing they have after generally getting screwed. Does that matter? Only a very tiny bit; not enough to justify the disclosure itself, but perhaps enough to justify giving the person a second chance. There's a difference between someone whose ethical judgment is compromised by anger or desperation and someone who calculatingly does something they know is blatantly white-and-black wrong.

      Or perhaps that's a totally bogus distinction. As I said, I would still refuse to examine the sample and I would make it clear that presenting it was a serious error. It just might not be enough, all by itself, to kill the interview.

      --
      Slashdot - News for Herds. Stuff that Splatters.
  101. ...not what the article was about at all by Anonymous Coward · · Score: 0

    Actually, I thought the article was about how the suits screwed the techies (yet again).

    The woman reminded me very much of the scene in Minority Report Cruse jumps the fence of the techie matriarch... bitter and not all completely there, if you know what I mean.

  102. Music by sparkz · · Score: 1
    There are only 12 notes in the classical scale; play Tchaikovsky*'s Piano Concerto #1 inverted to get "Oh When The Saints Go Marching In."

    Is it re-use? Is it theft? How much can you do in C? Honestly? Without dragging in libc and a bunch of other libraries, not a lot.

    Ideas matter; coding is just typing. * it's 2am, I can't spell.

    --
    Author, Shell Scripting : Expert Re
  103. Who Programmed God then? by seefried · · Score: 1

    Who programmed God then? Does this bother any of you believers out there? Is this a stupid question to you guys? This question, simple as it is, never gets answered to my satisfaction. Some say it doesn't matter

    I think the nature of creation is one of the most interesting questions we have to answer. Is it an infinite chain of creation, (perhaps a circular one!), or is it just as BORING as saying one infinite being created us and we'll just leave it at that.

    semantix

  104. OTOH by sparkz · · Score: 1
    It isn't uncommon for F/OSS to take the attitude "You can read the source, so why make a clean, documented API?" - at least with closed-source stuff (and well-written F/OSS) you get a clean, stable, and well-documented API.

    This must be the 3rd Pro-Closed post I've made in 2 days - waargh! - but let's face it, Closed Source programmers *have* to do it, F/OSS programmers *can* do it, but it may be a case of "when I get around to it." Try hacking GnuCash if you don't believe me (failing that, try *installing* GnuCash on LFS - the dependancies just to install it are bad enough, let alone the haiku you've got to crack to get to actually edit the code.

    I can't name names, but one proprietary UNIX source is beautiful - in terms of code quality, down to annotation and indentation, and that is only for internal / priveleged partner use only.
    Personally, I'm on more of a shell-script level, myself, but one lesson I have learned, is that if you write it well, you can fob it off onto someone else when you're sick of it. Write it badly, and you're stuck with it for the rest of your life!

    --
    Author, Shell Scripting : Expert Re
    1. Re:OTOH by spitzak · · Score: 1
      at least with closed-source stuff (and well-written F/OSS) you get a clean, stable, and well-documented API.

      Yes, for the same reasons. The API is published so the writer tries to make it good. From personal experience I know that *secret* API's are usaully really terrible. I cleaned up a large chunk of my own secret work a huge amount because we decided it would be published as a plugin api, believe me the fact that somebody you don't know will see the code is a huge incentive to fix it.

      It may be true that OSS code somehow dilutes the desire to make the code look nice by spreading it between both the source and header files, while partly-closed source puts all their "nice" effort into the headers.

      I believe an unrealated problem with OSS and public API's is extreme paranoia about breaking existing standards. This leads to very complex APIs due to an unwillingness to get rid of some interface. Usually the result is so complex it ends up incompatable anyways so this entire effort is a waste. It may be that closed-source has an advantage here in API design because they know exactly who is affected and can feel free to change things on this limited set.

    2. Re:OTOH by captaineo · · Score: 1

      I actually think OSS has the opposite problem - library developers are too willing to change the API. I am ok with cleaning up APIs, but only if you rename the library so old software continues to work. Some packages are smart enough to do this (and Debian enforces it even if the developers get it wrong), however LOTS of free software APIs break without warning. And the worst offenders are the core things like glibc and libstdc++! You can hardly upgrade one of those packages without upgrading practically everything else on your system. (the kernel does a really good job - you can pretty much drop in any kernel and everything will continue to work - the only incompatible change I can remember was modutils, I think)

      Yes, sometimes proprietary APIs get pretty clunky for backwards-compatibility reasons (consider all the Win32 structs where you have to put the size of the struct in a member, to differentiate between different versions). But I'm a lot happier with Windows because I know I can upgrade most DLLs without worrying about the system breaking.

    3. Re:OTOH by spitzak · · Score: 1

      I think the problem with glibc is still excessive backwards-compatability, if you assumme the older glibc was broken. It would be better if running a program with the wrong version produced missing symbols than the current broken behavior. Then again if you assumme the old glibc was not broken, then OSS certainly had a problem with "fixing" something that was not broken.

    4. Re:OTOH by captaineo · · Score: 1

      glibc 2.3 breaks static binaries. You read that right: some (not all) programs that were compiled statically with glibc 2.2 or earlier WILL NOT RUN on a system with glibc 2.3. Now THAT is breakage of the first class kind.

      IMHO the correct solution is to freeze all APIs that enter common use. Once an API (say, "glibc 2.x" or "libstdc++ 2") escapes from development into the world at large, it should NEVER be changed in a way that is backwards-incompatible.

      It is perfectly fine to start over again with a new API, just as long as it's named differently. If backwards-compatibility gets ugly, then you need to start a completely separate line of development (e.g. "glibc 3", "libstdc++ 3"). No monkeying around with sub-version numbers.

      On most Linux systems if you 'ls /lib/libc*' you will see only one libc.so, which may (or may not!) be compatible with whatever other software you have. It's Russian roulette whether anything works at all, especially after you've upgraded different parts of the system. (e.g. on many distros you have to upgrade glibc and locales together, otherwise "bad things" happen...). What I would prefer to see in /lib is something like this: /lib/libc1.so.42 /lib/libc2.so.19 /lib/libc3.so.3

      i.e. one distinct library for each API, which can be upgraded to fix bugs or add backwards-compatible features without ANY worry that existing software will break.

      The root problem with glibc is that it includes too much stuff at different stages of development - e.g. malloc(), printf(), and friends are pretty much set in stone for the rest of time. But the pthread and DNS functions still change quite often. IMHO glibc needs to be split into several libraries, e.g. one for core stuff that will never change, like malloc and stdio, and one or more libraries for the unstable stuff like pthreads.

      Don't even get me started on the very subtle and confusing interactions betwen pthreads, glibc, and gcc. The interfaces between these three systems have never been stabilized, so again it's Russian roulette when upgrading one of them - sometimes it works and sometimes BANG! all threaded software now crashes. Or all C++ software crashes. (both things have happened on my systems, I'm speaking from experience here...)

      Distributing Linux software that uses C++ or pthreads without statically linking everything is asking for trouble. When was the last time you couldn't run a Windows program because it was missing the right C++ runtime library??

      BTW, I give very high marks to the Debian maintainers for understanding all of this. Debian is the only Linux distro I consider safe enough that I can install or upgrade things without worry. Redhat is a complete farce, it's far worse than Windows in this regard.

  105. TEST before your POST by multipartmixed · · Score: 2, Informative

    On most machines of that era, you would overrun I long before the loop completed!

    Sheesh!

    Not to mention the fact that the program won't finish the first loop, as "** GREG WAS HERE **" is not a legal key word in BASIC!

    (Hint - look at the semi colon)

    --

    Do daemons dream of electric sleep()?
    1. Re:TEST before your POST by blancolioni · · Score: 1

      You're thinking of the colon, which separates statements in Basic. The semicolon tells the print statement not to leave a gap between two fields.

      Also, the variable 'I' would almost certainly be floating point, so you wouldn't overrun it.

      You may well have been having a bit of a troll, but you were marked as informative, so here I am, clearing up misconceptions about ancient programming languages. What a life I lead!

  106. You don't need no stinkin' headers! by multipartmixed · · Score: 1

    Well, sometimes you don't.

    This one line will run on many unices:

    void main() { printf("hello, world\n"); }

    Of course, the compiler will whine. Well, depending on what warnings you have enabled. ;)

    --

    Do daemons dream of electric sleep()?
  107. Wired. Alright. by Anonymous Coward · · Score: 0

    Seriously- we all read wired. That's the third post on one page siting articles from a weeks old magazine. Come on.

  108. Oh, please! by Jeff+Binder · · Score: 1

    Writing hello world in C as opposed to BASIC is `artistic'? Maybe if it were written in Malbolge it would be, but C? Next thing you know we'll be calling assembly an ideal language for user extension and writing kernels in Objective-COBOL!

  109. Re:is there anything that a markov matrix can't do by mandolin · · Score: 2, Funny
    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.

    As evidenced by your post to a web discussion board, your implementation is pretty decent; congrats :)

  110. bullshit by Anonymous Coward · · Score: 0

    have you seen how many projects are being refactored on sourceforge because of short sighted/hacky designs? I love opensource and most of my tools are opensource, I've even contributed to some projects, but overall it's not elegant and lacks solid documentation. There are thousands of open source projects out there and only a handful are used en mass because of shoddy workmanship. There are also some kick ass elegant solutions like jboss, but the ability to fix what you see wrong ,copy functionality you need, and direct contact with the engineer is what makes opensource great, not some sort of inherent goodness because it's build by volunteers. I'd be willing to bet M$ code is much better documented and easier to read for they have process out the ass, boiler plate headers, business requirements, and code reviews to improve and manage it. I like the oss model better for it makes us the programmers richer for it's harder to use and we can demand higher wages for our expertise in it. I also think the more eyes looking at it will increase readability argument will eventually become true, but is currently marketing hype (projects are being refactored so they will in time be better). Oss is also a new paradigm and is just in the last year getting popular(popular is the operative word), so we're in it's infancy and will just now begin to see some of it's weakness and solutions to those weaknesses as well as unforeseen strengths. But Elegance is not one of opensource software's current strengths.

  111. you haven't seen oss code have you? by Anonymous Coward · · Score: 0

    have you seen how many projects are being refactored on sourceforge because of short sighted/hacky designs? I love opensource and most of my tools are opensource, I've even contributed to some projects, but overall it's not elegant and lacks solid documentation. There are thousands of open source projects out there and only a handful are used en mass because of shoddy workmanship. There are also some kick ass elegant solutions like jboss, but the ability to fix what you see wrong and copy functionality you need, and contact the engineers directly is what makes opensource great, not some sort of inherent goodness because it's build by volunteers. I'd be willing to bet M$ code is much better documented and easier to read for they have process out the ass, boiler plate headers, business requirements, and code reviews to improve and manage it. I like the oss model better for it makes us the programmers richer for it's harder to use and we can demand higher wages for our expertise in it. I also think the more eyes looking at it will increase readability argument will eventually become true, but is currently marketing hype (projects are being refactored so they will in time be better). Oss is also a new paradigm and is just in the last year getting popular(popular is the operative word), so we're in it's infancy and will just now begin to see some of it's weakness and solutions to those weaknesses as well as unforeseen strengths. But Elegance is not one of opensource software's current strengths

  112. Can we concentrate in artificial, human generated? by jotaeleemeese · · Score: 1

    Lets not include naturaly ocurrent, random generated one.

    --
    IANAL but write like a drunk one.
  113. ayb by Idolatre · · Score: 1

    for (vector::iterator iterBase = you.base.begin(); iterBase != you.base.end(); ++iterBase) {
    you.base.remove(iterBase);
    this.base.push_back(iterBase);
    }

  114. Samples of work and confidentiality by Raedwald · · Score: 1
    a guy I was interviewing showed me (unasked) a spec he'd done, as a sample of his work. The copyright/confidentiality notice for a very large company was clearly printed right across the top.

    to which a poster replied

    What am I supposed to do? Say "I've done lots of cool stuff, but I can't tell you about it. Do I get the job?"

    I was worried about being able to show a potential employer what I can do, without breaking confidentiality. Also, I wanted to be able to show that I could do more than the immediate job requirements of my previous job. My solution was to put code I'd written in my spare time (GPL'ed) on my website.

    --
    Ne mæg werig mod wyrde wiðstondan, ne se hreo hyge helpe gefremman.
  115. Wrong by zatz · · Score: 1

    Actually the behavior is not the same unless the first operand is unsigned.

    -1 % 8 == -1
    -1 & 7 == 1


    So it can't freely perform that strength reduction.

    GCC on i386 will actually convert the % 8 into a multiply! Look at the generated asm if you don't believe me. (It can only do that when the divisor is constant.)

    --

    Java: the COBOL of the new millenium.
  116. Neither or either by mikefocke · · Score: 1

    OSS can be looked at, but is it? Are you sure that several competent reviewers have actually looked at the code and made comments? Are you sure the reviewers comments have been incorporated in the released version? Was one of the reviewers actually competent in the architecture of the product? In security? Is there a record of reviews?

    Suppose I told you that in my shop, every piece of code was reviewed by 4 people in writing? That each reviewer had to approve the code before it even went to the next reviewer? That one of the reviewers had to be a security guru? That there was a written vulnerability assesment and security implications section of the review. That functionality was tested by a non-developer tester. That integration was done by a separate group. That there was a written or electronic record of all of this. And that this was proprietary OS code and that people were still productive and happy working there.

    OSS isn't all perfect, proprietary isn't all bad. Oh they both can be either, neither or somewhere in between. Usually in between.

    1. Re:Neither or either by spitzak · · Score: 1

      Having worked in exactly the sort of situation you describe, I still feel that OSS software is better quality (and so is headers and sample source for closed systems that is written for public consumption). It appears that review by "friendly" forces, no matter how organized or well paid, does not result in a desire to produce quality code. This is from personal experience and may not apply everywhere.

  117. It doesn't have to be elegent by Hittman · · Score: 1

    Enable was an office suite that allowed multiple windows and cutting and pasting between applications on a DOS platform. Predating windows, it performed well on a 286. It was very popular with the military, IRS and other government branches, until Windows finally killed it. The company was essentially dead in '93, but it limped along, filling the last part of a few long term contracts, until it finally closed it's doors in '97. I worked in tech support and ran their BBS until '95.

    The code was hardly elegant. It was written in spaghetti assembler the programmers found almost impossible to maintain, and it got more cumbersome with each new version of the product. The modules were all pretty decent, but none were spectacular. (I still miss the dot report language for the database, though - you could get a lot done with very little code.) It's only saving grace was it provided a lot of power for wimpy computers. As computers got more and more powerful, that became unimportant.

    Two years after the company closed down I received a phone call from one of our customers, a developer who had created some very elegant applications in Enable. (This wasn't easy to do, as the development tools were very clunky.) He had bought the hard drive to the BBS and had questions about how it was organized. Turns out he's working for a missionary group that referbs old, old computers, 286s and up, and gives them to communities in developing countries. He's outfitting them with Enable - a copyright violation to be sure, but who cares at this point? The BBS was full of examples of how to do this or that - little database applications, telecom scripts, funky spreadsheets, as well as archived messages bases answering questions about the product. He wanted to make a list of everything available to his end users, and send them whatever they requested via e-mail.

    I thought it was rather cool knowing that stuff I did a decade ago, and forgot about, is now being used by someone, somewhere, on an old clunky computer. And Enable, decent software that is horribly, horribly coded, lives on, not because it's elegant, but because it works well on old computers that none of us want any more.

  118. Thanks! by GCP · · Score: 1

    And a virtual mod point to you.

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."