{"id":210,"date":"2005-11-21T09:37:00","date_gmt":"2005-11-21T17:37:00","guid":{"rendered":"http:\/\/www.mccambridge.org\/blog\/2005\/11\/the-unmaintainable-code-bible\/"},"modified":"2022-09-11T00:40:49","modified_gmt":"2022-09-11T00:40:49","slug":"the-unmaintainable-code-bible","status":"publish","type":"post","link":"http:\/\/www.mccambridge.org\/blog\/2005\/11\/the-unmaintainable-code-bible\/","title":{"rendered":"The Unmaintainable Code Bible"},"content":{"rendered":"

Huge thanks to Lee Vandenbusch for pointing out this website to me. For your coding pleasure, How to Write Unmaintainable Code<\/a>.<\/p>\n

Some pertinent snippets:<\/p>\n

Look Busy<\/b>
\nuse define statements to make made up functions that simply comment out their arguments, e.g.:
\n
\n #define fastcopy(x,y,z) \/*xyz*\/
\n ...
\n fastcopy(array1, array2, size); \/* does nothing *\/
\n<\/code><\/p>\n

Use Static Arrays<\/b>
\nIf a module in a library needs an array to hold an image, just define a static array. Nobody will ever have an image bigger than 512 x 512, so a fixed-size array is OK. For best precision, make it an array of doubles. Bonus effect for hiding a 2 Meg static array which causes the program to exceed the memory of the client’s machine and thrash like crazy even if they never use your routine.<\/p>\n

Foolish Consistency Is the Hobgoblin of Little Minds<\/b>
\nWhen you need a character constant, use many different formats ' '<\/code>, 32<\/code>, 0x20<\/code>, 040<\/code>. Make liberal use of the fact that 10<\/code> and 010<\/code> are not the same number in C or Java.<\/p>\n

C’s Eccentric View Of Arrays<\/b>
\nC compilers transform myArray[i]<\/code> into *(myArray + i)<\/code>, which is equivalent to *(i + myArray)<\/code> which is equivalent to i[myArray]<\/code>. Experts know to put this to good use. To really disguise things, generate the index with a function:
\n
\nint myfunc(int q, int p) { return p%q; }
\n...
\nmyfunc(6291, 8)[Array];
\n<\/code>
\nUnfortunately, these techniques can only be used in native C classes, not Java.<\/p>\n

The whole (very lengthy) website is full of similar such advice. Perhaps your views may differ, especially depending on whether you’re a programmer or not, but I found the page hilarious.<\/p>\n","protected":false},"excerpt":{"rendered":"

Huge thanks to Lee Vandenbusch for pointing out this website to me. For your coding pleasure, How to Write Unmaintainable Code. Some pertinent snippets: Look Busy use define statements to make made up functions that simply comment out their arguments, e.g.: #define fastcopy(x,y,z) \/*xyz*\/ … fastcopy(array1, array2, size); \/* does nothing *\/ Use Static Arrays […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/posts\/210"}],"collection":[{"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/comments?post=210"}],"version-history":[{"count":1,"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":1872,"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/posts\/210\/revisions\/1872"}],"wp:attachment":[{"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/media?parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/categories?post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mccambridge.org\/blog\/wp-json\/wp\/v2\/tags?post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}