|
|
ISSUES | AFRICA | WORLD | PHILOSOPHY | AFRIKAANS | LEISURE | GENERAL |
How To Write Unmaintainable CodeEnsure a job for life ;-)Roedy GreenCanadian Mind Products
|
Never ascribe to malice, that which can be explained by incompetence.
- Napoleon
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.
Quidquid latine dictum sit, altum sonatur.
- Whatever is said in Latin sounds profound.
To foil the maintenance programmer, you have to understand how he thinks. He has your giant program. He has no time to read it all, much less understand it. He wants to rapidly find the place to make his change, make it and get out and have no unexpected side effects from the change.
He views your code through a toilet paper tube. He can only see a tiny piece of your program at a time. You want to make sure he can never get at the big picture from doing that. You want to make it as hard as possible for him to find the code he is looking for. But even more important, you want to make it as awkward as possible for him to safely ignore anything.
Programmers are lulled into complacency by conventions. By every once in a while, by subtly violating convention, you force him to read every line of your code with a magnifying glass.
You might get the idea that every language feature makes code unmaintainable -- not so, only if properly misused.
Much of the skill in writing unmaintainable code is the art of naming variables and methods. They don't matter at all to the compiler. That gives you huge latitude to use them to befuddle the maintenance programmer."When I use a word," Humpty Dumpty said, in a rather scornful tone, "it means just what I choose it to mean - neither more nor less."
- Lewis Carroll -- Through the Looking Glass, Chapter 6
Seek out and use Hungarian warts that have meaning in languages other than your current language. For example insist on the PowerBuilder "l_" and "a_ " {local and argument} scoping prefixes and always use the VB-esque style of having a Hungarian wart for every control type when coding to C++. Try to stay ignorant of the fact that megs of plainly visible MFC source code does not use Hungarian warts for control types.
Always violate the Hungarian principle that the most commonly used variables should carry the least extra information around with them. Achieve this end through the techniques outlined above and by insisting that each class type have a custom wart prefix. Never allow anyone to remind you that no wart tells you that something is a class. The importance of this rule cannot be overstated if you fail to adhere to its principles the source code may become flooded with shorter variable names that have a higher vowel/consonant ratio. In the worst case scenario this can lead to a full collapse of obfuscation and the spontaneous reappearance of English Notation in code!
Flagrantly violate the Hungarian-esque concept that function parameters and other high visibility symbols must be given meaningful names, but that Hungarian type warts all by themselves make excellent temporary variable names.
Insist on carrying outright orthogonal information in your Hungarian warts. Consider this real world example "a_crszkvc30LastNameCol". It took a team of maintenance engineers nearly 3 days to figure out that this whopper variable name described a const, reference, function argument that was holding information from a database column of type Varchar[30] named "LastName" which was part of the table's primary key. When properly combined with the principle that "all variables should be public" this technique has the power to render thousands of lines of source code obsolete instantly!
Use to your advantage the principle that the human brain can only hold 7 pieces of information concurrently. For example code written to the above standard has the following properties:
Much of the skill in writing unmaintainable code is the art of camouflage, hiding things, or making things appear to be what they are not. Many depend on the fact the compiler is more capable at making fine distinctions than either the human eye or the text editor. Here are some of the best camouflaging techniques.The longer it takes for a bug to surface, the harder it is to find.
- Roedy Green
struct snafu {
unsigned cNt
char* pTr;
size_t lEn;
} A;
Variables that resemble others except for capitalization and underlines have the advantage of confounding those who like remembering names by sound or letter-spelling, rather than by exact representations.
Any fool can tell the truth, but it requires a man of some sense to know how to lie well.
- Samuel Butler (1835 - 1902)
Incorrect documentation is often worse than no documentation.Since the computer ignores comments and documentation, you can lie outrageously and do everything in your power to befuddle the poor maintenance programmer.
- Bertrand Meyer
In fact, the design doc should break the algorithm down into a hierarchy of structured steps, described in a hierarchy of auto-numbered individual paragraphs in the document. Use headings at least 5 deep. Make sure that when you are done, you have broken the structure down so completely that there are over 500 such auto-numbered paragraphs. For example, one paragraph might be(this is a real example)
1.2.4.6.3.13 - Display all impacts for activity where selected mitigations can apply (short pseudocode omitted).
then... (and this is the kicker) when you write the code, for each of these paragraphs you write a corresponding global function named:
Since the design doc is auto-numbered, it will be extremely difficult to keep it up to date with changes in the code (because the function names, of course, are static, not auto-numbered.) This isn't a problem for you because you will not try to keep the document up to date. In fact, do everything you can to destroy all traces of the document.
Those who come after you should only be able to find one or two contradictory, early drafts of the design document hidden on some dusty shelving in the back room near the dead 286 computers.
The cardinal rule of writing unmaintainable code is to specify each fact in as many places as possible and in as many ways as possible.
- Roedy Green
Sedulously eschew obfuscatory hyperverbosity and prolixity.
Consider things like page sizes, where the lines consisting of x header, y body, and z footer lines, you can apply the obfuscations independently to each of these and to their partial or total sums.
These time-honoured techniques are especially effective in a program with two unrelated arrays that just accidentally happen to both have 100 elements. If the maintenance programmer has to change the length of one of them, he will have to decipher every use of the literal 100 in the program to determine which array it applies to. He is almost sure to make at least one error, hopefully one that won't show up for years later.
There are even more fiendish variants. To lull the maintenance programmer into a false sense of security, dutifully create the named constant, but very occasionally "accidentally" use the literal 100 value instead of the named constant. Most fiendish of all, in place of the literal 100 or the correct named constant, sporadically use some other unrelated named constant that just accidentally happens to have the value 100, for now. It almost goes without saying that you should avoid any consistent naming scheme that would associate an array name with its size constant.
int myfunc(int q, int p) { return p%q; }
...
myfunc(6291, 8)[Array];
Unfortunately, these techniques can only be used in native C classes, not Java.
if(a) if(b) x=y; else x=z;
Never comment your code at the end of a line. Put it on the line above. If you're forced to comment at the end of the line, pick the longest line of code in the entire file, add 10 spaces, and left-align all end-of-line comments to that column.
Comments at the top of procedures should use templates that are at least 15
lines long and make liberal use of blank lines. Here's a handy template:
/*
/* Procedure Name:
/*
/* Original procedure name:
/*
/* Author:
/*
/* Date of creation:
/*
/* Dates of modification:
/*
/* Modification authors:
/*
/* Original file name:
/*
/* Purpose:
/*
/* Intent:
/*
/* Designation:
/*
/* Classes used:
/*
/* Constants:
/*
/* Local variables:
/*
/* Parameters:
/*
/* Date of creation:
/*
/* Purpose:
*/
Leaving bugs in your programs gives the maintenance programmer who comes along later something interesting to do. A well done bug should leave absolutely no clue as to when it was introduced or where. The laziest way to accomplish this is simply never to test your code.I don't need to test my programs. I have an error-correcting modem.
- Om I. Baud
If we have full confidence in our coding ability, then testing will be unnecessary. If we look at this logically, then any fool can recognise that testing does not even attempt to solve a technical problem, rather, this is a problem of emotional confidence. A more efficient solution to this lack of confidence issue is to eliminate testing completely and send our programmers to self-esteem courses. After all, if we choose to do testing, then we have to test every program change, but we only need to send the programmers to one course on building self-esteem. The cost benefit is as amazing as it is obvious.
Philosophy is a battle against the bewitchment of our intelligence by means of language.
- Ludwig Wittgenstein
Computer languages are gradually evolving to become more fool proof. Using state of the art languages is unmanly. Insist on using the oldest language you can get away with, octal machine language if you can (Like Hans und Frans, I am no girlie man; I am so virile I used to code by plugging gold tipped wires into a plugboard of IBM unit record equipment (punch cards), or by poking holes in paper tape with a hand punch), failing that assembler, failing that FORTRAN or COBOL, failing that C, and BASIC, failing that C++.
There are many hints sprinkled thoroughout the tips above on how to rattle maintenance programmers though frustration, and how to foil your boss's attempts to stop you from writing unmaintainable code, or even how to foment an RWAR that involves everyone on the topic of how code should be formatted in the repository.Hell is other people.
- Jean-Paul Sartre, No Exit, 1934
Programming in Basic causes brain damage.
- Edsger Wybe Dijkstra
(defun :-] (<) (= < 2))
(defun !(!)(if(and(funcall(lambda(!)(if(and '(< 0)(< ! 2))1 nil))(1+ !))
(not(null '(lambda(!)(if(< 1 !)t nil)))))1(* !(!(1- !)))))
IF lc_one
DO some_incredibly_complex_operation_that_will_neverbe_executed WITH
make_sure_to_pass_parameters
ENDIF
IF lc_two
DO some_incredibly_complex_operation_that_will_neverbe_executed WITH
make_sure_to_pass_parameters
ENDIF
PROCEDURE some_incredibly_complex_oper....
* put tons of code here that will never be executed
* why not cut and paste your main procedure!
ENDIF
If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
- Anonymous
The people who design languages are the people who write the compilers and system classes. Quite naturally they design to make their work easy and mathematically elegant. However, there are 10,000 maintenance programmers to every compiler writer. The grunt maintenance programmers have absolutely no say in the design of languages. Yet the total amount of code they write dwarfs the code in the compilers.
An example of the result of this sort of elitist thinking is the JDBC interface. It makes life easy for the JDBC implementor, but a nightmare for the maintenance programmer. It is far clumsier than the FORTRAN interface that came out with SQL three decades ago.
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.
There are some efforts in this direction NetRexx, Bali, and visual editors (e.g. IBM's Visual Age is a start) that can collapse detail irrelevant to the current purpose.
Imagine having an accountant as a client who insisted on maintaining his general ledgers using a word processor. You would do you best to persuade him that his data should be structured. He needs validation with cross field checks. You would persuade him he could do so much more with that data when stored in a database, including controlled simultaneous update.
Imagine taking on a software developer as a client. He insists on maintaining all his data (source code) with a text editor. He is not yet even exploiting the word processor's colour, type size or fonts.
Think of what might happen if we started storing source code as structured data. We could view the same source code in many alternate ways, e.g. as Java, as NextRex, as a decision table, as a flow chart, as a loop structure skeleton (with the detail stripped off), as Java with various levels of detail or comments removed, as Java with highlights on the variables and method invocations of current interest, or as Java with generated comments about argument names and/or types. We could display complex arithmetic expressions in 2D, the way TeX and mathematicians do. You could see code with additional or fewer parentheses, (depending on how comfortable you feel with the precedence rules). Parenthesis nests could use varying size and colour to help matching by eye. With changes as transparent overlay sets that you can optionally remove or apply, you could watch in real time as other programmers on your team, working in a different country, modified code in classes that you were working on too.
You could use the full colour abilities of the modern screen to give subliminal clues, e.g. by automatically assigning a portion of the spectrum to each package/class using a pastel shades as the backgrounds to any references to methods or variables of that class. You could bold face the definition of any identifier to make it stand out.
You could ask what methods/constructors will produce an object of type X? What methods will accept an object of type X as a parameter? What variables are accessible in this point in the code? By clicking on a method invocation or variable reference, you could see its definition, helping sort out which version of a given method will actually be invoked. You could ask to globally visit all references to a given method or variable, and tick them off once each was dealt with. You could do quite a bit of code writing by point and click.
Some of these ideas would not pan out. But the best way to find out which would be valuable in practice is to try them. Once we had the basic tool, we could experiment with hundreds of similar ideas to make life easier for the maintenance programmer.
I discuss this further in the SCID student project.
An early version of this article appeared in Java Developers' Journal (volume 2 issue 6). I also spoke on this topic in 1997 November at the Colorado Summit Conference. It has been gradually growing ever since.
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.
The original was published on Roedy Green's Mindproducts site.
Previous Visitor Comments |
|||
| Name | Subject | Location | |
| Carol | membership_at_abda.org | wFIrwploUOH | |
| Suhosin make my life uggly 3 days, along with some other bugs in the TomatoCart.Thank You. For me, it was enough to setup those vabierlas to 300.I’ll keep an eye on google bot and suhosin, because google bot now use url parameters and suhosin block the bot from crawling my site pages | |||
| vedradijaus | vadrudijeus_at_gmail.com | Goanonmeforma | |
| I must say, useful information for users especailly for website designers.
| |||
| Elliptical reviews | hellenusa_at_gmail.com | what the hell | |
| I suggest adding a facebook like button for the blog! | |||
| mandla | mandlaterrencentuli_at_gmail.com | programming101 | |
| most of the advert are not available for us whom did it.so give us some challenge on the enternet | |||
| max | Anonymous | RPG400 | |
| I suggest to use RPG400 progrmaing language. With its variables names limitation for 10 chars its reali easy to use bad variables names :D | |||
| Zee | Anonymous | heh | |
| i just hope i won't have to maintain the codes of someone who inspires by this.. was fun to read through tho :) | |||
| Ped | anonymous | hungarian notation extended | |
| whenever you can use simple type like "int", use "public signed long" instead and use it in hungarian notation also. Also using pointers to local heap variables leads to lot of fun later. | |||
| Fyodor Soikin | name.fa_at_gmail.com | Speaking of "source code in a structured storage" | |
| ...and all the colourfull ideas related to it. Did you check out .NET Reflector by Lutz Roeder? Please do. Will find many interesting things. ;-) | |||
| Zhenya LJ | zhenya_lj_at_hotmail.com | This is just great! | |
| Thanks a lot. I had a strong feeling you are familiar with a specific project I worked on. | |||
| Kaiser | yem19992000_at_yahoo.de | excellent work | |
| thank you very much for your job | |||
| Plusplus | Anonymous | General Comment | |
| Coooooooooooooooooooooooooool. Tnx a lot. | |||
| Manish katiyar | mkatiyar_at_gmail.com | Excellent piece of creativity | |
| This is truly hilarious and highly creative........good job. ;-) | |||
| Chandra Shekhar Tewary | chandrashekhar.tewary_at_gmail.com | Excellent piece of work | |
| Really innovative thinking and excellent piece of work..but, did u think that such a programmer's job will be in danger after first code review ?..:-) | |||
| luke | Anonymous | Variable Variables | |
| PHP offers the most ingenious way of rendering code completely uninterpretable! Enter Variable Variables: $a = "b"; $$a = "a"; this gives you 2 variables, $a, and $b, $b = "a" and $a = "b". This gives you limitless possibilities of creating ridiculous variable names that look simple but are easy to get wrong and very hard + confusing to trace! | |||
| schemesucks | Anonymous | excellent work | |
| Probably one of the best ways to keep your job, loose your mind, and annoy others. Like it vm (-: | |||
| gurusguru | Anonymous | mind blowing | |
| Do'nt be surprised if this site gets filtered out of corporate nets, and CEOs up the wall!!!! | |||
| Mihaly Bak | Anonymous | Mad/Crazy Or just joking | |
| I cant really tell with one :) I think its more madness and crazienes then a joke :) But i sure was fun to read | |||
| Mintaj Klu | klu_at_xenta.com | Lets play and jump around or somewhere | |
| Good work. Interesting posts, besides those spam... | |||
| Trooper Bob | trooperbob_at_wisdomofthejawas.co.uk | A salute... | |
| To a truly wonderful site. To add some spice to your code, try combining "Reverse Polish Notation" with "Hungarian Notation". The resulting goulash of variable names is both hearty and satisfying... Keep up the good work :) | |||
| Ich | Anonymous | Well.. | |
| Well, it will definately save some otherwise useless geeks. | |||
| reza | Anonymous | crap | |
| I dont know why you wasted so much time to wrote this crap. | |||
| Eli | eli_at_elilies.com | Wow! | |
| This is amazing! My computer science teacher is going to love my next project! Following your advice, I created useless methods, such as a method add when I just needed to add two things: add(int a, int b){ if(b == 0) return a; else if(a == 0) return b; else if(b > 0) return add(a + 1, b - 1); else return add(a - 1, b + 1); I'm thinking of making a Turing Machine in Java and using that for my next project but I think I'm too lazy. | |||
| Nic | Anonymous | marvellous | |
| also nice:
x+=(x==y);
or this one:
if(x=y | |||
| jason | ????_at_yahoo.com | neat | |
| yeah the whole thing ensures my job security | |||
| max | maxx_at_email.ro | cool ! | |
| I think is quite hard to implement those rulz. But maybe I give it a try...:)) | |||
| Nikopol | nikopol_38509.3.puls_at_dfgh.net | Fun | |
| This was really fun to read, thanks! | |||
| Dan | Anonymous | Funny - More SQL Tips | |
| Use as many functiosn and nested subqueries as you can in a single query. Build up program blocks by just doing nested inline views. I guarantee you wont be able to read it yourself weeks later. Create lots of overloaded functions with the same name, that do different things depending on the number of parameters. | |||
| Wye | Anonymous | Funny as hell | |
| I still have tears in my eyes from laughing so hard. Oh my god, this is hilarious and so true. lol | |||
| Jordan | hackr9483-no-spam_at_yahoo.com | hilarious! | |
| this essay was hilarious i cant believe that some people actually do this this essay to me was fun and a list of things not to do | |||
| goat | not_at_giving.hate.spammers | Every company has a developer like this. | |
| public Object someFunc(Object someparam, String s){ Object ZERO = new Integer(0); .... Object result = ZERO ... return result; } Consider it: always return with the same constructed object, pass a string for fun, and do not forget to ignore the return value on the caller's side (but he should store it!) I grant you to use this code as template which is not mine, but the originator won't miss it. | |||
| jlv | Anonymous | too easy | |
| void Set_a_to_5() { a=1; a=a+++++a; } | |||
| Mike | lightsaber777_at_gmail.com | Do you teach classes? | |
| I know a guy who took your class. You should be happy to know that he follows all your suggestions to the letter. Not only that, he has found a way to not only make sure he is the only one who can easily maintain the code, he has found a way to make his code spread into other systems, so he has to write something in every new system we have. You should be happy to know that the concepts you teach are being used effectively in the real world. | |||
| ALMAFUERTE | almafuerte_at_gmail.com | This is PAINFUL | |
| Extremely funny, some items are just painful to read, and sadly, true in many real life situations (some of them intentional, most of them accidental.) | |||
| Warren Brian Noronha | warren dot noronha at gmail dot come | Flashback | |
| Though I have always tried writting good code, that maintainable, I have had the misfortune to actually work with some people that actually wrote code like this. Brings back old painful memories... | |||
| Srikanth M K | mksrik_at_rediffmail.com | Maintaining the unmaintainability | |
| Now that we are looking at Service oriented companys ( who are invovled in maintaining the software now a days), it would be a competative edge for a these companies to add a new training course called "Maintaining the unmaintainability". If any CEO thinks so, please contact the author. He is an expert in that... | |||
| Nuitari | bgbeowulf_at_gmail.com | PHP obfuscation | |
| In PHP, a variable can be used to store the name of the object to create with new. eg "$var = new $object();" As this variable could be user inputted it is almost trivial to have many dummy objects that has to all follow the same methods and variables. This can be used with creative misspelling and ommiting a few methods out of a few classes for maximum effectiveness. | |||
| icelorrio | Anonymous | translations | |
| did someone translate it to other languages? maybe i will translate it to spanish, with the author's permission. really good | |||
| eddy | Anonymous | Even better when co-developing hardware | |
| We are projecting at uni at the moment. Develop and maintain hardware and software at the same time, and you see all of these methods occuring _naturally_!!!! Add more about magic numbers. Hardware engineers love magic numbers. They've never heard of variable names... :) ed. | |||
| Niki | anonymous | Camouflage II | |
| Today every sissy is using a code-coloring editor, so camouflaging code through comments doesn't work no more: Use #if 0 or if (0) without indention to comment out several pages of code - people will spend hours to find out why their breakpoints are never hit. (seen in an actual project) Also, store all global variables (I mean lots of them, free all locals!) in a global BYTE-Array, and use undebuggable macros to access the actual values. Combined with clever threading, this effectively makes debuggers completely useless. | |||
| Josef Jelinek | josef.jelinek_at_gmail.com | virtualness and overriding | |
| Just in case somebody was so lucky and has not met the following great "features" of C++ and Java to improve the unmaintainability... Java and C++ has no "override" keyword which means that if subclass misspells a method (not an abstract one) it will create a completely new method with no warnings... this causes that new class does not appears polymorphic... very tough to maintain (and/or debug), especialy, if you call both methods in the code... (In C# it is not so easy..) Much greater effects can be accomplished in C++ thanks to the "virtual" keyword... When there are mixed use of virtual and non-virtual methods in the program and some methods are made virtual at different places of the class hierarchy (and similar methods that differ in virtuality are inerited from more parents), it it really hard to tell which method definition is actually called (after some type casting, preferably). Great effects can be accomplished also by combining overriding (that is resolved in runtime in Java, and C++ for virtual methods) and overloading that is always resolved in compile time using static type argument definition. For example: define lots of public boolean equals(MyObject o) {...} and use them in your code. Cool thing is that this definition does not override but overloads the Object's equals(Object o) function, so it is ignored in java.util.* libraries and the original equals is used instead... I have noticed Sun is also collecting these interesting techniques an Sun's Java Days in "Programming Puzzles" section ;-)... | |||
| quamaretto | Anonymous | SQL aliases | |
| I use the two letter thing, unforunately. It is just plain a lot faster to type. :) Especially when there are four or five tables of 15-25 letters each. | |||
| VARADAN M | varadan_at_cpcl.co.in | General Comment | |
| Vrey Nice and Informative. Good one. Regards, Varadan . | |||
| AC | Anonymous | one additional | |
| You forgot just one C++ gem: Thanks to overloading, totally unrelated functions can have the same name. The project I got to maintain had soo much examples of using this strategy. They were also conveniently combined with the "generalize" rule you correctly mentioned: A SetData( const A a, something* b ); somehting* SetData( const something* b, A* a ); something* GetData( const A a ); etc. | |||
| Z | cybersapien_at_msn.com | Fun read, but you missed one | |
| Loved your essay, but here's one I didn't see (a real life example, in Ada-like Oracle PL/SQL): condition bool := true; . . . if (condition) then do_something; else if (!condition) then do_something_else; end if; end if; | |||
| Sandeep | sandeepjainblr_at_yahoo.com | Awesome | |
| I am really impressed with the author's creativity. I will surely be try to follow the same. | |||
| Mr.Emmanuel Kirks | pheello2004_at_webmail.co.za | Congradulations | |
| Very glad to come across people like you.Em now able to safely hide my compillation just after reading your code.Em working toward the release of my new album this year. Thanx. From Emmanuel Kirks | |||
| Craig Harris | craiglauren_at_icon.co.za | General Comment | |
| Thank you for this informative work. Our IT department is applying all your excellent research to our already questionable code. With a little help from the Saints, we'll still be releasing patches well into our eighties. You should publish. | |||
| Sergio | Anonymous | need a tool ;-) | |
| Does anybody know a software, which can take a source code at the input, process it accordingly to this article guidlines and output a great unmaintenanable code as the result ;-) ? | |||
| Fadil | itsfadil_at_yahoo.com | Amazing | |
| Although I am not a programmer myself (had this forwarded by a friend), I eally enjoyed reading about the ways programmers can easily fool clients/bosses. Do you have any tips like these for Telecom Engineers? :P | |||
| Faisal Fazal Ahmed | faisalfazal_2001_at_yahoo.com | General Comment | |
| Really really cool stuff.. greately enjoyed it | |||
| Visitor | Anonymous | will do this kinda stuff after gettin a nice job | |
| Right now i dont wanna stuck at the place I am currently working. So, might be some times letter after getting my dream place. :) | |||
| Yasir Jan | mailyasirjan_at_yahoo.com | Its for sure..unmaintainable | |
| i can guarntee it for sure too...that if i follow these steps..even i wont be able to debug my code. | |||
| Athar | Anonymous | ooooooooo | |
| I am a lecturer of computer science. C++ is my subject. Now i am thinking What should i teach about C++ after this article? As after reading this article NO student would say YES to the teacher's guidelines to make a program ... | |||
| khalid | kk_fastian_at_hotmail.com | make my life easy | |
| As an Owner of a software firm , you gave me all the techniques of code auditing and coding standards Thanks For the help. being a developer my self , dont want to be stung by my own species | |||
| Atif Mukhtar | atif.mukhtar_at_gmail.com | Confidential Document | |
| oooh man these should not be revealed, now what will my team lead will do if he has his hands on this article ;) | |||
| sploit! | Anonymous | cool! | |
| mind-boggling! | |||
| Fawad Asrar Qureshi | Anonymous | Brilliant | |
| This was a great article. By keeping interest in the material you force me to read the whole of it. and it happens to be the first incident when I have read a whole article | |||
| yfk | Anonymous | not foolish enough | |
| Where did you get all of this stuff? cool and I think you should build another humor site for some of weird and maniac around here. BTW, now I know about how to make my bug hunter get caught in his own way :D. | |||
| Ashwin | Anonymous | General Comment | |
| Great assortment of cool techniques to frighten, your project mates... | |||
| ste | stephenhiscock_at_yahoo.com | General Comment | |
| /* this is my comment { or is this my comment // hmm maybe I shoul d put cooments on diferent lines /*/** / { don't you just love it when people make comments like this/ */** /*/8 }}}} // cool site by the way | |||
| Visitor | Anonymous | I think Microsoft's developers must have been reading this | |
| Word becomes winword.exe Excel becomes excel.exe Access becomes msaccess.exe | |||
| s00p | Anonymous | use indentation, and multiple functions/typecasting to your adva | |
| this can lead to confusion, for example, the code below simply returns "muahahahahahahahaha!\r\n"
string aFunction(int a, int b, int c) {
string bFunction(char a, int b, int c) {
string cFunction(bool a, int b, int c) { string dFunction(string& b, int a, short *c) { for(; a < b.size(); a++) b += (string)(c[0]); while (c[0]) { a--; c[0] = a }; return "muahahahahahahahaha!\r\n" } | |||
| Mike | Anonymous | Fantastic | |
| Really great and useful info... shot. | |||
| Syam | ding_at_ping.com | Wonderful page | |
| Thanks for helping in buying my Job. | |||
| Stan-man | kycok_topta@yahoo.com | Good job, man! | |
| Now you've made it all public!... I see ma boss browsing your site! What 'bout my job security? | |||
| Mark | fj40rockcrawler@yahoo.com | Nice... | |
| Favorites: mixing octal/binary/hex numbers in array definitions, then having comments about how this lines up the bits and is more efficient, yet are all the exact same value. I also like to throw in history facts, like say: #define DAYOFRECKONING 0x4589786; int i = DAYOFRECKONING / 0x5555 % 0x194; Without paranthesis ofcourse, most people can't remember the presidence order enough to see if / is above % :) | |||
| fikemulo | Anonymous | Fart'! | |
| a lot of this is only applicable to a
handful of languages. the one
technique that works whenever you get
to name _anything_ is tapping the
wealth of human languages as a source
of inspriation for choosing, well,
names. in the case of esperanto this
can even be combined with the
significant embarassing stuff
technique: just recall that "fart'"
means "ill-or-well-being" and so is
highly appropriate for anything
that can be ok or b0rken.
btw, if klingon and hobbitese have
their links,
| |||
| zanele | zlnkwanyana@yahoo.com | theories of recreation and leisure | |
| no comment | |||
| TriniT | n0ir_@hotmail.com | love it | |
| Just what I needed to read before telling my big moron client to go F*** himself. Now I gotta go make some code changes.... | |||
| John Smith | jsmith@penetrode.com | Angry Programmer! | |
| Great stuff here! As a C++ coder, I've learned something I consider very valuable. This could really help stem the tide of outsourcing maintenance programming to India! :) | |||
| ana | ghj@juy.com | jioklt | |
| please speak farsi.i dont | |||
| Michael Bolton | mbolt@initech.com | Holy Taco. | |
| I need to give this to someone saying it'll teach them C#. Then we'll see who's hacking the planet! Good stuff, mate. | |||
| Tim | Anonymous | Impressed | |
| wow. This is not only extremly helpful for a paper I'm writting, but its also extremely funny. Great work | |||
| Coyote | foolishcoyotedreams@yahoo.com | Howling my head off | |
| Oh dear. When I finish snorting coffee out of my nose, go change my undies, and can finally breathe without chortling, I'll send this web address out to my friends. . .
There are far, far too many times where I've had these things happen to me and, | |||
| Previous Article | General Motors & Microsoft: Development comparison |
| Next Article | Pizza Inversion - a Pattern for Efficiency |
| HOME | Top | Back | E-Mail Page | E-Mail us | Guestbook | |