Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

RE: Code Maintenance

by Odud (Pilgrim)
on Aug 04, 2000 at 17:07 UTC ( [id://26180]=note: print w/replies, xml ) Need Help??


in reply to Code Maintenance

You could almost replace Perl by "any language of your choice" and the above meditation would still be valid. In my view Perl is still youthful enough to suffer from 'flavour of the month' syndrome. Inexperienced coders use Perl to produce badly written (through no fault of their own) code, skilled coders in other languages write Perl code but so heavily flavoured by their 'native' language that it is difficult to understand/maintain.

Perhaps what you should do is:
a) rewrite where possible and practicable
b) or comment and correct if not
c) or if none of the above apply then post warning notices and retire a safe distance

The best legacy you can leave for those that follow you is your own code that is clear/succinct/understandable... Don't worry too much about the mess that you inherit - it wasn't your fault and it probably isn't your job to sort it out - just make sure that you don't add to it or make it worse. Odud

Replies are listed 'Best First'.
RE: RE: Code Maintenance
by agoth (Chaplain) on Aug 04, 2000 at 17:12 UTC
    I admit my first effort in Perl would probably give me a fit if I went back and had to maintain it and I agree with your comments on the whole but:

    'Dont worry about the mess you inherit, ... it probably isnt your job to sort out'

    If only, this time it is my job and theres no one to pass that buck to ... :-)

      I found this book useful. Refactoring : Improving the Design of Existing Code
      But the problem is it's OOP oriented with examples in java.
      Anybody have a good book they can recommend for redesigning existing code in a non-OOP/non-OOP->OOP world?
      But it does contain some ways of identifying what exactly in the code feels wrong.
      Bad code smells funny, but sometimes it's harder to isolate what makes it that way.
      I used this to make my college group projects go easier.
        I would recommend Code Complete for basic coding style, variable names, etc.

        It is the little things that I found incredibly useful. Like the advice to make the names of flags be yes/no questions so you don't forget whether it is supposed to be true or false.

      ',this time it is my job' in which case best of luck - but at least you have a clear definition of what you have to do and hopefully you have agreed the resources and timescales before starting...

Log In?
Username:
Password:

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

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

    No recent polls found