Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Dealing with sloppy code

by dragonchild (Archbishop)
on Nov 17, 2005 at 19:29 UTC ( [id://509532]=note: print w/replies, xml ) Need Help??


in reply to Dealing with sloppy code

  • Make sure this stuff is in a source-code repository. I recommend Subversion, but anything is better than nothing. If your team refuses, you can run subversion in a single-user mode under your home directory.
  • The very next step is to write tests that verify what the code is supposed to do. If, as is likely, you cannot get a written spec, write tests against what it does right now.
  • Run your testsuite under Devel::Cover, to make sure you got it all. 95% and higher is good.
  • Refactor one tiny piece at a time, making sure the testsuite passes every time, verifying that the coverage is always at least as good as before, then check it in.

As for your coworkers ... my experience is that people code in the style they're handed. If you clean things up a bit, then people will continue the trend. It's when there's a broken window that people stop caring. Fix the broken windows and you'll be better off.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509532]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 20:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found