in reply to
Re: Perl editor idea
in thread Perl editor idea
Why not make it figure out which variable is defined where, and take you there when you click on the variable itself?
I thought of that, but I don't want to have people writing scripts that are only understandable when viewed by a special editor. My way, with comments for each instance of a variable, you'll never miss them. But if I added your feature, I'd probably have the variables for which there are global comments be a certain color, so maintainers wouldn't be clicking every variable, hunting for an explanation that isn't there.
The three arrays don't always have to be changed simultaneously, but they have to be kept the same length. If I add to one and decide I don't need the element, I only have to cut from one. If I used a tiny subroutine for that, it would have to compare lengths to see which arrays need to be spliced and if they're the same length, truncate all of them, else I'd have to pass the subroutine the arrays to truncate. Either way, it would take about as much code and be clearer if I duplicate the specific cut routine I need wherever I need it. Comments before each subroutine call would be a good idea too, so I wouldn't be eliminating any comments.