Results 1 to 5 of 5

Thread: How To Write Unmaintainable Code

  1. #1
    Member
    Join Date
    Jun 2009
    Location
    Kraków, Poland
    Posts
    1,471
    Thanks
    26
    Thanked 120 Times in 94 Posts

    How To Write Unmaintainable Code


  2. #2
    Member biject.bwts's Avatar
    Join Date
    Jun 2008
    Location
    texas
    Posts
    449
    Thanks
    23
    Thanked 14 Times in 10 Posts
    People use to say when I write even for clarity its umnaintainable look at code for arb255.zip My standard bijective 256 symbol arithmetic coder.

  3. #3
    Member
    Join Date
    Jun 2009
    Location
    Kraków, Poland
    Posts
    1,471
    Thanks
    26
    Thanked 120 Times in 94 Posts
    Well, there are plenty of variable names which don't contain valid words in your code, eg: a, b, c, f1, f2, f3, etc. That fact alone makes it hard to follow. But, OTOH, it's pretty standard for codes that deal with lots of arithmetics. It's not good, however.

  4. #4
    Member biject.bwts's Avatar
    Join Date
    Jun 2008
    Location
    texas
    Posts
    449
    Thanks
    23
    Thanked 14 Times in 10 Posts
    to be honest its far easier for my to follow the code with short letters. I don't trust long names in code. I feel there are trying to mislead with long names. I use to find and fix lots of mistakes in other peoples code that used long names and people could not fix it or find the problem since the long names confused them. I can't remember the name of the editor I used it was an old one not vi. But I would take the code and search and replace all occurrences of the long names with short 1 or 2 letter names so I could get a big picture of what was going on. People were glad it was fixed but then they wanted long names back. I was able to indefinitely delay that they had to do that themselves.

    But I do like programs like indent to arrange the code for seeing.

  5. #5
    Member
    Join Date
    Feb 2013
    Location
    San Diego
    Posts
    1,057
    Thanks
    54
    Thanked 71 Times in 55 Posts
    Quote Originally Posted by biject.bwts View Post
    to be honest its far easier for my to follow the code with short letters. I don't trust long names in code. I feel there are trying to mislead with long names. I use to find and fix lots of mistakes in other peoples code that used long names and people could not fix it or find the problem since the long names confused them. I can't remember the name of the editor I used it was an old one not vi. But I would take the code and search and replace all occurrences of the long names with short 1 or 2 letter names so I could get a big picture of what was going on. People were glad it was fixed but then they wanted long names back. I was able to indefinitely delay that they had to do that themselves.

    But I do like programs like indent to arrange the code for seeing.
    When working on a tight, intricate block of code, I find myself deleting comments and shortening names to see the logic flow better. Once you've been working on and staring at something complicated for long enough, you'll have the variables memorized and the value of long names goes away. The priority then is to see what's happening to the variables, not to be reminded of their original purposes.

    I think, though, that it may be worth adding back good names and comments after you've finished working on the logic. Just because you've imported the whole thing into your brain doesn't mean that it is self-evident to everybody, and you may be glad someday if you revisit it.

Similar Threads

  1. Replies: 2
    Last Post: 29th July 2014, 22:01
  2. Arithmetic coding broken in IJG-code
    By thorfdbg in forum Data Compression
    Replies: 1
    Last Post: 10th September 2012, 21:22
  3. Tidiest free-standing AC/RC code
    By willvarfar in forum Data Compression
    Replies: 16
    Last Post: 17th October 2011, 02:53
  4. Huffman code generator
    By Shelwien in forum Data Compression
    Replies: 2
    Last Post: 24th May 2011, 02:50
  5. Code Optimisation
    By Cyan in forum Data Compression
    Replies: 18
    Last Post: 18th January 2010, 01:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •