×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

How To Write Unmaintainable Code

Hemos posted more than 8 years ago | from the job-security dept.

It's funny.  Laugh. 437

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

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

437 comments

April Fool's Right???? (-1, Troll)

Chaotic Spyder (896445) | more than 8 years ago | (#14082416)

Wow. I could not disagree with this more. Why can't you prove you are irreplaceable by becoming a great programmer/problem solver/team player rather than some fucknut that creates garbage that "just works".

Open Source Community Benefits...??anyone?

Re:April Fool's Right???? (3, Funny)

MindStalker (22827) | more than 8 years ago | (#14082454)

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

Re:April Fool's Right???? (0)

Anonymous Coward | more than 8 years ago | (#14082718)

"A sarcasm detector, that's a real useful invention."

Re:April Fool's Right???? (3, Interesting)

mymaxx (924704) | more than 8 years ago | (#14082455)

Wow, I couldn't disagree with you more. This is an excellent....joke! Lighten up!

Re:April Fool's Right???? (1)

Chr0nik (928538) | more than 8 years ago | (#14082666)

If this is a joke, then discussing it in a serious manner is kind of pointless right? So, not to be overly critical or anything, but, what's the point?

I mean, I had my little guffaw, and slapped my knee, but what are we discussing here?

Re:April Fool's Right???? (4, Funny)

TangoCharlie (113383) | more than 8 years ago | (#14082457)

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

Biased, much? (3, Insightful)

Luscious868 (679143) | more than 8 years ago | (#14082548)

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

Who said he or she was an American? I've seen plenty of posts on Slasdhot writen in English from people who were not American. Biased, much?

Re:Biased, much? (3, Funny)

TangoCharlie (113383) | more than 8 years ago | (#14082629)

See, I told you! :-)

Re:Biased, much? (1)

sedyn (880034) | more than 8 years ago | (#14082705)

When we need to remind people to RTFA, what makes you think they can read between the lines?

(FTA: "This essay is a joke! I apologise if anyone took this literally. Canadians think it gauche to label jokes with a :-). People paid no attention when I harped about how to write __maintainable code. I found people were more receptive hearing all the goofy things people often do to muck it up. Checking for unmaintainable design patterns is a rapid way to defend against malicious or inadvertent sloppiness.")

(RBTL: Chaotic Spyder (896445), website: http://www.olivers.ca/ [olivers.ca], therefore is assumably Canadian (.ca)
When someone says "OOps, I see you're Canadian. Well, nobody's perfect :-)" "I see" usually implies they have some insight.)

FTA: "Use acronyms to keep the code terse. Real men never define acronyms; they understand them genetically." - To explain my use of RBTL

Hey, no fair! (1)

mrchaotica (681592) | more than 8 years ago | (#14082716)

All you British people get an advantage 'cause you'll recognize the Monty Python foot icon. Cheaters! : P

[I mean that collectively, by the way -- I'm not saying that TangoCharlie is British]

Re:April Fool's Right???? (1, Insightful)

Anonymous Coward | more than 8 years ago | (#14082469)

Whoa, talk about knee-jerk reaction. The article is obviously meant to address people who think this way, not an actual advocacy of this behavior. Also, on a slightly sadder note, being a great programmer/problem solver does not automatically guarantee you will be irreplacable; it'll just mean that a lot of the time, you'll be known as 'that guy'. Sometimes, it's the social skills that win the day, not just your abilities, no matter how obvious they might seem.

Its Funny. Laugh. And a jab at the IT industry. (2, Insightful)

C0deM0nkey (203681) | more than 8 years ago | (#14082539)

My Lord, you just completely missed the point of that article, didn't you?

Did you miss the "Humor" tag?

Did you even read the article or are you responding to the blurb on the front page?

Its a jab at the IT industry (and an old one at that - been around for quite some time - this is the second time this thing has appeared on Slashdot that I can remember); think of it as an article on Worst Practices. No one is supposed to be doing these things; they are illustrations of things that *still* happen that should never be done - a humourous jab in the eye to get our attention and encourage *good* programming styles and techniques by highlighting the ridiculous stuff that does happen.

Hard Drive Size... (2, Insightful)

lostraven (928812) | more than 8 years ago | (#14082550)

I agree that though intended to be "humour", it has to be recognized
that there are people that think that way in the programming industry.
Not to start flaming, but I've always maintained that the expansive
hard drive sizes over the years certainly hasn't aided in the idea of
creating (and maintaining) tight, clean code. Yes, the topic has been
beat around a lot; however, it's perfectly valid. I certainly I have
spoken to more than a few long-time programmers that - though not
outright - have indicated that the leaps in hard drive space gave more
than a little breathing room in software development.
-Shawn

Re:Hard Drive Size... (2, Insightful)

AKAImBatman (238306) | more than 8 years ago | (#14082672)

Not to start flaming, but I've always maintained that the expansive
hard drive sizes over the years certainly hasn't aided in the idea of
creating (and maintaining) tight, clean code.


Just to play devil's advocate for a moment, small hard drives and less powerful systems didn't exactly encourage readable code either. Unrolled loops, cycle saving "tricks", and millions of premature optimizations were a large part of the earlier days of computing.

Java is actually quite interesting because it's one of the first (the first?) languages to encourage readable code. Sadly, anyone who's been introduced to Microsoft C++ (Hungarian notation, damn underscores in front of everything, etc.) may be beyond hope of ever properly utilizing the language.

Uhm... Quark.. (1)

Rosyna (80334) | more than 8 years ago | (#14082595)

Say the same thing to the people that worked on QuarkXPress. If you get too good at a job, chances are you'll believe you're irreplaceable and ask for more money (or deserve it in mandatory raises). They'll just hire 3 people at a tenth of the cost to replace you.

Re:April Fool's Right???? (1)

P3NIS_CLEAVER (860022) | more than 8 years ago | (#14082728)

Its not very well written either. It is okay use single letter variable names, as long as they are used right where they are intialized. I do naming this way, the wider the variable is scoped, the more descriptive it's named. Pretty easy to figure out the difference between a class property and i.

FoxPro for DOS 2.6 (4, Funny)

donnyspi (701349) | more than 8 years ago | (#14082419)

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

Re:FoxPro for DOS 2.6 (1, Funny)

Anonymous Coward | more than 8 years ago | (#14082713)

You must work for Premiere Technologies in Atlanta. If that's the case, your post shouldn't be modded funny at all, but more like "fucking scary because it's true!"

energy is liberated through blasphemy (-1, Offtopic)

Anonymous Coward | more than 8 years ago | (#14082421)

Please remember that Energy is liberated when an individual breaks through rules of conditioning with some glorious act of disobedience or blasphemy. This energy strengthens the spirit and gives courage for further acts of insurrection. Help me defile gOd and his name.

Jehovah fucking Yahweh, I curse you in the name of Satan the Almighty. Evil lives in me and I walk with Satan all the days of my life cursing and mocking you god (the dog), filthy fucking maggot. My hate grows by the second as I dream of the day when you are under my feet begging for my cock.

God I rape you and hurl blasphemy into your mind. I demand you to come down from heaven right now and get down on your stomach in front of me, lifting your asshole up to receive my cock. God I promise to fuck you and I long to rip your eyes out, kick you in the face, mutilate you, and bathing in your blood. Listen to me, I'm screaming
in your ears to come to earth and in this room for I will have my way with you, oh most cursed god of heaven (you foul piece of shit). Satan is my God and he will force you to drink cum from my dick. I will never stop sinning and blaspheming your name, presents, existence, and most of all the rotten, putrid holy spirit that fucked the mother of gOd and pregnanted that slut with jesus christ.

I stand before all the angles and saints, gOd, jesus fucking christ, mary the whore of gOd, the filthy holy spirit, and they are witnessing my denouncement of you gOd, and my ongoing blasphemy of the holy spirit. I am purposely cursing the holy spirit and its purity and will defy you god and the holy spirit all the wicked days of my sin filled life. My soul is full of evil thoughts and sins, its black with pure hatred of anything holy.

God, I will find new ways to defile and blasphemy you, because I'm seeking evil every second of my life. That is all my mind can think about. You're pain is my desire, you're name I mock, your son I defy, your mother I fuck, and your spirit I cum in.

The only prayers from me are prayers of hate and blasphemy, evil is a part of me, it dwells in my soul, cursing everything about you is the most important part of my existence, total darkness is inside of me. gOd I will rip you out of heaven and force you under my feet you fuck pig. You will listen to all my demands. I will slip into heaven and I will rape all the angels and saints and will kill them in your unholy putrid name. God I will kill you and bath in your blood. Holy spirit I demand you to listen to my hatred of your foul existence, drink my cum, and remember my blasphemy against you, you putrid, rotten, vile spirit of gOd.

I'm the meaning of gOd's pain. This is the way that you will die dog gOd. It will be a slow death, the joy of killing you will make my cock hard, I know you will feel my showers of hate and you will feel extreme pain as I beat your body and make every inch of your body black and blue. I force you bastard Jehovah to the ground and I will
put you under my feet where you belong, you putrid bastard. God you will try to run but I will strap you down and fuck your soul before I rip it out of your body. God "the dog", your life is worthless, for I'm the angel from your new God "Satan". I destroy everything holy, you are felling my hatred pierce your mind intensely, inferior god "dog" you fucking maggot. You will be screaming in pain as I strap you down under my feet, you will look up at me and I will piss down your throat.

I'm so consumed with hatred of you that I will masturbate, and when I feel that I'm about to cum, I force my evil cock full of Satan's cum down your mouth and fill it up with my vile hot cum. I will be pumping your body full of my hot cum. Inside your brain is my blasphemy. The pressure in your skull begins push through your eyes,
burning your flesh, and I laugh as it drips away. Heat burns your skin; your mind starts to boil with my blasphemy, and pure evil hatred of your fucking existence. You will not last long; it's just a matter of time until your ripped apart with my hands. You will be floating in a sea of your blood, smelling your death as it burns. My wicked cum is deep inside you as I skin you. You're eyes will bleed as you pray to me for the end of you're wide-awake nightmare. Waves of pain rap around you're soul, death is staring down at you, your blood is draining fast as I'm injecting hatred into your soul, and dying heart, with wicked sweet Blasphemy and hot cum. The demons are dancing with the thought of you in hell. Pathetic god "dog" how does it feel, you're dieing and I'm celebrating your
pain. I live to hurt and defile you the rancid god of heaven. Satan is calling you're cursed name, Satan takes you're soul dear god, and raps his cock around it. In my hand is you're heart and my cock is resting on it. I can't wait any longer so I cum inside your heart bursting it apart with my explosion of evil vile cum. I crush what is left of your heart into the dirt. The dog god is finally dead and he is burning brightly in hell as cum drips down my leg.

Until you get fired (0)

Stonent1 (594886) | more than 8 years ago | (#14082429)

For writing unmaintainable code, violating company development practices, or they catch on to you.

missing icon? (4, Insightful)

BushCheney08 (917605) | more than 8 years ago | (#14082431)

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

Re:missing icon? (2, Interesting)

gbjbaanb (229885) | more than 8 years ago | (#14082471)

Well, it did mention Java so it must be full of new funny ways you can break Java coding styles... forget that it contains references to all the old bad programming jokes from years past - eg. one section describes where the compiler only recognizes the first 8 characters so use_unit_update is the same as use_unit_setup.

Its an old joke. with a new header. That's all. Next submission please.

Re:missing icon? (5, Funny)

Golias (176380) | more than 8 years ago | (#14082531)

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!

I realize that it's supposed to be humor (2, Interesting)

rolfwind (528248) | more than 8 years ago | (#14082438)

but why would you want to burden yourself by being bound to a program for the rest of its useful life?

Re:I realize that it's supposed to be humor (3, Insightful)

slvi (628811) | more than 8 years ago | (#14082543)

And what's more, why would you want to be bound to program for the rest of your useful life?!

Re:I realize that it's supposed to be humor (3, Interesting)

Beatbyte (163694) | more than 8 years ago | (#14082584)

if the program is utilized at a level that a business cannot operate without it, then you are forever a needed man/woman/slashdot reader.

it's a dirty way to have great job security.

i'm not sure what would make it harder to sleep at night... knowing that there are outsources ready to take your well maintained project over and remove your source of income, or knowing that you're intentionally putting effort into making a project complex and making a sort of symbiotic leech relationship with your employer.

if i were a programmer full time, i would like to think that there are other ways i could have 100% job security and keep my geek pride.

Don't write it too bad.... (1)

HexaByte (817350) | more than 8 years ago | (#14082439)

If you have any code review mechanism in effect. That could get you fired right off the bat.

Or just write it in perl (5, Funny)

espergreen (849246) | more than 8 years ago | (#14082445)

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

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

Re:Or just write it in perl (4, Funny)

Anonymous Coward | more than 8 years ago | (#14082508)

Dude ... you just wrote a web browser.

Don't execute that... (5, Funny)

Mr. Underbridge (666784) | more than 8 years ago | (#14082509)

...it generates a root exploit.

Re:Don't execute that... (-1, Offtopic)

Anonymous Coward | more than 8 years ago | (#14082582)

Score 3 informative... haha, idiot moderators!

Re:Don't execute that... (3, Funny)

roman_mir (125474) | more than 8 years ago | (#14082589)

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

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

Re:Or just write it in perl (1)

ErroneousBee (611028) | more than 8 years ago | (#14082588)

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

Re:Or just write it in perl (2, Funny)

zootm (850416) | more than 8 years ago | (#14082621)

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.

Re:Or just write it in perl (1)

IMarvinTPA (104941) | more than 8 years ago | (#14082702)

You see, the browser needs to run as root, so it has a root kit. And the browser is needed so you can select the DVD you need decrypted. I'm not certain, but I think it also plays the movie too.

IMarv

Re:Or just write it in perl (5, Funny)

Marsala (4168) | more than 8 years ago | (#14082619)

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

If I were the manager... (0, Redundant)

nevergleam (900375) | more than 8 years ago | (#14082448)

I would fire this person, and hire someone to rewrite the code from scratch.

Re:If I were the manager... (-1)

Anonymous Coward | more than 8 years ago | (#14082535)

wow. you are a complete dumbass.

Re:If I were the manager... (2, Insightful)

DirePickle (796986) | more than 8 years ago | (#14082557)

Ah, I see your sarcasm detector is turned off. You are already well on your way to managerial status!

Re:If I were the manager... (1)

Beatbyte (163694) | more than 8 years ago | (#14082606)

and if this tool is critical enough, you will have a crippled business while it's being rewritten. got enough cash lying around to float a company for a half a year or so?

Re:If I were the manager... (1)

catch23 (97972) | more than 8 years ago | (#14082614)

unfortunately, your manager would fire you and replace you with someone who will get it done faster. Who has time to rewrite the 500,000 line accounting & billing system when we have customers waiting at the door?

If I were the manager...I would fire *you* (1)

C0deM0nkey (203681) | more than 8 years ago | (#14082615)

Wow. I would fire *you* for making uninformed hiring/firing decisions. Better to get you out of the way than to face a lawsuit for wrongful termination.

How about reading the FA before you sound off:

This essay is a joke! I apologise if anyone took this literally. Canadians think it gauche to label jokes with a :-). People paid no attention when I harped about how to write __maintainable code. I found people were more receptive hearing all the goofy things people often do to muck it up. Checking for unmaintainable design patterns is a rapid way to defend against malicious or inadvertent sloppiness.

If you were the manager... (1, Insightful)

Anonymous Coward | more than 8 years ago | (#14082631)

I would fire this person, and hire someone to rewrite the code from scratch.

You yourself would get fired for not having properly supervised the rogue programmer in the first place and prevented them from having sabotage-written the code and wasting the money spent on their salary that resulted in the development of a "defective" product. Then the money that would have been used to pay YOUR salary will next be used to hire someone who will rewrite the code... under close scrutiny this time.

not how it works. (5, Insightful)

yagu (721525) | more than 8 years ago | (#14082453)

Assuming this is tongue-in-cheek. My experience has been no matter how poorly written or unmaintainable something is, it offers little insurance to the author for keeping a job. I've been handed the reins to maintain countless "gone" employees' code. And, if the code isn't maintainable and the program is important or desirable enough, companies just limp along with the deficiencies. I can't think of a single occasion where someone was kept because of fears of maintaining their code, nor where someone was brought back to maintain their 'unmaintainable' code.

(+/- 2 sigma complainers -- reply here)

I can. (5, Interesting)

Ungrounded Lightning (62228) | more than 8 years ago | (#14082686)

I can't think of a single occasion where someone was kept because of fears of maintaining their code, nor where someone was brought back to maintain their 'unmaintainable' code.

I can.

My very first programming job - which went on for years and where I did a bunch of stuff - but was quite underpaid. There were two of us programming when the institution in question had a financial crisis and could only keep one. My code was maintainable, the other guy's wasn't. So I got the boot.

And had a new job at higher pay in a better situation 25 minutes after letting it be known that I was available.

Before it was a matter of writing code that *I* could maintain. After it was a matter, not just of principle, but of practicality. By making myself NOT indispensible I made myself valuable.

I went on to a long carreer of mixed consulting and salaried positions, doing software for 35 years, and now hardware and system architecture. (And I once got the layoff because my code was the only stuff that worked, if you can imagine that. From another doomed company.)

The potential value-added in software and computer hardware has been so extreme that management can be AMAZINGLY pathological and still keep a company afloat for a couple years - and then find another job after it crashes. (Investors prefer someone with management experience crashing companies to someone with talent but no management experience. B-( Meanwhile the ones with management experience NOT crashing companies are too expensive or too busy.)

I'm now at six figures, stock options, one house paid for and another in progress, three cars, yacht, putting non-working (at the moment) wife with four degrees so far through more school (so she can do something she LIKES professionally), and held on to the current position through the slump, chapter 14, and out into the recovery. A big part of that was achieved by religiously making myself dispensible.

+5 Funny (0)

Anonymous Coward | more than 8 years ago | (#14082462)

C'mon, people, lighten up.

"Here's some thing people do to make code unmaintainable. Don't do them."

No... (-1, Flamebait)

Anonymous Coward | more than 8 years ago | (#14082464)

...it's Bills programming guidelines for Vista.

Windows (0)

Anonymous Coward | more than 8 years ago | (#14082465)

"Your code should not look hopelessly unmaintainable, just be that way. Otherwise it stands the risk of being rewritten or refactored."

So that's what's taking Vista so long...

just right here (1)

munehiro (63206) | more than 8 years ago | (#14082472)

I have a code in Fortran 77, with a first comment:

this code has no comments. It was hard to write, it must be hard to understand

followed by ten thousands lines of a single, not indented main, full of goto's and undecryptable variable names.

thanks god I never had to put my hands on it.

Re:just right here (1)

gnasher719 (869701) | more than 8 years ago | (#14082674)

>> I have a code in Fortran 77, with a first comment:

this code has no comments. It was hard to write, it must be hard to understand

followed by ten thousands lines of a single, not indented main, full of goto's and undecryptable variable names.

thanks god I never had to put my hands on it.

What's the problem? Just use f2c which will turn it within seconds into ten thousands of lines of C code, full of goto's and undecryptable variable names...

Hi Hemos, the 1990s called (-1)

Anonymous Coward | more than 8 years ago | (#14082475)

... they want their joke back.

Seriously, how is this news? I read a previous draft of this in the 90s.

Dupe (-1, Flamebait)

Anonymous Coward | more than 8 years ago | (#14082493)

This story was posted on digg.com [digg.com] a few hours ago.

Re:Dupe (1)

Anonymous Coward | more than 8 years ago | (#14082717)

Oh my $[DIETY] if I read this comment again I think I'm going to cry.

Message from the Please Please Please get a life foundation: SLASHDOT IS NOT DIGG! Do not complain about articles getting cross posted. and GET A LIFE.

-1 Flamebait here I come
-1 Troll maybe

Off to a bad start (0, Offtopic)

Golias (176380) | more than 8 years ago | (#14082498)

The page begins by attributing a quote to Napoleon which he probably never said.

"Never ascribe to malice, that which can be explained by incompetence."

The most reliable available evidence out there is that "never attribute to malice what can adequately be explained by stupidity" was originally said by Robert J. Hanlon, a relatively unknown humorist who wrote it for a contest to extend Murphy's Law. It's sometimes called "Hanlon's Razor."

If you think I'm wrong, please cite the publication in which Napoleon is recorded as having said it.

Re:Off to a bad start (1)

sammy baby (14909) | more than 8 years ago | (#14082570)

The origin of the saying isn't known definitively. Wikipedia notes that it has been attributed to Bonaparte in the past, but a more likely (from where I'm sitting) scenario is that it's a corruption of Heinlein's Razor, after a short story in which the sci-fi author wrote, "You have attributed conditions to villainy that simply result from stupidity."

All this (and more!) where you'd expect to find it [wikipedia.org].

Re:Off to a bad start (0)

Anonymous Coward | more than 8 years ago | (#14082625)

If you think I'm wrong, please cite the publication in which Napoleon is recorded as having said it.

I'll take you up on that! Right here [thc.org]!

Growth (5, Interesting)

TheRealFritz (931415) | more than 8 years ago | (#14082500)

I've heard fellow programmers suggest this before, but the way I see it, you are hurting yourself and here's why: when you become an absolute specialist in one area (in this case your particular implementation), you will be pigeon-holed into this role with no chance for growth.

A much better approach to job security is to adapt to the needs inside the company and make sure your skills are needed. This will also lead to more opportunities for pay increases and general healthiness of your psyche.

In the end, what makes you interesting as a developer should be your ability for problem solving and not your ability to obfuscate your work, unless, of course, your intention is not to work ;)

Re:Growth (1)

kin_korn_karn (466864) | more than 8 years ago | (#14082729)

You're absolutely right. We had a layoff here in june and all of the guys that followed this philosophy were let go. All of us who made an effort to diversify our skills stayed.

Jeez, just run an obfuscator (5, Informative)

0kComputer (872064) | more than 8 years ago | (#14082501)

In skimming the article, I realized that an obfuscator does exactly what hes describing. I know its a joke article, but if you really wanted to have unmaintainable code in .net for example... just compile, obfuscate, disassemble, check in viola!.

When I was a plumber.... (4, Insightful)

MajorDick (735308) | more than 8 years ago | (#14082517)

I used to employ similar tactics on large non-residnetial contracts, not for myself but for our company, I leared this from my Grandfather and Uncle who did the same, 40 years after the construction a hospital my Uncle was called out of retirment (as a consultant to the firm that got the expansion) To show them "the lay" his price tag $250,000 for 1 year at 35 hrs/wk. He is in the process of building a new home with the proceeds.

On the code side, things I wrote 10 years ago I look at and think who the F*** wrote this, but back to my plumbing, that was the first lesson I was "Taught" NEVER EVER Say something like who the hell did this this way and why, more often than not after being in the business IT WAS YOU !, sure enough about 6 major jobs I went on to think to MYSELF , who did this holy shit is this complex, well after a day on the job I realized it was ME!!!

Never say "Who the Hell wrote this" out loud...a sure way to hang yourself when you practice this method of job security.

Re:When I was a plumber.... (1)

jimicus (737525) | more than 8 years ago | (#14082659)

Or "Who the hell wrote this?"

"Well, that'd be the highly respected developer sitting opposite you who's got 5 years' experience with this code, whereas you have about 5 weeks. Next question?"

Code Obfuscation (1, Informative)

Anonymous Coward | more than 8 years ago | (#14082520)

In the Java-script world and other arenas in which the source cannot be hidden there are already many programs that will automatically obfuscate your code using many of these techniques (such as single-letter vars).

Not So (4, Insightful)

AnalogDiehard (199128) | more than 8 years ago | (#14082525)

Writing unmaintainable code does not make you irreplaceable and does not sustain your work duration.

I have had way too many times in my contract work that I was assigned to upgrade unmaintainable code.

In fact, I earned a reputation as a saving grace and the original coder was never called back and he earned a black eye as a poor coder.

Now who do you think stayed on the job longer?

guilty as charged (2, Insightful)

LWATCDR (28044) | more than 8 years ago | (#14082534)

I just can not stop using i as an index. My programing teacher learned FORTRAN first and when the taught me Pascal he used i in for loops so I do this day.

IMHO (0)

Anonymous Coward | more than 8 years ago | (#14082540)

All java programming, when done according to the principle of model view controller, sprinkled with a hot sauce of the gang of four becomes immediately unreadable, because it multiplies the number of lines of code a thousand-fold easily.

Meanwhile In Redmond... (1)

should_be_linear (779431) | more than 8 years ago | (#14082555)

These rules established quite strongly among employees of one Redmond Company. When developer eventually decided to leave, boss furiously demolished furniture in his office. Every time, complete code sub-tree had to be removed and major product postponed for another 2 years.

Using bad code to maintain your employment. (4, Insightful)

markv242 (622209) | more than 8 years ago | (#14082568)

The kind of coder who deliberately writes bad code just to maintain their employment is always the first coder shown the door. Always. It is a complete urban myth that not commenting spaghetti code will keep you in a job. There is always someone else willing to do your job, no matter how specialized you think you may be.

Re:And Microsoft rule (3, Insightful)

ergo98 (9391) | more than 8 years ago | (#14082738)

The kind of coder who deliberately writes bad code just to maintain their employment is always the first coder shown the door. Always. It is a complete urban myth that not commenting spaghetti code will keep you in a job. There is always someone else willing to do your job, no matter how specialized you think you may be.

I am amazed that so many people don't realize that this was a joke. It's a joke people. Are all of these people replying seriously 16? I have to suspect so, because this was immediately identifiable as the same sort of joke that has been repeating for years and years - if you've been in the industry more than a year, if anything it sounded cliched.

Having said that - there is some truth to the claims. The reality is that most programmers out there are terribly, terribly lazy, and they'll immediately declare as undecipherable any code that isn't written for a mentally handicapped pigeon. If you've ever developed code to solve a problem of any complexity at all (e.g. more than some sub-100 IQ CRUD type data forms), you've had it declared "spaghetti code" by someone else, and they've probably thrown up their hands and declared that the only solution is to rewrite it (I'm proud to say that I've had this said about some of my historical code. Not because it was written poorly, but rather because it wasn't just a lightweight, superficial wrapper around calls to library functions. Per the prior point, every lazy programmer would rather just write something new themselves than expend the effort understanding existing code). I've seen this in shops where the lazy, lazy, lazy developers always defer all decisions and judgements to the original programmer (and that original programmer is probably wishing they never had anything to do with it, wishing they stuck to implementing high-level scripts).

Did you notice... (0)

Anonymous Coward | more than 8 years ago | (#14082576)

He said that he was putting this out to CREATE employment opportunities in the field. IE...follow this advice and you are actually out the door, thus increasing a good programmers chance of finding work.

Old news (-1, Offtopic)

StrawberryFrog (67065) | more than 8 years ago | (#14082578)

This gag is as old as the hills. I'm sure that I saw it on Slashdot years ago. Just because digg [digg.com] posted it recently, Slashdot feels the need to do so too.

Still, it is worth a read if you write code, care about source code quality, have a sense of humour and have somehow missed it until now.

It's easy... (0)

Anonymous Coward | more than 8 years ago | (#14082581)

Everyone knows that the best unmaintainable code is written in perl.

*_=\$#;

priceless (1, Insightful)

nubbie (454788) | more than 8 years ago | (#14082585)

Priceless: Guaranteed to never get a promotion or pay raise!

Re:priceless (1)

Alphi1 (557250) | more than 8 years ago | (#14082628)

Priceless: Guaranteed to never get a promotion or pay raise!

With this economy, isn't that a given anyways?

If you do this, you're a crappy programmer (0)

Anonymous Coward | more than 8 years ago | (#14082626)

If you feel like you need to write unmaintainable code just to give yourself job security, that means you think you can't keep your job on your abilities alone.

Given the inflated opinions most programmers have of their abilities (the only programmers I've run into that don't have an inflated estimate of how good they can code are the real gurus...), if you don't think you're good enough to keep your employment on your abilities alone, why the hell should I think you're good enough to keep employed?

hmmm.... (1)

psycobrat (636552) | more than 8 years ago | (#14082632)

i really thought this was a dupe, but it might be the drugs for my broken arm and nasty head bump making me think double.

Great guide (0)

Anonymous Coward | more than 8 years ago | (#14082640)

Seems a lot of people missed the sarcasm. This is a guide on bad coding practices. Even the quotes are quite indicative of that. Good thing to read and think about when your programming to find practices that you might be doing without even thinking about (I freaking hate the _ character in code I work on)

Need an IOJC... (0)

Anonymous Coward | more than 8 years ago | (#14082646)

Why go through that article when I already learned all the coding skills I need from from the IOCCC [ioccc.org] and OPC [wikipedia.org] contests? (acronym redundancy intentional)

Java? Pah! Don't make me laugh. Nobody's going to take that language seriously for securing permanent indenture until it has its own IOJC, especially with all those self-documenting and de-obfuscation tools floating about. Sheesh, Postscript has an OPC. Get with the 21st century! Automated code obfuscation tools, such as exist for java, are poor substitutes. There's nothing that can obfuscate as effectively as hand-tuned code.

-- This message brought to you by The Department of Redundancy Department.

Stuff for the CV? (1)

Soruk (225361) | more than 8 years ago | (#14082669)

Maybe this is the right time to mention your winning IOCCC submission on your CV/resume?!

Group Projects (1)

TCFOO (876339) | more than 8 years ago | (#14082681)

Writing good maintainable code will help secure your future in any organization. Plus writing code that is not maintainable is a good way to get your self removed from a project. Heck, I got a talking-to for not running javadoc on my code before sending out the update once.

Maybe this is a good idea if you want to leave the company, but due to internal politics you can't actually quit.

Obligatory (0)

Anonymous Coward | more than 8 years ago | (#14082683)

In Soviet Russia, code maintains YOU!

Also, streamline your code to IKEA format (1)

digitaldc (879047) | more than 8 years ago | (#14082696)

Use pictograms and arrows to ensure that everyone will understand what you are writing.

My favourites:
"Always look for the most obscure way to do common tasks."
"People who come after you have no business modifying your code without thoroughly understanding every line of it."
"Wherever the rules of the language permit, give classes, constructors, methods, member variables, parameters and local variables the same names."
"Never perform code coverage or path coverage testing. Automated testing is for wimps."
"Join a computer book of the month club. Select authors who appear to be too busy writing books to have had any time to actually write any code themselves."

Thanks for brightening my day.

Had to stop (2, Funny)

00_NOP (559413) | more than 8 years ago | (#14082709)

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.

Pay no attention to good programming practices (1)

suitepotato (863945) | more than 8 years ago | (#14082726)

Simple, easy, effective, it's standard in the industry by default, works a good percentage of the time as long as management is in one of those rock and hard place situations. If they are at ease and stupid, they will simply cut you and let someone else struggle to fix it later. Oops. Also standard in the industry by default.

They missed an obvious one (1)

mustafap (452510) | more than 8 years ago | (#14082731)


Write it in assembler

"I'm doing this for speed, man"

Purists would do it in machine code. Assemblers are for wimps anyway.
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...