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. '"
Our company's main system is written in FoxPro for DOS 2.6. The FP programmers here seem to have guaranteed lifetime employment :-)
#!/usr/bin/perl
:(
&!@&/*!QW(*()@!@(I!@()!@)(!@*/\()!@&*(@!/*(&
Ok, I admit it. I just banged on the keyboard
Yes of course this is a joke. Turn your humor sensors on NOW!
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; }
How to really write unmaintainable code:
Apply equal parts of Perl and Guinness
What are you eating? isItVeg?.
...it generates a root exploit.
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.
See, I told you! :-)
return 0; }
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.
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.
I don't need no instructions to know how to rock.
crazy dynamite monkey
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
Build it, and they will come^Hplain.
What version control system is it you use that allows you to check in 4-stringed musical instruments slightly larger than a violin?
-- Soruk
[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
Which chapter 14?
s c_sup_01_16_10_14.html
Were you age discriminated?
http://www.law.cornell.edu/uscode/29/ch14.html
Or were you a whaler?
http://www.law.cornell.edu/uscode/html/uscode16/u
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
You must've been the plumber for the house I just bought.
Bastard.
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.
And how can you not love a language that has a data type for Pounds Sterling?
Don't underestimate the power of The Source
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.)
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.
Million Dollar Screenshot
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.
Not 100% on-topic, but this article brings to mind this little jewel I found online some years ago:
12 Things A Klingon Programmer Would Say:
12. Specifications are for the weak and timid!
11. This machine is a piece of GAGH! I need dual Pentium processors if I am to do battle with this code!
10. You cannot really appreciate Dilbert unless you've read it in the original Klingon.
9. Indentation?! -- I will show you how to indent when I indent your skull!
8. What is this talk of 'release'? Klingons do not make software' releases'. Our software 'escapes' leaving a bloody trail of designers and quality assurance people in its wake.
7. Klingon function calls do not have 'parameters' -- they have 'arguments' -- and they ALWAYS WIN THEM.
6. Debugging? Klingons do not debug. Our software does not coddle the weak.
5. I have challenged the entire quality assurance team to a bat'leth contest. They will not concern us again.
4. A TRUE Klingon Warrior does not comment his code!
3. By filing this SPR you have challenged the honor of my family. Prepare to die!
2. You question the worthiness of my code? I should kill you where you stand!
1. Our users will know fear and cower before our software. Ship it! Ship it, and let them flee like the dogs they are!
Please stand clear of the doors, por favor mantenganse alejado de las puertas
Some bosses not only encourage it, but applaud it. Lifetime employment indeed :P
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
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
Don't try to make the code itself unreadable. That's a dead giveaway. Use good programming procedures to hide your wickedly complex object and data models.
The way to make your code unmaintainable is through proper use of design patterns. Don't skimp. Combine many design patterns together to make your code so complex that nobody can ever figure it out, even by stepping through your code with a debugger. Use factories to produce composite visitor objects that bridge each other recursively. God, that just gave me a tent thinking about it.
If anyone complains that they can't figure out your code, tell their manager that you're worried about poorly trained programmers that don't keep up with good programming practices. So-and-so doesn't know even the most basic design patterns. Express your concern that such low-level programmers might screw up the code and require you to have to return to the site for maintenance, with your very high fee.
All of the rest will write a Perl program.
Wow... the only reason they upgraded was because the guy died. That guy should feel pretty good.... wait, he died.
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
Dear friend,
My name is Naorumi Hajan, I own a large scale of hotels in Swede Arabia. You probably don't know me, but I was very scared by your comment. We can lose millions ($16000000USD) of dollars because our profits depend on uptime. The analyst told me the other day that we make $1M per minute at average. Imagine what can happen! I don't understand anything about what these programmers are doing. I wish not to risk looosing all this dollars. You can help me. I want to buy your book on good coding practices. You deserve to be rich because I am very afraid by your story. I will also buy any encyclopedias you sell.
Send me your credit card info.
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.
<!--
while(!am) r2();