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

40 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 zootm · · Score: 2, Funny

      Wow! DeCSS, a browser and a rootkit in one line of code. Perl really is a wonderful tool.

      The principle is clearly that if you can do absolutely everything in 20 indecipherable characters, your code will never need to be maintained.

    4. Re:Or just write it in perl by kellar · · Score: 2, Funny

      what about putting a couple of $sys$'s in there somewhere

      --
      k e l l a r
    5. 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 */
    6. Re:Or just write it in perl by Haeleth · · Score: 2, Funny

      The principle is clearly that if you can do absolutely everything in 20 indecipherable characters, your code will never need to be maintained.

      Then the future of programming must be HQ9+!

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

    9. Re:Or just write it in perl by !Freeky2BGeeky · · Score: 2, Funny

      Yeah, I'd recognise those security holes anywhere!

      --

      Visualize Whirled Peas

  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. Had to stop by 00_NOP · · Score: 2, Funny

    I was laughing too much and getting strange looks in the office. Personally I use perl to guarantee employment, but there's a look to work on here.

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

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

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

    --
    crazy dynamite monkey
  12. Re:Until you get fired by Thud457 · · Score: 2, Funny

    Why on Earth would you erroneously infer that writing unmaintainable code violates company development practices?

    --

    the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff

  13. 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.
  14. 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
  15. 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

  16. Re:I can. by bataras · · Score: 5, Funny
  17. Re:Until you get fired by Rhoon · · Score: 2, Funny

    Is it bad that this article outlines our company development practices???

    --
    "If all the world's a stage, I want to operate the trap door." - Paul Beatty
  18. Wow by tgd · · Score: 4, Funny

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

    Bastard.

  19. 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.
  20. PL/I is great for unmaintanble code by Rick+Genter · · Score: 2, Funny
    From a language processor I worked on eons ago; I use it as an example of what's "great (:-/)" about PL/I:
    IF IF = THEN THEN THEN = ELSE ELSE ELSE = IF;
    Yes, it compiles (if IF, THEN and ELSE have the appropriate types).

    And how can you not love a language that has a data type for Pounds Sterling?
    --
    Don't underestimate the power of The Source
  21. Obfuscation by kcarlin · · Score: 2, Funny

    True story, ca. 1977. A manager takes over the development group for Administrative Services at a major university. Inheriting essentially a COBOL shop, there is one clever fellow maintaining an essential enterprise application written in something called autocoder (described to me as a technological precursor to assembly language that didn't really resemble a functionally oriented programming language or much else anyone but an historian or fellow dinosaur might be familiar). Having a safe niche in an obscure language, he coded all of the variable names as a sequence of zeroes and O's and kept a data dictionary in a notepad that he kept on his person.

    The new manager came in and Mr. Zero was summarily given a quick bum's rush. Mom never wasted much time on such things.

    --
    Free Adam Smith! (Or best offer.)
  22. 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.

  23. Chester Abramowitz COBOL Savant by gelfling · · Score: 2, Funny

    Once worked with a high functioning austistic named Chester (Cheddy) Abramowitz who typically coded COBOL as a monothlithic bloc from col 6-80 with no spaces, breaks, indents or lines. Moreover his dataset names were things like MASTER.BATE

    It kept him employed.

  24. Re:Until you get fired by Fx.Dr · · Score: 2, Funny

    Some bosses not only encourage it, but applaud it. Lifetime employment indeed :P

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

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

  28. Re:Lifetime aint always that long by Guru84 · · Score: 2, Funny

    Wow... the only reason they upgraded was because the guy died. That guy should feel pretty good.... wait, he died.

  29. 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
  30. Unmaintainable code in just In 3 easy lessons. by Man+from+Trantor · · Score: 2, Funny

    1.) Use global variables for everything. Make sure you give them funny names like 'beeblebrox' and 'Wookie' that give absolutely no hint of what thier purpose might be. This will give the poor sl.., er, maintainer a good laugh as they tweeze thier way through your code. And yes, please feel free to reassign thier values often for whatever purpose you need in any give place.

    2.) Avoid specialized classes and functions like the plague. Place everything in gigantic Sub or void methods, trying to pack as much of your programs functionality as you possibly can into each block.

    3.) Thoroughly document your code by scattering non-sequitor comments at random points.

    This is a proven tecnique. In fact it works so well that anyone with a brain that gets a look at it will recommend that your app be shitcanned immediately rather then waste another dime maintaining it.

    --
    <!-- /. bot -->
    while(!am) r2();