Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Efficient use of memory

by ivancho (Hermit)
on Jun 04, 2005 at 18:15 UTC ( [id://463563]=note: print w/replies, xml ) Need Help??


in reply to Re: Efficient use of memory
in thread Efficient use of memory

ummm... so he shouldn't use modules to calculate various statistics of data vectors, because that's simple, but he should use a module to split on a comma for him.. that doesn't make sense to me..

Sorry, I don't mean to be bickering - in my opinion modules are useful whenever they make even a simple but repetitive task nice and short - more so, because they reduce the chance of an error...and occasionally I do get tired of writing the same code to get mean, variance, min, etc...

Replies are listed 'Best First'.
Re^3: Efficient use of memory
by salva (Canon) on Jun 04, 2005 at 18:44 UTC
    but he should use a module to split on a comma for him..

    Parsing CSV files is not so simple as splitting on a comma, they can contain quoted data with commas inside or multiline records.

      I couldn't agree more.. Honestly, I find both Text:: modules you suggested pretty nifty, and I would gladly use them - it will certainly prevent bizarre errors if the data specs change in the future.

      my point was that it doesn't make sense to use various modules to take care of technicalities like parsing, but then refuse to use modules in the actually functional parts of the code... Using a simple module for a simple task is good, IMO - we know exactly what is happenning behind the curtains, but we're spared from having to write the details.. lazy..

        Usually I also think that if some module for the task at hand is available from CPAN it is the way to go...

        But this time I find that calculating the mean, variance and max and min values is so simple that using a module doesn't worth the trouble:

        • find the most suitable module on CPAN, sometimes really hard!
        • download and install the module
        • study its documentation
        • model your application around it
        • find bugs related to wrong module usage.
        • etc.

        Well, on my original post I was also really thinking on the modules used by the OP (Statistics::Basic::*) that were causing a lot of convolution on his code. Statistics::Descriptive::Sparse seems more appropiate and easy to use

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://463563]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found