From: Simon W. <es...@ou...> - 2003-02-19 14:26:47
|
On Wed, 2003-02-19 at 14:12, Wizard wrote: > > > > Me too. Splitting a string into a list of values has nothing to do > > with the fact that the string came from a file. > > I must admit I'm more concerned that this is something likely to break, and > when it does, you have to go searching from module to module to module to > see what's going on. That I don't like. If it's staring you right in the > face at first glance, you'll know where you broke it. > > I'll add caller context to get() (wantarray), but I REALLY don't like using > it for this application. I think it confuses problem resolution for an > aspect that I see as potentially problematic in the first place. I'll put it > in, but I definitely don't think it's a good idea. I can't tell you how many > times I've had to chase errors through hierarchies of modules, only to find > it was something simple. Conversely, I can't tell you the number of times that I've had to chase through duplicated code because one splits on ", " and one on /,\s+/. Putting the code in modules allows us to write tests so that we know that it returns what it is supposed to. One of our objectives is to show best practice in perl programming so I think it would be wise to ensure we have no code duplication and proper tests. As always though, this is my opinion and it's your project ! Simon. |