SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink modified someone else's code before?

    have any of you ever been given the unfortunate task of modifying someone else's code? how was the experience? did you get frustrated with the other person's bad coding practices like terrible naming conventions, arbitrary flag variables popping up everywhere, nerver-present indentation? or did you have a smooth-flowing job reading the code and fun the code very well-structured, well-commented and all in all easy to work with?

    my one experience was terrible: terrible naming conventions, arbitrary flag variables popping up everywhere, nerver-present indentation like i said above and weird program logic as well... and i'm still working on it

    just wanted to know everybody's experiences with working with source code thrown on you by your boss who tells you to 'work on it!'

  2. #2
    Net Senior Citizen tommatthews's Avatar
    Join Date
    Apr 2001
    Location
    Sydney Australia
    Posts
    869
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's bad enough looking at your own code after you haven't touched it in 6 months!


    affordable website design

    :: sydney australia ::

  3. #3
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As a general rule programmers hate reading code, especially code that was written by someone else. In fact, the hardest practical programming skill to develop is probably the ability to quickly read and understand code! I know that I often find myself thinking I'd rather write code from scratch than read through someone elses, although having good quality code to work with does make it a lot easier. This is why coding standards (such as the PEAR one) are a good thing.

  4. #4
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was asked to add a number of features to an existing script and it was yuck! The code was so scrambled and backwards it made my head hurt. Plus, whoever wrote it used printf() everytime they outputted something

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  5. #5
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    glad to see a fellow victim you have my sympathy sean

  6. #6
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lots of comments and tabbing are always appreciated

    People find my coding logic -- erm a little differnt

  7. #7
    SitePoint Guru nagrom's Avatar
    Join Date
    Jul 2001
    Location
    Western CT, USA
    Posts
    803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i always say.....NO! NEVER!

    (did it once....ONCE!)

  8. #8
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i've been modifying and improving this guy's code (it's in Perl... mostly Perl/Tk) and i spend most of my time re-indenting the code and trying to figure out what the variables mean ($count2, $d, $mm2 ?! :P)... it's been what 4 days... i'm almost tempted to rewrite the whole thing myself...

  9. #9
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    My experience hasn't been all that bad at work. The only problem I have had as far as maintaining somebody else's work was this loop he uses rather than ASP's built in replace function. it goes something like this:

    [VBS]
    for xas = 1 to len(string)
    char = mid(string, xas, 1)
    if char = "'" then
    char = char + char
    end if
    char2 = char2 + char
    next
    [/VBS]

    confusing eh? Could have easily been done like so:

    [VBS]string = replace(string, "'", "''")[/VBS]

    and it works in one line instead of 7. And his use of variables like xx, xas, xqo...you get my point. Otherwise it was well-structured and pretty logical code once I figured those things out. However, I do NOT touch that programmer's Perl code. Uh-uh. Way to obfuscated.

    --Vinnie


Bookmarks

Posting Permissions

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