BTW, I'm not sure it was to increase their job security (it definitely did not work), but the indians I inherited my main project from must have read some parts this document using some time machine or something. A perfect example was eg. the two ASPs for the global and per-job-board field forms. Both those pages used variables j, k and l to count the inputboxes, pulldowns and textareas in the form. They even passed the counts to itself upon submit. The catch was that what was j on one page was k on the other, etc.

Next great thing was that they always ignored errors. Something went wrong in the stored procedure? Too bad, the data access object ignored the error and (tried to) behave as if everything worked. Something exploded within the database access object? Too bad, the ASP code never checked the return values, much less try to show or log the details. So everything looked like it was working. As long as you did not try to find the supposedly stored data later.

Consistency? Don't be silly! Some stored procs started with Get some with Fetch for no apparent reason, some of the methods of the 26 database access objects calling those procedures started with Get and some with Fetch with no relation to the verb in the procedure name.

Mispelings? I think I'll never know the proper spelling of commission ever again. Comision? Commision? Comission? Commission? They used all those versions. "The database column is JobComission? Let's name the variable Commision then!".

Speed? The Status column of the largest table in the system was a varchar with values "delivered", "notdelivered" and "deliveryfailed". And I assure you they searched through the table looking for "notdelivered" rows all the time.

There were parts of the system that I could not for the life of me understand and fix so I ended up deleting everything all the way down to database tables and started anew. ... Yeah I was lucky, they barely finished that part so it was easy to convince the application admins that it will be better to rip out the tumor, start anew and have them reimport and resetup the stuff they succeeded to force in.


In reply to Re: OT (funny) How to write unmaintainable code by Jenda
in thread OT (funny) How to write unmaintainable code by zentara

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.