Comment Malice  Comment Malice

go to home page feedback about the unmaintainable code essay full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish ©2000-2009 Roedy Green, Canadian Mind Products

Here is an email I received in response to my essay on how to write unmaintainable code.

Comment Malice : Stephen Griswold : griswold@csee.wvu.edu : 2000-09-26

loved that essay — some of those tricks are downright cruel.

I have a couple suggestions for messing with those use code beautifiers (in spite of attempts to ban them. ;) )

in the version we have at wvu there are some bugs that drive me crazy. (gnu emacs 19.34.1 (sparc-sun-solaris2.5, motif) of thu may 15 1997 on stat copyright (c) 1996 free software foundation, inc.)

  1. special characters in the single line comments (the double backslash //) are not ignored by the beautifier, so if you liberally sprinkle in braces and parentheses in lines or partial lines with // comments, the beautifier will be all over the place (emoticons could even be used to deflect initial attention ;) )

    I've learned to avoid //comments and instead use /*comments*/

  2. in ada and some of the other languages, it does a better job ignoring comments, but you can still mix in checks for the actual character. such as:
    OpenParen := (Char = '(');

    i've learned to get around that by mixing in complementary boolean expressions such as:
    OpenParen := ( (Char = '(') or ('1' = ')') );
    in a second semester Ada class, i was helping someone store an expression in a tree, and the above was the only way i could get the emacs beautifier to work correctly - of course for those who don’t use beautifiers would be rather dumbfounded as to why you would add an always false expression to an or statement :P It even could be used as a way to ban beautifiers ;)

I'm sure with experimentation, all sorts of other interesting bugs can be found in the beautifiers that can be exploited towards that goal of unmaintainable code :)
CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/feedback/unmain/commentmalice.html J:\mindprod\feedback\unmain\commentmalice.html
CMP logofeedback Please email your feedback for publication, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email
mindprod.com IP:[65.110.21.43]
viewYour face IP:[38.107.191.101]
You are visitor number 11.