Stories
Slash Boxes
Comments

News for nerds, stuff that matters

How To Write Unmaintainable Code

Posted by Hemos on Thu Nov 18, 1999 09:32 PM
from the it's-how-i've-kept-my-job dept.
/ writes "Roedy Green of Canadian Mind Products has written an essay entitled "How To Write Unmaintainable Code". Following his 54 tips, you too can guarantee job-security by becoming irreplaceable. If that weren't good enough, it's even available in Spanish. "
This discussion has been archived. No new comments can be posted.
How To Write Unmaintainable Code | Log In/Create an Account | Top | 327 comments (Spill at 50!) | Index Only | Search Discussion
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1) | 2 | 3 | 4
  • yes! by nicky p (Score:1) Thursday November 18 1999, @04:36PM
  • the secret to my success by CFN (Score:1) Thursday November 18 1999, @04:41PM
  • Coding by pvthudson (Score:1) Thursday November 18 1999, @04:47PM
  • The prize goes to... by Skim123 (Score:2) Thursday November 18 1999, @04:49PM
  • by E-TiE (107831) on Thursday November 18 1999, @04:51PM (#1520483)
    Writing unmaintainable code for job security is a Bad Idea (TM). Cuz guess what? You might end up the victim of your own practices -- and who's going to get fired when they've failed to figure out code they wrote a year ago? You. Don't do it. Maye you should work somewhere else where they know how much you're important and valuable to them, so you don't have to take such measures as to write bad code. And if you're going to get replaced so easily then maybe you were not worth your salt in the first place.
    ------------------------------------------ -----
  • by Skim123 (3322) <mitchell&4guysfromrolla,com> on Thursday November 18 1999, @04:53PM (#1520484) Homepage
    Huh, that brings up an interesting point. What is better, to write crappy code or to take the time to make it nice and neat? From the programmer's perspective, it makes sense to write crappy code: bosses are demanding you finish projects before you even begin them, and good takes time to write; also, like you mentioned, job security is nice indeed.

    However, don't we, as programmers, have some sort of obligation to try our best to create nice, maintainable code? I may be getting a little too philosophical here, but we expect artists to paint to their best abilities, poets to write to their best ability. It seems like if someone in one of these professions purposefully wrote sloppy poetry, or half-assed a painting, that we would look down on them. Perhaps it is a pride thing, but you think you'd intrinsically want to write good code.

    I am not trying to sound preachy, CFN, for I don't know if you wrote sloppy code because you wanted to, or, more likely, because you were rushed and your superiors favored quantity of quality.

  • Make Code Look Like Ascii Art by Carnage4Life (Score:1) Thursday November 18 1999, @04:54PM
  • Help! by Imperator (Score:1) Thursday November 18 1999, @04:54PM
  • After A while... by PovRayMan (Score:1) Thursday November 18 1999, @04:54PM
  • by Pfhreakaz0id (82141) on Thursday November 18 1999, @04:55PM (#1520488)

    I Quote from the essay .... Maintenance programmers, if somebody ever consulted them, would demand ways to hide the housekeeping details so they could see the forest for the trees. They would demand all sorts of shortcuts so they would not have to type so much and so they could see more of the program at once on the screen. They would complain loudly about the myriad petty time-wasting tasks the compilers demand of them.


    This is precisely the reason VB is so popular for business apps. You have to really work hard to confuse matters sufficiently in a VB program so that a decent maintenance programmer can't figure it out.... although I could write my own list applicicable to Vb for my current project... My favorite: Make sure you have the same variable name to reference a database in several different classes in several different programs, but have it point to three different databases depending on which variable is in scope currently :)

  • Maintainable Code (Score:4)

    by Anonymous Coward on Thursday November 18 1999, @04:57PM (#1520489)
    To write unmaintainable code is a very unworthwhile thing to do, because you will be essentially married to the code until you find somebody to which you can explain it.

    Personally once I write some code I want it to be maintainable enough so other people can contibute for I can move on with other things. I do not feel that my life consists of solely maintaining code, why not do something challenging? Rather then babysitting one of my past accomplishments. Why not take over the world?

  • by torpor (458) <jayv@synth.n3.14et minus pi> on Thursday November 18 1999, @04:57PM (#1520490) Homepage Journal
    Back in the good old days of DOS (and thus, 80x25 page size), I had a programmer in my team who followed the "all functions must fit on one page" rule...

    Man, the number of times I wanted to kill that guy. We called him Anti-Whitespace.

    Scarey though, how that page gave guidelines that I myself have been guilty of following too many times in the past. Is there a counter-page to that one, that gives guidelines (general purpose) that make it easier to work with other programmers?

  • Re:For folks who complain about VB .... by pvthudson (Score:2) Thursday November 18 1999, @05:00PM
  • Re:the secret to my success by CFN (Score:1) Thursday November 18 1999, @05:01PM
  • As an architect (Score:3)

    by twit (60210) on Thursday November 18 1999, @05:02PM (#1520494) Homepage
    I hate it when members of my team write unmaintainable code. Frequently, when time's short or when people need help, I have to dive in, and I've found it difficult to get my bearings in code that I did the initial design for - difficult to see the forest for the trees, even when I planned out the forest.

    Good practises in programming isn't just for academics; it's the epitome of professional code writing. A manager once tried to draw the definition of a hack and a real programmer by the completeness and bug-free state of their code. I think he's wrong. I think that a real hack writes code that no one can pick up. A real programmer writes code that anyone can pick up and fix or expand - whether it's complete at any one point or not.

    --
  • Re:Maintainable Code by pvthudson (Score:1) Thursday November 18 1999, @05:04PM
  • 54 tips? by prok (Score:1) Thursday November 18 1999, @05:04PM
  • For those who are interested by tilly (Score:2) Thursday November 18 1999, @05:07PM
  • by eldurbarn (111734) on Thursday November 18 1999, @05:09PM (#1520499)
    The first n years of my career were spent maintaining old code. Assembler. I vowed "I will write maintainable code".

    Now I write good code. Maintainable. Well commented. Meaningful variable names. Nothing fancy. I know what it's like to revisit my code ten years later.

    There is a problem, though.

    Nobody else seems able to maintain my code. They just can't understand it.

    Despite high-level pseudo-code algorithm descriptions, threaded comments, good up to date written documentation, they just can't wrap their tiny little heads around how I do things.

    I can go back to something I wrote 15 years ago and fix problems without generating new ones. My code is robust enought that I can shovel out a few thousand lines and jam in another 10,000 lines, test it for a day or two and release it... and get no bug reports for another 5 years. I consider this to be maintainable code!

    Go ahead... break all the rules suggested in the article. You may still produce code that other, lesser programmers simply can't cope with. The code is an expression from the mind of the person who wrote it... and sometimes writing to the lowest common denominator simply isn't possible.

    And then they blame you for writing unmaintainable code.

  • Re:Fit all code on *one* page. by Imperator (Score:2) Thursday November 18 1999, @05:09PM
  • ... by Signal 11 (Score:1) Thursday November 18 1999, @05:10PM
  • What? No M$ comments? by Zagato-sama (Score:1) Thursday November 18 1999, @05:14PM
  • senseless! by rahuljain (Score:1) Thursday November 18 1999, @05:14PM
  • Re:Make Code Look Like Ascii Art by Signal 11 (Score:1) Thursday November 18 1999, @05:18PM
  • by UnknownSoldier (67820) on Thursday November 18 1999, @05:25PM (#1520508)
    It's not a philosohpical issue, it's one of practicality:

    When (not if) you end up maintaining someone else's code, if the code has been written in a clean way, it can be a sure joy to work with. If not, you'll be cursing that programmer for eons.
    (Lets keep Microsoft's API out of this ok ;-)


    The REASON we want good clean code is so that _we CAN_ maintain it.


    I have been in the position of looking at my own code 6 months, later, and gone "WTF?", and wasted lots of time trying to figure out just what the heck I did.

    If I had just spent the extra time to begin with, later on I could of been more productive instead of wasting time re-engineering the damn thing.

    Pay the piper up front and save time later, or be a "saving time" grinch, and find an expensive time bill later. Seems pretty obvious what "The Right Thing" to do is ;-)

    Work smarter, not harder =P

    Cheers


    BTW, Steve McConnel has a great book: Code Complete.
  • Re:Help! by h2odragon (Score:1) Thursday November 18 1999, @05:27PM
  • Re:Fit all code on *one* page. by adamv (Score:1) Thursday November 18 1999, @05:27PM
  • How to fail at software development by copito (Score:2) Thursday November 18 1999, @05:29PM
  • I didn't read the whole list (i don't like horror) by toast0 (Score:1) Thursday November 18 1999, @05:31PM
  • Bad takes more time to write by tilly (Score:2) Thursday November 18 1999, @05:32PM
  • War story (Score:3)

    by eldurbarn (111734) on Thursday November 18 1999, @05:34PM (#1520516)
    We had a system with about 750,000 lines of assembler, doing some heavy-duty, real-time math modeling of oceans. The hardware was old. The contractor said they'd deliver a modern system with the code in C.

    They wrote a converter that digested the assembler and produced C code... about 4 lines of C for each line of assembler code.

    So a math calculation that could easily be written in 1 line of C took 30 or 40 lines of assembler which converted into 120+ lines of C. (Stop screaming!)

    Their converter did not put the original source line as a comment in the new source. (Now you may scream!)

    Now I gotta maintain this pile of compost. I'm looking for another job.

  • Thingy! (Score:4)

    by mmmmbeer (107215) on Thursday November 18 1999, @05:34PM (#1520517)
    In naming functions, make heavy use of abstract words like it, everything, data, handle, stuff, do, routine, perform and the digits e.g. routineX48, PerformDataFunction, DoIt, HandleStuff and do_args_method.

    He forgot "Thingy"! How can you forget "Thingy"? As in "Take the thingy passed in by the user, send it through the thingy, and return the thingy to the user" and "Merge the two thingies, extract the resultant thingy, discard the other thingy, you don't need it here, and then pass the thingy on to the next thingy."
  • [OT] Are people missing something here? :-) by Gurlia (Score:2) Thursday November 18 1999, @05:39PM
  • arrgh by h2odragon (Score:1) Thursday November 18 1999, @05:40PM
  • Not documenting units by jesser (Score:1) Thursday November 18 1999, @05:45PM
  • by TummyX (84871) on Thursday November 18 1999, @05:46PM (#1520521)

    Ignore the conventions in Java for where to use upper case in variable and class names i.e. Classes start with upper case, variables with lower case, constants are all upper case, with internal words capitalised. After all, Sun does (e.g. instanceof vs isInstanceOf, Hashtable). Not to worry, the compiler won't even issue a warning to give you away. If your boss forces you to use the conventions, when there is any doubt about whether an internal word should be capitalised, avoid capitalising or make a random choice, e.g. use both inputFileName and outputfilename. You can of course drive your team members insane by inventing your own insanely complex naming conventions then berate others for not following them. The ultimate technique is to create as many variable names as possible that differ subtlely from each other only in case.



    (e.g. instanceof vs isInstanceOf, Hashtable)

    they are all valid w.r.t the conventions.

    instanceof is an operator and a keyword hence should be all lowercase, isInstanceOf is a method name, hence should start with a lower case character and the rest of the words should be capatilized, and Hashtable is a class name hence every word should start with a capital. Hashtable is the only one you could argue, but I'd say that sun just think Hashtable is one compounded word in itself not two words that describe a class's function.
  • Re:What? No M$ comments? by ywwg (Score:1) Thursday November 18 1999, @05:48PM
  • Re:Removing toungue from cheek... by sterwill (Score:1) Thursday November 18 1999, @05:48PM
  • Some more rules (Score:5)

    by Raul Acevedo (15878) <raul@cant[ ].com ['ara' in gap]> on Thursday November 18 1999, @05:49PM (#1520524) Homepage
    WARNING: 20 years of looking at, fixing and replacing bad code about to be vented...
    • Put all your code into a single function. (I've seen functions over 2000 lines in length.) After all, those nasty functions generate overhead on each call, and you want your code to be efficient right?

    • Use hungarian notation for variables. Then instead of the overly verbose

      int numLinePayments; char *maxTypeCode;
      you have the nice and compact

      int iNmPt; char *szTyC;

      BONUS: With compact hungarian notation, you can become even more descriptive! So really the above becomes:

      int iLnNmMtCsByPt; char *szMxQtBlTyAcC;
      So much more descriptive information, all in the same amount of space. I've been on projects using this, and the sheer of joy of it cannot be accurately described in words.

    • Don't indent your code uniformly. (This is a variation on #11 from the article.) Use Windoze or vi editors, with non-standard tab widths, for tabbing and indenting, which means that no one can see your code indented properly unless they use the same tools you use, with your same editing configuration.

      BONUS: Write extremely long lines of code, well over 80 characters per line.

    • If using C or C++, don't use memory analysis tools like Purify [rational.com], or its open source equivalents. After all, if you find your bugs too quickly, you might lose your job.

    • On large projects with several programmers, make sure you change global header files that cause everybody else's code to break but yours. Do this late in the afternoon, so all hell breaks loose breaks right before people are going home, or late at night, so that everybody comes in fresh the next morning and wonders what the hell happened to the code that compiled perfectly when they left the day before. Either way, make sure you are not around when they find out! Otherwise you spare them the joy of figuring out what you changed, and why.

      BONUS: Do this right before a major deadline.

    • Do really stupid stuff that you were taught from day 1 not to do, but everyone seems to do anyway: don't check for NULL, fix array sizes where you hardcode the max size everywhere, don't check for invalid or oversized input, etc.

    • Use preprocessor macros. Lots of them. (I was actually on a project where someone suggested using cpp to define macros. For Java. Absolutely brilliant!) The key is to use a single macro for multiple statements, in effect using macros as function calls. Example:

      #define DO_STUFF(x,y,z) if (x else more_stuff(z); \
      mystery(a*2, z-1); \
      for (int n = x; x != foo; x--) \
      more_stuff(n - x);
      Notice the "hidden" use of external variables and functions. Remember, you want to avoid those expensive subroutine calls! And think of the joys of setting breakpoints and stepping through a debugger on that code!

      BONUS: Don't use the all uppercase convention in macro names; use the same naming convention as function calls. It's even more fun to debug when you have to spend time actually figuring out do_stuff() isn't even a function call!

      MORE BONUS: Nest macro calls. Use the naming convention above.

      EVEN MORE BONUS: Use macro calls as variables. Make sure the expanded macro makes function calls. Or uses other macros.

    • Don't use source code control. Or, use it, but never unlock or checkin your files. Feel free to steal locks on others, though.
    And finally, one of my favorites, for all the young and aspiring hacker types out there:
    • Write code only for yourself. Assume no one will ever need to figure out how to use your code without poring through it in painstaking detail. Do not make it easy to use, interface with other code, or even compile. Include 30 caveats that would take you only a few minutes to fix, but you're just too lazy to. In other words, write as if no one will every look at or use your code, yet release it to everyone to look at and use. Defend your laziness, which is causing thousands of lost hours of work to others, by uttering useless and stupid "cool hacker" mantras like "Real Programmers don't write documentation" and "If it was hard to write, it should be hard to understand."
    Phew. That little tirade made me feel good. :)
    ----------
  • Re:slashdotted by abischof (Score:1) Thursday November 18 1999, @05:50PM
  • Re:Fit all code on *one* page. by Raul Acevedo (Score:2) Thursday November 18 1999, @05:52PM
  • by augustz (18082) on Thursday November 18 1999, @05:54PM (#1520528) Homepage
    Mirrored here [adboink.com]

    Enjoy

  • Mirrored here... by augustz (Score:1) Thursday November 18 1999, @05:55PM
  • Bad mirror by augustz (Score:1) Thursday November 18 1999, @05:57PM
  • Re:54 tips? by sterno (Score:2) Thursday November 18 1999, @05:57PM
  • Job security? try fortran by craw (Score:1) Thursday November 18 1999, @05:59PM
  • Re:Make Code Look Like Ascii Art by loki7 (Score:2) Thursday November 18 1999, @05:59PM
  • Re:the secret to my success by jmpvm (Score:1) Thursday November 18 1999, @06:02PM
  • by Anonymous Coward on Thursday November 18 1999, @06:02PM (#1520535)
    Oh dear, oh dear ...

    My company (owned by me) started a small contract last month at "a small financial services company" (let's not be too specific). About two years ago, they started to migrate off of DOS, a small 3090, and some netware boxes to Solaris. In the meantime, their workload has been growing. The old mainframers decided that they didn't like UNIX and waged a two year war to get rid of UNIX. All the UNIX guys left. Then they bought out two larger (but apparently worse-run) companies that were run completely on, you guessed it, UNIX. The mainframers announced that they were old and tired and perhaps they should bring the UNIX guys back (they were apparently told that they didn't have a choice). But they wouldn't come back (lots of work in Dallas for good UNIX guys, without rabid mainframers in the next cube). For the last nine months or so, they have had one group of "Unix" "consultants" from most of the majors over there "trying to fix the code" that they inherited. The code? perl. Just perl. A little ksh junk, some C, mostly perl.

    I (and two other people) are now 10% done (we estimate, and we are usually right on estimates). None of us can figure out what was so hard about the code. Really. Some of these "consultants" had teams of 20+ people here. I think that they must never have seen UNIX before in a production environment.

    This industry is very, very full of the clueless, and not all of them are running NT (most, yes, but not all). When people keep talking about the coming IT salary shakeout, I think of situations like this, and lots of others, just from the last few years. Good people will always be in demand. The lusers will rapidly find it hard to pay their bills. And this is not new -- it is just filtering from the most structured areas (that would have been MVS/COBOL shops) to the least structured (just wait, web-designer weenies -- your time will come), and it is hitting UNIX now. I think that the excuse of "this is just wild and crazy code and I no mortal man could wade through this spagetti" will soon hold as much water as "it's the compiler -- it hates me!" Heh. With this company, they were not clueless -- they kept the 3090 and never ever seriously considered NT. But UNIX was still believed to be bad juju and scary, so they accepted the explanations. I suspect that they won't in the future, as we are not missing chance to point out how clear things really are.

    And, as an aside, not a single one of the COBOL guys that I knew (actually, a lot of them were and are women) were never out of work more than a few weeks, and some of them have been keying for dollars since before I was born (1970, folks). Their only recent job changes have been to jobs paying $200+ an hour.

    Personally, I cannot fscking wait until some of these Thai-stick Bogarting full-of-BS tool-dependant Shockwave-inflicting pretentious "artist" wannabes that make web front ends to business site such a holy terror to implement for those of us with actual skills (like perl and DB2) start being forced on pain of no work and subsequent drug withdrawl to fscking write fscking proper fscking HT-fscking-ML to the fscking spec the client fscking asked for. Without the little moving GIFs. Grrrrrr ...
  • Re:What? No M$ comments? by mmmmbeer (Score:1) Thursday November 18 1999, @06:07PM
  • legacy code kills by Pope (Score:1) Thursday November 18 1999, @06:07PM
  • passwording function names by sklib (Score:1) Thursday November 18 1999, @06:08PM
  • Sowing confusion by mmmmbeer (Score:1) Thursday November 18 1999, @06:13PM
  • for(int i=5; i -->0;) by Carnage4Life (Score:1) Thursday November 18 1999, @06:13PM
  • This is news? by Trelane42 (Score:1) Thursday November 18 1999, @06:14PM
  • by Crouchy (7129) on Thursday November 18 1999, @06:15PM (#1520542)
    Rule of thumb here.. Write two sets of code, one with utter drivel, the other well maintained.
    One you don't shoot yourself in the foot..
    Two you have job security...

  • Nested Ternaries by Vrallis (Score:1) Thursday November 18 1999, @06:15PM
  • Variable names by blogan (Score:2) Thursday November 18 1999, @06:16PM
  • Re:Fit all code on *one* page. by mmmmbeer (Score:1) Thursday November 18 1999, @06:21PM
  • by Anonymous Coward on Thursday November 18 1999, @06:25PM (#1520546)
    as a cs student, nothing inspires me more! job security rules!

    Good evening class. I'll be your exorcizer of idealistic nonsense for the evening. Just call me Bruce.

    Now... preach all you like about how hard it'll be for the next guy, but like customizing my car or my house... I don't worry about what the next guy will think about my code. Do you care if the next owner of your car might not like it if you paint it red? Do you care if the next owner of your house disapproves of you converting the garage into a pool room? Heck no. Well, it's the same with me. I work for my own benefit, pleasure, and satisfaction. And to do that I've gotta do the best damn job I can at work. Otherwise; no money; no fun. This philosophy is reflected in my code as well. I've cranked out some godawful nasty kluges that confuse even me when I look at them a year later... but I got the job done, by the deadline, while some of the junior programmers seem to wanna rewrite everything to make it clean rather than break the nice design of the code. Feh. That's why they're junior programmers. They Just Don't Get It (tm). Their plan would send the company under. Stuff's gotta be done now and ship next week or there's no profit for the company and no salary for the programmers. Junior programmers always seem to be self-delusional with grand plans of redesigning everything. It never happens. Requirements change *ALL* *THE* *TIME*. Any static plan is doomed to fail. Once they realize this they make the transition from dreaming programmer to master hacker... or they can't keep up with the pace of real world business and disappear. You've got to be able to deal with old crusty projects written by long gone staff with more bags and bells and whistles and ornaments hanging off the side and kluged into it, written by more people you've never met, and you've got to be able to quickly and successfully hack more stuff into it and hack it and rehack it and change old stuff and keep it all running. Successful, on the fly, under the gun kluging is what distunguishes the Senior Programmers driving the big smog polluting, shitty mileage, comfy luxury cars into the front, covered parking space and getting the stock options and profit sharing and 401Ks from the idealist larval dreamers driving their small car becuase "it's good for the environment". Self-spirit-lifting-and-self justification-bull. Given the Big Bucks, you'd ditch that Civic for a gas guzzling SUV or Corvette too. So forget the dream. Getting a clean slate to build on is a rare event. 99% of all programming jobs you'll ever be hired for will be holding together someone else's code. Insane deadlines, getting the jump on the competition mid project, reamping of requirements (many times over), decision reversals by management, your latest self-gratifying achievement being abandoned and dumped because it's not needed anymore. These will all eventually break your spirits. On the plus side, once you realize this, you will be able to succeed and advance within your company or find it easy to get hired at the next comapny. because quick thinking master hackers who can do the magic again and again despite laying waste to the original vision and still keep on kluging and have it keep on working are what companies want. If you can do this, you will succeed. Getting back to the original question... do I obfuscate my code? It may certainly look that way to the idealist, but not so. True brilliance is messy. Remember the famous comment preceeding the task switching code in Unix... /* You are not expected to understand this */ But if you can, you'll be a god... or root... what's the difference again? Anyway, class dismissed.

  • Re:Open Source ugly code? by Enmity_qXp (Score:1) Thursday November 18 1999, @06:29PM
  • Re:the secret to my success by notsoanonymouscoward (Score:2) Thursday November 18 1999, @06:29PM
  • Re:Maintainable Code by Vrallis (Score:1) Thursday November 18 1999, @06:30PM
  • Re:Fit all code on *one* page. by hypatia (Score:1) Thursday November 18 1999, @06:32PM
  • Job Security! by GeorgeMcBay (Score:1) Thursday November 18 1999, @06:44PM
  • Re:Maybe you shouldn't be working for the place. by E-TiE (Score:1) Thursday November 18 1999, @06:50PM
  • Re:Maintainable Code by Rambo (Score:1) Thursday November 18 1999, @06:55PM
  • Slashdot Poll? by carleton (Score:1) Thursday November 18 1999, @06:58PM
  • Ha you should try reading... by wilkinsm (Score:1) Thursday November 18 1999, @06:59PM
  • Re:Nested Ternaries by sfbanutt (Score:1) Thursday November 18 1999, @06:59PM
  • Re:Your employer was a buffoon by CFN (Score:1) Thursday November 18 1999, @07:03PM
  • Re:54 tips? by pb (Score:1) Thursday November 18 1999, @07:06PM
  • Ack. Byline is wrong. by Rendus (Score:1) Thursday November 18 1999, @07:13PM
  • Re:Cow-orker by mmmmbeer (Score:1) Thursday November 18 1999, @07:21PM
  • Re:Variable names by tlhIngan (Score:1) Thursday November 18 1999, @07:25PM
  • LISP is the MOTHER of bad looking code by Anonymous Coward (Score:1) Thursday November 18 1999, @07:28PM
  • The Shoemaker by keytoe (Score:1) Thursday November 18 1999, @07:33PM
  • Re:Fit all code on *one* page. by F2F (Score:1) Thursday November 18 1999, @07:38PM
  • Jelloooo by sklib (Score:1) Thursday November 18 1999, @07:38PM
  • Re:Spirit Breaking 101 for Junior Porgrammers. by pedro (Score:1) Thursday November 18 1999, @07:38PM
  • Re:54 tips? by dimator (Score:1) Thursday November 18 1999, @07:52PM
  • No goto by heroine (Score:2) Thursday November 18 1999, @07:56PM
  • sloppy code can get you fired by xyster (Score:1) Thursday November 18 1999, @07:59PM
  • Re:The REASON we want good code... by Skim123 (Score:1) Thursday November 18 1999, @08:05PM
  • Of Course It Has A Spanish Version by grantdh (Score:1) Thursday November 18 1999, @08:06PM
  • Job security (Score:3)

    by phantomlord (38815) <phantoml@rocheste r . r r . com> on Thursday November 18 1999, @08:12PM (#1520581) Journal
    Remember the old motto...

    If you can't be replaced, you can't be promoted.
  • Re: dogs by h2odragon (Score:1) Thursday November 18 1999, @08:22PM
  • You're living in a dream world... by Anonymous Coward (Score:2) Thursday November 18 1999, @08:24PM
  • Re:Removing toungue from cheek... by Anonymous Coward (Score:1) Thursday November 18 1999, @08:26PM
  • Re:Open Source ugly code? by pedro (Score:1) Thursday November 18 1999, @08:26PM
  • This is largely your own fault by lars (Score:2) Thursday November 18 1999, @08:27PM
  • Re:For folks who complain about VB .... by Anonymous Coward (Score:1) Thursday November 18 1999, @08:29PM
  • Re:The Shoemaker by MattyT (Score:2) Thursday November 18 1999, @08:32PM
  • Re:You need a guide? by Anonymous Coward (Score:1) Thursday November 18 1999, @08:35PM
  • Re:For folks who complain about VB .... by Malcontent (Score:1) Thursday November 18 1999, @08:36PM
  • more programming tips from the past by deadl0ck (Score:1) Thursday November 18 1999, @08:58PM
  • Re:This is largely your own fault by pedro (Score:1) Thursday November 18 1999, @08:59PM
  • Re:For folks who complain about VB .... by Kiwi (Score:1) Thursday November 18 1999, @09:04PM
  • Even better... by Mr. Piccolo (Score:1) Thursday November 18 1999, @09:09PM
  • Don't you mean FORTRAN? by jcr (Score:1) Thursday November 18 1999, @09:12PM
  • Don't you mean FORTRAN? by jcr (Score:1) Thursday November 18 1999, @09:13PM
  • Re:LISP is the MOTHER of bad looking code by joey (Score:1) Thursday November 18 1999, @09:14PM
  • Be careful, Roedy by osguzzler (Score:1) Thursday November 18 1999, @09:20PM
  • Fortran is easy to understand, BUT . . . by Vlad_the_Inhaler (Score:1) Thursday November 18 1999, @09:25PM
  • Re:For folks who complain about VB .... by johnburton (Score:1) Thursday November 18 1999, @09:26PM
  • Re:Maybe you shouldn't be working for the place. by kijiki (Score:1) Thursday November 18 1999, @09:30PM
  • Re:For folks who complain about VB .... by johnburton (Score:1) Thursday November 18 1999, @09:30PM
  • Re:War story by kijiki (Score:1) Thursday November 18 1999, @09:39PM
  • Good for Microsoft. by Inoshiro (Score:1) Thursday November 18 1999, @09:42PM
  • It's more insidious than that... by Observer (Score:1) Thursday November 18 1999, @09:42PM
  • Re:the secret to my success by Anonymous Coward (Score:1) Thursday November 18 1999, @09:45PM
  • moderate this up by daemonchild (Score:1) Thursday November 18 1999, @09:48PM
  • Want to keep bad code good? by Gordo Toor (Score:1) Thursday November 18 1999, @09:55PM
  • Re:Fit all code on *one* page. by Anonymous Coward (Score:2) Thursday November 18 1999, @09:57PM
  • IT'S A JOKE!! by 198348726583297634 (Score:2) Thursday November 18 1999, @10:09PM
  • Re:Your employer was a buffoon by johnstonwinn (Score:1) Thursday November 18 1999, @10:15PM
  • Re:Fit all code on *one* page. by toriver (Score:1) Thursday November 18 1999, @10:21PM
  • Mirror at http://www.geocities.com by patrixx (Score:1) Thursday November 18 1999, @10:24PM
  • From a Junior Programmer by drum (Score:1) Thursday November 18 1999, @10:28PM
  • programming language and clarity by sohp (Score:2) Thursday November 18 1999, @10:28PM
  • Re:Be careful, Roedy by toriver (Score:1) Thursday November 18 1999, @10:46PM
  • Re:Even better... by Chainsaw (Score:1) Thursday November 18 1999, @10:55PM
  • Re:Job security? try fortran by Anonymous Coward (Score:1) Thursday November 18 1999, @10:57PM
  • another war story by CormacJ (Score:1) Thursday November 18 1999, @11:17PM
  • by Get Behind the Mule (61986) on Thursday November 18 1999, @11:28PM (#1520636)
    Some of my favorites, all of them true stories about code I had to maintain:
    • If your program executes one of many different unrelated functions on each run, don't use any of them steenkin' Commie pinko data structures like a dispatcher table, and for Pete's sake don't split the various functions into different source files. Put it all into one enormous if ... else if ... else if ... statement that extends across 10,000 lines. Hey, if they want to change a line of your code, they better be sure that the whole thing still compiles.
    • If you must break up functionality into subroutines, use global variables with reckless abandon!
    • Whitespace slows down your compiler or your interpreter! So cram that code into as few characters as possible! (I had a colleague who really believed this.)
    • Are you worried that upgrades to system libraries will break existing programs? No problem, just install them on some non-standard path, like in your home directory, and link them in from there. You don't need to tell your colleagues where to find them, because surely you'll get around to re-installing them in the right place Real Soon Now.
      Say you're programming CGIs in Perl using modules. Whatever you do, don't install new modules in the system-wide site library, because that could cause all kinds of trouble! Better to put them all in /cgi-bin/lib/ and use use lib '../lib'; to bind them in. But what if you have test scripts in /cgi-bin/test/? No problem, just install the same modules all over again into /cgi-bin/test/lib/ (don't be too picky about whether you're using the same module versions). And if you have mod_perl registry scripts under /perl/, then install all those suckers under /perl/lib/ and under /perl/lib/test/ all over again! So what if you end up with four different versions of the same modules, at least you didn't take any chances the system-wide installation.
  • Special characters by Tycho (Score:1) Thursday November 18 1999, @11:34PM
  • Re:From a Junior Programmer by Anonymous Coward (Score:1) Thursday November 18 1999, @11:56PM
  • Programming tips by MaxAttack (Score:1) Friday November 19 1999, @12:00AM
  • Re:Fit all code on *one* page - use OO by CryptdotX (Score:1) Friday November 19 1999, @12:05AM
  • Re:You need a guide? by Anonymous Coward (Score:1) Friday November 19 1999, @12:09AM
  • java code by rent (Score:1) Friday November 19 1999, @12:51AM
  • Re:Maybe you shouldn't be working for the place. by GC (Score:2) Friday November 19 1999, @01:03AM
  • arrays and why they are useful by Harri (Score:1) Friday November 19 1999, @01:14AM
  • There's one more by Tharsis (Score:2) Friday November 19 1999, @01:39AM
  • Or by Anonymous Coward (Score:1) Friday November 19 1999, @01:55AM
  • Stupidity from Outer Sp^H^H^H^H^H^H^H^HReal Life by Cactus (Score:1) Friday November 19 1999, @02:02AM
  • Re:yes! by uktimbo (Score:1) Friday November 19 1999, @02:16AM
  • Re:Job security? try fortran by Shimbo (Score:1) Friday November 19 1999, @02:39AM
  • This is OLD! by gabrieltss (Score:1) Friday November 19 1999, @02:45AM
  • Re:For folks who complain about VB .... by cs668 (Score:1) Friday November 19 1999, @02:55AM
  • RPG - How could I forget... by gwicks (Score:1) Friday November 19 1999, @02:56AM
  • Re:Maybe you shouldn't be working for the place. by delld (Score:1) Friday November 19 1999, @02:59AM
  • Re:LISP is the MOTHER of bad looking code by fReNeTiK (Score:1) Friday November 19 1999, @03:03AM
  • Correction for rule 27 by Gothmog (Score:1) Friday November 19 1999, @03:08AM
  • Ahh, but you forget Scott Adams by Mark F. Komarinski (Score:2) Friday November 19 1999, @03:17AM
  • Re:The REASON we want good code... by Afrosheen (Score:1) Friday November 19 1999, @03:24AM
  • thief by hawk (Score:1) Friday November 19 1999, @03:25AM
  • Re:For folks who complain about VB .... by Pfhreakaz0id (Score:1) Friday November 19 1999, @03:34AM
  • IOCCC by Captain Zion (Score:1) Friday November 19 1999, @03:34AM
  • Re:Maybe you shouldn't be working for the place. by jay_rf (Score:1) Friday November 19 1999, @03:38AM
  • bad code == bad program by jsno (Score:1) Friday November 19 1999, @03:40AM
  • Re:For folks who complain about VB .... by handorf (Score:1) Friday November 19 1999, @03:45AM
  • Maintenance Programmers [sic] by Tom Christiansen (Score:2) Friday November 19 1999, @03:49AM
  • Re:Make Code Look Like Ascii Art by wowbagger (Score:2) Friday November 19 1999, @03:53AM
  • Perl-impaired consultants by Q*bert (Score:2) Friday November 19 1999, @03:54AM
  • Some terse advice (if you don't decide to quit) by Q*bert (Score:2) Friday November 19 1999, @03:57AM
  • Re:Maybe you shouldn't be working for the place. by bornholtz (Score:1) Friday November 19 1999, @04:05AM
  • Re:The Shoemaker by HalloFlippy (Score:1) Friday November 19 1999, @04:07AM
  • Taken Way too Seriously by n1ghtstr1k3 (Score:1) Friday November 19 1999, @04:12AM
  • Re:thief by Samrobb (Score:1) Friday November 19 1999, @04:16AM
  • Maintainable Code - Oxymoron for Managers by MikeTheMad (Score:1) Friday November 19 1999, @04:24AM
  • Obfuscating without appearing to. by hey! (Score:2) Friday November 19 1999, @04:27AM
  • Re:Spirit Breaking 101 for Junior Porgrammers. by Anonymous Coward (Score:1) Friday November 19 1999, @04:35AM
  • Re:This is largely your own fault by Anonymous Coward (Score:1) Friday November 19 1999, @04:40AM
  • Re:Maybe you shouldn't be working for the place. by Kvort (Score:2) Friday November 19 1999, @04:43AM
  • Re:Spirit Breaking 101 for Junior Porgrammers. by pieguy (Score:1) Friday November 19 1999, @04:46AM
  • Re:Don't normally defend sun but.. by Pentagram (Score:1) Friday November 19 1999, @04:52AM
  • Re:Spirit Breaking 101 for Junior Porgrammers. by pieguy (Score:1) Friday November 19 1999, @04:56AM
  • Design by Hard_Code (Score:2) Friday November 19 1999, @04:59AM
  • Re:54 tips? by double_h (Score:1) Friday November 19 1999, @05:01AM
  • Re:thief by coyote-san (Score:1) Friday November 19 1999, @05:07AM
  • Re:Spirit Breaking 101 for Junior Porgrammers. by pieguy (Score:1) Friday November 19 1999, @05:10AM
  • I remember the good old days... by handorf (Score:2) Friday November 19 1999, @05:10AM
  • My first job by jabber (Score:2) Friday November 19 1999, @05:12AM
  • Re:the secret to my success by Anonymous Coward (Score:1) Friday November 19 1999, @05:13AM
  • Re:Removing toungue from cheek... by double_h (Score:1) Friday November 19 1999, @05:17AM
  • Re:The REASON we want good code... by Pentagram (Score:1) Friday November 19 1999, @05:23AM
  • Re:Variable names by ucblockhead (Score:1) Friday November 19 1999, @05:30AM
  • Re:There's one more by ucblockhead (Score:1) Friday November 19 1999, @05:34AM
  • Re:Ahh, but you forget Scott Adams by ucblockhead (Score:1) Friday November 19 1999, @05:37AM
  • Re:if else if else if else if else if else if ... by Quarnage (Score:1) Friday November 19 1999, @05:43AM
  • Re:Some more rules by ucblockhead (Score:1) Friday November 19 1999, @05:50AM
  • Good globals by ucblockhead (Score:1) Friday November 19 1999, @06:04AM
  • Re:Fit all code on *one* page. by GomerDomer (Score:1) Friday November 19 1999, @06:11AM
  • Re:Correction for rule 27 by dutky (Score:1) Friday November 19 1999, @06:31AM
  • Another important rule -- language choice by Rob Riggs (Score:1) Friday November 19 1999, @06:43AM
  • Clearest thinking I've ever seen. by DevilEye (Score:1) Friday November 19 1999, @06:51AM
  • Re:Removing toungue from cheek... by Anonymous Coward (Score:1) Friday November 19 1999, @07:10AM
  • Re:thief by hawk (Score:2) Friday November 19 1999, @07:15AM
  • Duff's device by Fjord (Score:1) Friday November 19 1999, @07:16AM
  • Re:From a Junior Programmer by ushirageri (Score:1) Friday November 19 1999, @07:34AM
  • Re:Hungarian notation by Arandir (Score:2) Friday November 19 1999, @07:57AM
  • Marklar! by fizbin (Score:1) Friday November 19 1999, @07:59AM
  • Re:Fit all code on *one* page. by mmmmbeer (Score:1) Friday November 19 1999, @08:10AM
  • Re:Job security? try fortran by CaseyB (Score:1) Friday November 19 1999, @08:37AM
  • Re:Maybe you shouldn't be working for the place. by bornholtz (Score:1) Friday November 19 1999, @09:07AM
  • Three true stories by ebh (Score:1) Friday November 19 1999, @09:29AM
  • Re:Hungarian notation by scrytch (Score:2) Friday November 19 1999, @10:03AM
  • Re:thief by Samrobb (Score:1) Friday November 19 1999, @10:20AM
  • by scrytch (9198) <chuck@myrealbox.com> on Friday November 19 1999, @10:21AM (#1520750)
    Is that you get chained to your code. The volume of documentation on my code is bigger than my code, because I can hand it to someone, say "this is all you need to know", and leave that code behind. Forever. On to bigger and better projects.
  • Widget! Gizmo! by goliard (Score:1) Friday November 19 1999, @10:32AM
  • Re:Hungarian notation by dgoodman (Score:1) Friday November 19 1999, @10:47AM
  • Items that Ada prevents by T.E.D. (Score:1) Friday November 19 1999, @10:53AM
  • Re:Spirit Breaking 101 for Junior Porgrammers. by scrytch (Score:2) Friday November 19 1999, @11:22AM
  • Wake up, it's a joke. But seriously... by somebody (Score:1) Friday November 19 1999, @11:23AM
  • Re:Fit all code on *one* page. by MotoMannequin (Score:1) Friday November 19 1999, @11:28AM
  • Re:thief by hawk (Score:2) Friday November 19 1999, @11:46AM
  • Re:Some more rules by Kenelson (Score:1) Friday November 19 1999, @11:53AM
  • Re:Hungarian notation by Raul Acevedo (Score:2) Friday November 19 1999, @12:16PM
  • Fun is always fun, no matter what the language. by kcarnold (Score:1) Friday November 19 1999, @12:23PM
  • Re:Don't normally defend sun but.. by pspeed (Score:1) Friday November 19 1999, @12:24PM
  • Re:As an architect by pspeed (Score:1) Friday November 19 1999, @12:29PM
  • Re:thief by mudslide (Score:1) Friday November 19 1999, @05:42PM
  • Re:Open Source ugly code? by pedro (Score:1) Friday November 19 1999, @06:33PM
  • Re:Open Source ugly code? by pedro (Score:1) Friday November 19 1999, @06:47PM
  • Some good points... by Evil Poot Cat (Score:1) Friday November 19 1999, @07:33PM
  • Re:Removing toungue from cheek... by Abigail-II (Score:1) Friday November 19 1999, @09:05PM
  • Re:I didn't read the whole list (i don't like horr by Abigail-II (Score:1) Friday November 19 1999, @09:09PM
  • Re:Hungarian notation by Arandir (Score:2) Friday November 19 1999, @09:22PM
  • Re:Job security? try fortran by Pig Hogger (Score:1) Friday November 19 1999, @09:29PM
  • Re:Don't normally defend sun but.. by TummyX (Score:1) Friday November 19 1999, @09:30PM
  • Re:Hungarian notation by Arandir (Score:2) Friday November 19 1999, @09:30PM
  • Re:Duff's device by Abigail-II (Score:1) Friday November 19 1999, @10:56PM
  • Re:Some more rules by Abigail-II (Score:1) Friday November 19 1999, @11:17PM
  • Re:No goto by Abigail-II (Score:1) Saturday November 20 1999, @12:40AM
  • Re:54 tips? by Abigail-II (Score:1) Saturday November 20 1999, @01:44AM
  • Re:thief by GC (Score:2) Saturday November 20 1999, @03:25AM
  • one last comment by hawk (Score:2) Saturday November 20 1999, @06:13AM
  • Re:thief by Zurk (Score:1) Saturday November 20 1999, @07:10AM
  • Re:Hungarian notation by Doctor Memory (Score:1) Saturday November 20 1999, @07:56AM
  • Re:for(int i=5; i -->0;) by Harik (Score:1) Saturday November 20 1999, @10:36AM
  • Re:Hungarian notation by Arandir (Score:1) Saturday November 20 1999, @11:18AM
  • Re:From a Junior Programmer by trog (Score:1) Saturday November 20 1999, @02:12PM
  • Re:I didn't read the whole list (i don't like horr by toast0 (Score:1) Saturday November 20 1999, @02:55PM
  • Re:Don't you mean FORTRAN? by dgph (Score:1) Sunday November 21 1999, @07:53PM
  • Re:Don't normally defend sun but.. by Pentagram (Score:1) Monday November 22 1999, @05:30AM
  • Re:Don't normally defend sun but.. by Pentagram (Score:1) Monday November 22 1999, @05:33AM
  • Re:Maybe you shouldn't be working for the place. by Kvort (Score:1) Tuesday November 23 1999, @06:01AM
  • Re:Hungarian notation by sumner (Score:1) Tuesday November 23 1999, @12:34PM
  • Re:Don't normally defend sun but.. by TummyX (Score:1) Tuesday November 23 1999, @11:08PM
  • Re:The REASON we want good code... by UnknownSoldier (Score:1) Wednesday November 24 1999, @02:48AM
  • Re:This is largely your own fault by pedro (Score:1) Wednesday November 24 1999, @07:55PM
  • 85 replies beneath your current threshold.
(1) | 2 | 3 | 4