Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Re: Perl editor idea

by demerphq (Chancellor)
on Jan 16, 2004 at 06:30 UTC ( [id://321772]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Re: Re: Perl editor idea
in thread Perl editor idea

Its not real clear to me that OO will help you here. I think for starters you should simply throw away your code and rewrite it from scratch. Without using any globals. This is a form of refactoring that as a programmer you should be comfortable with. While its a little bit agressive, and some may suggest a less drammatic form of refactoring, a total rewrite can be very beneficial and many programmers and programmer shops assume that the first version of eveything will be thrown away. The result is usually cleaner and better code.

Think of it this way: You already know what needs to be done (always an important issue) you already know at least one way to do it, and you most likely have learned important lessons in how it can be done better. In fact you certainly have, as you have already noticed that using a lot of Globals is just trouble.

So rewrite the puppy. Try not to look at the old code when you do, and certainly avoid cut and pasting from it as much as possible.

The result will be better code and many useful lessons learned.


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi


Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Perl editor idea
by Wassercrats (Initiate) on Jan 16, 2004 at 12:08 UTC
    So rewrite the puppy. Try not to look at the old code when you do, and certainly avoid cut and pasting from it as much as possible.

    YIKES!!! It's a bit more than a puppy! Have you seen the (disabled) interface? The script does this in about 2500 lines (I hate that comments get included in these counts). It works beautifully and I can handle the maintenance. It's just that I had some ideas that would make things a bit easier. Out of curiosity, I would like to see the expression on a maintenance programmer's face after he saw the code, but I'm the maintainer now, and it seems ok to me.

      YIKES!!! It's a bit more than a puppy!

      Actually 2500 lines including comments is not particularly huge. And I bet after a rewrite it drops by about half.

      It's just that I had some ideas that would make things a bit easier.

      So do a rewrite. Refactor. Clean. Reengineer. Improve. You have the skills. You have the technology. Hopfully you have the time?

      Out of curiosity, I would like to see the expression on a maintenance programmer's face after he saw the code, but I'm the maintainer now, and it seems ok to me.

      Actually given what you say I bet you wouldnt like to see the expression on his face. Especially as the thing you see right after almost certainly would be the axe he is swinging at your head. ;-)


      ---
      demerphq

        First they ignore you, then they laugh at you, then they fight you, then you win.
        -- Gandhi


        It could probably be reduced by more than half if I use some of the modules that I reinvented and put within the script, but that would be artificial reduction. Time is a factor, though I don't have a deadline. I want to see if there is a market for the kind of site mapper I'm creating (I believe there is based on my research), and I want to see the evidence in $$$. If not, I have to add the other features I have in mind, and maybe move on to something else.

        If I'm forced to just use the script as an example of my work, then I guess I'd have to show the code, and maybe I'd tidy it up.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://321772]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.