There's more than one way to do things | |
PerlMonks |
Re: Developing code to be a moduleby space_monk (Chaplain) |
on May 01, 2013 at 05:42 UTC ( [id://1031497]=note: print w/replies, xml ) | Need Help?? |
I hope this doesn't sound too rude, but the way you've described reeks of having no forward planning or idea of where you want your code to get to. Code shouldn't have to be 'turned into' a module; it should have been planned to be a module or modules in the first place. Even for apparently trivial projects, you should spend some time thinking about how it breaks down into packages/objects before you start to code. You should look on CPAN, PerlMonks, StackOverflow etc to see if anything similar has been done before. With a little luck you may not have to write a line of code yourself. I think the mark of a good developer is not how many lines of code he/she produces, but how much of the problem he solves using existing solutions. Also you should have some method of verifying your code does the job it is supposed to. Look at Test Driven Design as a methodology, and Test::Simple and/or Test::More as potential packages to ensure you have Unit tests to verify your package does the job it is supposed to. Also have someone else look at the problem or code. A second pair of eyes often confirms that you are a Programming God, or points out a better way, from which you can learn. Both results are good. :-)
If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)
In Section
Seekers of Perl Wisdom
|
|