Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Keeping, and advancing in, your job

by bwelch (Curate)
on Mar 03, 2005 at 20:49 UTC ( [id://436365]=note: print w/replies, xml ) Need Help??


in reply to Re: Keeping, and advancing in, your job
in thread Keeping, and advancing in, your job

4. Quietly make a copy of the system. As part of normal maintenance work, modify this copy to use strict and be 'safe' for testing. Run perl tidy on it and add comments as needed.

Any script I receive goes through this process. For me, it's the most efficient way to adopt and start maintaining a system.

Replies are listed 'Best First'.
Re^3: Keeping, and advancing in, your job
by dragonchild (Archbishop) on Mar 03, 2005 at 21:00 UTC
    Have you ever modified a 10_000 line module to use strict? You literally have to rewrite it, and everything else that uses it, from scratch. (This can easily get into the 100's of thousands of lines of code.) There is often no other way.

    Oh - does your quiet time also include writing the test cases? Refactoring without a test suite is like getting very drunk then tightrope-walking across the Niagara falls. Not something most of us feel is safe ...

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      Sheesh. I didn't say it was easy, I only stated what works and was most efficient for me. It's easier and safer than trying to modify someone's code without comments, strict, or knowing what the changes might affect.

      Most developers here use modules and break up functionality decently even if they don't use strict. It makes sense. Break up large code into modules for easier testing, updates, and re-use. No, there's no need to rewrite it. And yes, adopting a system means using existing or writing test suites. Of course, the two printers next to my cube don't make it very quiet.

        Rewriting when you are assigned to a new script is one thing. Rewriting when you are assigned to a million-line application is another, especially if that application (like most applications) doesn't have a comprehensive test suite.

        In addition, any change, no matter how small, has a certain risk associated with it. Larger changes have larger risks. A risk has a very clear dollar figure associated with it. It may be appropriate to leave an application in a crufty state, because of the dollar figures associated with changing it and not changing it. I work on an application that has that exact situation. It's crufty, horrible, and needs a complete rewrite. Except, that rewrite is being done by another group and I just need to keep it limping along for another year. It's one of my many tasks; I might spend 20 hours a month on it. Yes, I could rewrite it in that time, but that is wasted effort becaue the benefits to rewriting it are only gained by amortization - you spend $100 now to save $50/year over 5 years. You are still in the hole for two years and if you expect to turn the application off in a year, is it still worth it to rewrite?

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      Someone wrote a 10,000 line module ? And gave you no test harness ?

      Then the first part of refactoring is to bitchslap the original developer....

      ...it is better to be approximately right than precisely wrong. - Warren Buffet

        Really? Where's your first major module? Does it have a comprehensive test suite that registers at least a 90% using Devel::Cover? Heck, I have a CPAN distribution that is close to 10,000 lines that barely breaks 60% coverage and a multi-billion dollar company uses it as a major underpinnign for a $100Million/year application.

        Remember - the first rule of code is "It has to work". Nothing more, nothing less. Anything beyond that is gravy. Code will not suddenly develop bugs, just by sitting there and being used. Software develops bugs only by developers introducing them.

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

        A reply falls below the community's threshold of quality. You may see it by logging in.
Re^3: Keeping, and advancing in, your job
by zentara (Archbishop) on Mar 04, 2005 at 11:35 UTC
    Quietly make a copy of the system.

    Yeah, and then later get charged with "felony theft", by some executives trying to cover up their "secret sale" of the scripts.


    I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-03-29 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found