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

There seems to be three ways I could handle this.

In my case, using comments rather than subroutines or objects for my array triplet (actually, I just realized it's a quadruplet) avoids problems with variable interdependencies just as well. It also makes my code easier to follow and understand, run faster, and easier to develop (especially for me).

Yesterday, I forgot which of those arrays had been added to by a certain point in the script, and I wanted to splice those that were added to. Rather than permanently using a splicing routine that checks the length of the arrays, I used such a routine as a debugging tool only, found out which arrays had been added to by that point, then permanently added lines to splice only the arrays that would need splicing at that point. In addition to preventing having to dig deeper into the code to understand it, my unconditional splicing makes apparent which arrays had been assigned to by that point in the code, which could be useful for future maintenance.

Replies are listed 'Best First'.
If it's easier...
by mr_mischief (Monsignor) on Jan 16, 2004 at 15:17 UTC
    If it makes it easier for you, then that's a good thing. I'm having a hard time understanding how having four arrays which are closely related is better than having a hash of four arrays.

    Of course, without actually seeing an example of what your code is doing, I can only respomd in the most general of terms. I may not even be really clear on just what you do have. The way I understand things from your descriptions, though, there would be many things I would do that would make it easier for my own understanding if I were doing the coding. You and I may just think in different ways.



    Christopher E. Stith