in reply to best practice
Look for ways to make your approach as general as possible, so that the tool that you're writing will remain useful for as long as possible.
Do not try to implement all the bells and whistles in the first pass. Stick to the basics and get a prototype running, then add features slowly. Test at each step.
If this is the path you decided to follow, think a bit about the naming of the module, so that it reflects its function. Always start with h2ph. The very first thing to do after that, is to force yourself to write documentation for the module.
Writing the documentation first sets very clearly your design and functionality goal. (After all, if you code first and it works, you know you'll never write the docs anyway). This also gives you a chance to design what the interface of the module will look like.
If the docs you produce are detailed enough, you can spot problems before your test cases do, and plan on them ahead of time.
Your code must be clean and easy to read. Add comments where decisions are taken in your code. Always use strict and -w. They're your friends.
|
---|