Tzyj  Tzyj

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

Tzyj : John Baumgart : baumgart@chicagonet.net : 2000-10-29

Five things came to mind in your Unmaintainable Code essay:

  1. You suggested using #define begi { to make C look less like C. One place I worked for (a large defense contractor with too many imbeciles with too much time on their hands) went one step further. We had:

    #define IS_EQUAL ==
    #define LESS_THAN <
    #define LESS_EQUAL <=

    and so on — perhaps to make C look more like COBOL (not that I’ve ever touched COBOL). A simple adjustment of the header file to:

    #define LESS_THAN <=
    #define LESS_EQUAL <

    and, well, you get the picture.

  2. Among the variable names such as 'asterisk' and 'openParen', you miss the obvious. Behold:
    int seven = 5;
    When corporate coding guidelines preclude the use of single letter variables, their phonetic equivalents do nicely:

    i becomes eye
    h becomes aitch
    n becomes en
    x becomes eks or eques, empowering you to take advantage of homophones, another powerful tool.

    C++ begs for you to use something like:

    char *that;

    Insults, such as boob, moron, buffoon, and idiot also make nice variable names. A former colleague had a function called ' tzyj'. Best I could figure out, it must have been some sort of Bulgarian expletive.

  3. Where you recommend that you eschew { } around if-else blocks unless syntactically obligatory, you'll be glad to know that in C and C++ it is never obligatory. Use commas instead of semicolons, thus:
    if (eieio)
      {
         eques = seven;
         wye = six;
      }
    becomes
    if (eieio)
       eques = seven,
       wye = six;
    Both do the same thing, which is formatting your hard drive, since I overloaded the = operator.
  4. Why use 'if' at all, when you can use || instead?
    if (rot)
         splunge ();
    becomes
    (! rot || splunge ());
  5. Alarming threats in comments, such as
    /******!!!!!! COMPUTER GENERATED CODE SECTION - DO NOT MODIFY !!!!!!******/

Enjoy!


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/tzyj.html J:\mindprod\feedback\unmain\tzyj.html
logo
Please email your , letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email. If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, please quote it and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. Threatening to kill me or spouting obscenities has yet to persuade me to change my mind.
mindprod.com IP:[65.110.21.43]
viewYour face IP:[38.107.179.211]
You are visitor number 11.