in reply to Re: On Foreach Loops and Maintainability
in thread On Foreach Loops and Maintainability
I too have a little problem with the names. Those ascending numbers lead me to conclude that the problem domain is being poorly mapped into Perl. merlyn says that you should capture regularities in code. Yes indeed, but that still doesn't validate this map { "arg$_" } approach as being a good one. A completely different approach is required. Which is why I like ignatz's idea.
Can someone post references to the thread(s) that rob_au is talking about? I seem to have missed them, and I'm not sure if I'm taking the example too literally.
One thing that I can see in favour of rob_au's initial approach is that it allows you grep the source code to find out where arg4 is used. Never underestimate the power of static analysis. If you're creating those names on the fly then you don't have that luxury.
If the project is big enough, then it may even be worth going as far as pulling those names out of the source code and storing them in a data file. That gives you a different degree of flexibility and control. You can write a Makefile to ensure that you can run a program against the data file to make sure it is stays coherent.
|
|---|