Forgive my 'newness' but I noticed a tendency to go with a module even if it isn't "core" than it is to go without. I noticed this thread, for example. Both examples are 2 lines. Yet solution that uses a module had (at the time I last checked) more votes than the core solution that didn't use a module at all. Is it really that much easier to read the 2nd solution?
This got me to thinking. So why are we pushing the use of modules so much? And when is it better to go with core instead of downloading a module? When does requiring a module for your solution begin to make sense over a solution that doesn't require a module? Under what criteria should the use of a module be suggested? (emphasis added at update).
In general, I try to stay clear of solutions that require a module that the user isn't likely to have by default, even at the expense of some possibly more elegant solution. What do you all think?
UPDATE:
I think too many people hear are interpreting what I've said as "It's better to not use modules." That isn't what I'm talking about. I'm talking more about "by what criteria do you decide to go searching for a module?" There is a big difference. Let me add a few things as well:
1: In corp America it can be non-trivial to have modules added to servers for production deployment.
2: If there IS a bug in a module, vs a bug in code I've written, it's almost always easier for me to debug my own code. I think that's a general truism. It's always easier to debug one's own code than someone else's.
3: I heart CPAN, so there is no need to sell me on it. I gave up writing my own XML reader 6 years ago. I wouldn't want to go back to doing things like that again.
I guess my brain won't accept a blind statement that everytime I'm coding in perl I should be scanning CPAN to see if something has already been done. There has to be some general guideline to follow to best know when to hit the CPAN archive.
In reply to Module Bloat and the Best Solution by KurtSchwind
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |