My company develop web apps using combination of mod_perl, axkit and apache. We have tons of Perl modules, javascripts, etc, all in unix operating system.
Whenever I need to write a new function, I try to do some code reuse, but the thing is all the Perl modules and javascripts are scattered across folders.
i hate to write some code only later to discover that there's already a function which done the same thing, my current method involves trying to grep for the table name to see if there's a redundant function, but besides that, i'm pretty much will just give up and write a new function because i don't want to spend too much time searching and finding nothing.
Is there a better way to do this? Or even better, are there freeware tools that I can install which can help me properly manage all the functions and modules, and even allow developers to log comments, etc.
There is this discussion on detecting code duplication on c++ using tools, do we have anything like this for perl codes in unix platform?
thanks ~steve
Organize your source directory so that each functionality has only one place where it should be and it's easy to find something.
Make sure to share naming convention to prevent duplication.
Design your module so that they do one thing only - and do it well.
Review the code to make sure names and locations are correct.
Provide a efficient search engine based on a code indexer so that it's easy to look if there is already a function doing a peculiar task.
Don't underestimate the time to generalize an existing component so that it can effectively be reused.
Document the modules, with API documentation an/or unit-tests.
Communicate within the Team so that every one has a good grasp of what has possibly been already written, who has or knows who may have working on/used a module.