Slashdot Mirror


How To Write Unmaintainable Code

An anonymous reader writes "Make sure you're irreplaceable -' In the interests of creating employment opportunities in the Java programming field, I am passing on these tips from the masters on how to write code that is so difficult to maintain, that the people who come after you will take years to make even the simplest changes. Further, if you follow all these rules religiously, you will even guarantee yourself a lifetime of employment, since no one but you has a hope in hell of maintaining the code. Then again, if you followed all these rules religiously, even you wouldn't be able to maintain the code! You don't want to overdo this. Your code should not look hopelessly unmaintainable, just be that way. Otherwise it stands the risk of being rewritten or refactored. '"

27 of 437 comments (clear)

  1. FoxPro for DOS 2.6 by donnyspi · · Score: 4, Funny

    Our company's main system is written in FoxPro for DOS 2.6. The FP programmers here seem to have guaranteed lifetime employment :-)

  2. Or just write it in perl by espergreen · · Score: 5, Funny

    #!/usr/bin/perl
    &!@&/*!QW(*()@!@(I!@()!@)(!@*/\()!@&*(@!/*(&

    Ok, I admit it. I just banged on the keyboard :(

    1. Re:Or just write it in perl by Anonymous Coward · · Score: 4, Funny

      Dude ... you just wrote a web browser.

    2. Re:Or just write it in perl by Marsala · · Score: 5, Funny

      That may be, but you managed to create a pretty solid SMTP server anyway.

    3. Re:Or just write it in perl by hkb · · Score: 5, Funny

      Ok, I admit it. I just banged on the keyboard :(

      Yet it still does something in Perl. Witness the power!

      --
      /* Moderating all non-anonymous trolls up since 2004 */
    4. Re:Or just write it in perl by theonetruekeebler · · Score: 5, Funny
      I admit it. I just banged on the keyboard

      That's odd---I do the same thing when I'm coding Perl. Usually with my forehead, though...

      --
      This is not my sandwich.
    5. Re:Or just write it in perl by zootm · · Score: 4, Funny

      It's all fun and games until your "iPod sync" Perl script becomes self-aware and threatens life as we know it.

  3. Re:April Fool's Right???? by MindStalker · · Score: 3, Funny

    Yes of course this is a joke. Turn your humor sensors on NOW!

  4. Re:April Fool's Right???? by TangoCharlie · · Score: 4, Funny

    Sheesh! Irony, it's lost on Americans!!

    I think we're supposed to take this with a certain amount of salt.

    OOps, I see you're Canadian. Well, nobody's perfect :-)

    --
    return 0; }
  5. How to write unmaintanable code by ThatGeek · · Score: 5, Funny

    How to really write unmaintainable code:

    Apply equal parts of Perl and Guinness

    --
    What are you eating? isItVeg?.
  6. Don't execute that... by Mr.+Underbridge · · Score: 5, Funny

    ...it generates a root exploit.

    1. Re:Don't execute that... by roman_mir · · Score: 3, Funny

      Don't execute that... (Score:3, Informative)
      ...it generates a root exploit.

      - Don't read that, the Mod Points generate a brain dump!

  7. Re:missing icon? by Golias · · Score: 5, Funny

    Ummmm, where's the foot icon? It's good to know that the author considers this a joke, but I'm afraid that Hemos might not be in on it...

    If you've seen the Slashcode, you would know why this joke would be lost on Hemos and the rest of the staff here.

    Zing!

    --

    Information wants to be anthropomorphized.

  8. Re:Biased, much? by TangoCharlie · · Score: 3, Funny

    See, I told you! :-)

    --
    return 0; }
  9. Re:Dupe by Anonymous Coward · · Score: 5, Funny

    The joke's on you! Slashdot beat digg by 6 YEARS: How To Write Unmaintainable Code Posted by Hemos on Thu Nov 18, '99 10:32 PM
    Yeah... still a dupe.

  10. Instructions! by decipher_saint · · Score: 3, Funny

    I don't need no instructions to know how to rock.

    --
    crazy dynamite monkey
  11. 1997 ... dupe from 1999 by oneiros27 · · Score: 4, Funny
    It even states it at the bottom of the page:
    An early version of this article appeared in Java Developers' Journal (volume 2 issue 6). I also spoke on this topic in 1997 November at the Colorado Summit Conference. It has been gradually growing ever since.
    And, let's not forget, it's technically a dupe ... it was posted on /. in 1999 ... by um... the exact same editor.
    --
    Build it, and they will come^Hplain.
  12. Re:Jeez, just run an obfuscator by Soruk · · Score: 5, Funny

    What version control system is it you use that allows you to check in 4-stringed musical instruments slightly larger than a violin?

    --
    -- Soruk
  13. How about dc? by ion_ · · Score: 3, Funny

    [l:l;s<s=0l>x]s"[1+l<dd*l=d*-l;+ds<rl=2**l:+ds=d
    *rd*+4<-d15>>]s>[q]s-[d77/3*2-s;47l"x-P1+d78>`]9
    ks`0[d23/.5-3*s:0l`xr10P1+d24>$]ds$x

  14. Re:I can. by bataras · · Score: 5, Funny
  15. Wow by tgd · · Score: 4, Funny

    You must've been the plumber for the house I just bought.

    Bastard.

  16. Meta application of these rules in real life: by NecrosisLabs · · Score: 4, Funny
    A couple years ago, I showed these rules to another developer. We had a good chuckle, particularly about
    Misleading names
    Make sure that every method does a little bit more (or less) than its name suggests. As a simple example, a method named isValid(x) should as a side effect convert x to binary and store the result in a database.

    The next day we had a meeting to examine a legacy application that we were going to be re-writing. Another dev was discussing the DataLoad method. Which loaded a flat CSV file.

    And validated the data

    And stored the result in a database.

    It is very hard to look professional in a meeting when your face is beet red and your eyes are screwed up tight to keep from breaking out it gales of laughter.
  17. Re:Not So by trollable · · Score: 3, Funny

    If you could upgrade the code, it means the original coder wasn't good enough. Writing unmaintainable code is not given to every one. Unmaintainable code is code you can only delete, not upgrade.

  18. Old Joke by Ironsides · · Score: 4, Funny

    Programming is like sex: One mistake and you have to maintain it for the rest of your life.

    --
    Fly me to the moon Let me sing among those stars Let me see what spring is like On jupiter and mars
  19. Re:not how it works. by irablum · · Score: 5, Funny

    I was once brought back in even though my code was absolutely maintainable. I had left the company for other reasons ( Inner Mongolia ) but they brought me back because something didn't work. I spent 10 minutes figureing out that the problem was hardware, 5 minutes directing the tech on how to fix the hardware, and 2 hours and 45 minutes bullshitting with my former co-workers, all at $75 an hour.

    Ira

  20. A wise man once said... by Anonymous Coward · · Score: 3, Funny
    Give a million monkeys each a computer, and one of them will write a Java program.


    All of the rest will write a Perl program.

  21. Re:Lifetime aint always that long by hpavc · · Score: 3, Funny

    They would say "we never really planned on keeping that peice of software [dead guys name here] wrote, but we never decided on a package or got funding for a package to replace and we had so many things going on ..."

    --
    members are seeing something, your seeing an ad