Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Re: Perl editor idea

by Wassercrats (Initiate)
on Jan 14, 2004 at 17:01 UTC ( [id://321392]=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: Perl editor idea
in thread Perl editor idea

Thanks for making your first writeup a reply to my post! Objects were a whole other level of Perl that I was nowhere near ready for when I began my script. I've read a little more about OO programming recently, and I still don't want to take the time to learn it right now, but it's true that I had no idea what my script was going to become when I started it. I don't doubt that it would be better written using objects though.

Some day, I'll improve my skills enough so I could do things more conventionally, and so I would have more tools at my disposal. I think I could contribute more to the Perl community that way too. One of the reasons I'd be reluctant to release a subroutine of my script as a Perl module is that it would probably be pounced upon and improved beyond recognition and beyond my ability to work with it any longer, and I wouldn't want to lose my first baby.

I just downloaded Eclipse and was going to try the EPIC editor plug-in, then I was told about Emacs in this thread and was going to try that, and now I see there are even more editors I could try (I'm on Windows XP). I'm not sure what I'm going to do.

Replies are listed 'Best First'.
Re: Re: Re: Re: Perl editor idea
by demerphq (Chancellor) on Jan 16, 2004 at 06:30 UTC

    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


      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


Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://321392]
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.