Had to do some updates to a small cgi-script written by a co-worker and I found:
- Doesn't use CGI.pm
- Has the same if-elsif-else block copy and pasted four times but with slightly different numbers
- The very redundant $shipping += 0; statement
- Uses interesting quoting repeatedly - 'We\'re'
- Has code that doesn't match the comments:
##Perform Gift Cert Calc.##
##Free GiftCert Shipping with Stanard##
$shipping += GIFTCERTSHIP * $GCcount;
- Gets the result wrong by forgetting that a line item can have a quantity
- Has a 96 line subroutine
I was going to excuse him if it was written a while back, but it's only 3 months old.
What do you do with a co-worker who seems to have no desire to improve his level of programming?
C4
Dom2 on 2003-02-28T19:58:28
Under the chair. It's the graceful thing to do.
Seriously, talk to the manager. Tell them that the code is unmaintainable. Let them know.
-Dom