By the looks of it {he thinks} he knows what he’s doing.

Unmaintainable code = job security?

I don’t know about how everyone out there deals with maintaining code that a former person in your position created, but I feel like I could scream! I am currently working in a Python script that someone who used to work in my job position wrote, and they were able to write some very unmaintainable code, IMHO.

My only guess for this type of coding is for job security. The following are some of the traits of his code:

  1. Many similar variable names such as:
    XML_page_1a
    XML_page_1b
    XML_page_5
    XML_page_5c
    sql10
    sql15
    sql21
  2. A “try” statement for each line of code
  3. Creating queries with include variables such as:
    sql13 = “INSERT INTO %s(id,name,address,zip,telephone,email,is_married,is_driver,in_office,%s,col%i)
    VALUES (%i,’%s’,'%s’,'%s’,'%s’,'%s’,%i,%i,%i)” (table,varCol,colID,id,name,address,zip,telephone,email,is_married,is_driver,in_office)
  4. Using mixed cased variables interchangeably:
    BASE
    rel_base
    source
    sourceFile
    source_file
    sourceDir
    source_dir
    proj_txt
    VPROJS
  5. Overusing an improperly scoping a temporary variable: tmp.
  6. Creating a file with 2600+ lines of code that could be wittled down to a couple hundred

To correctly copy this type of programming, you need to be highly skilled. I remember reading an article about it and I was very impressed at the detail and training it takes to do such programming. I think it may be in my best interest, and the interest of my family, to adopt these methods to continuously have a job.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a comment for: "Unmaintainable code = job security?"

You must be logged in to post a comment.