This varies very widely by field, but also by PI preferences; in my experience, younger faculty (and newer software packages) are more likely to be open early. My experience in Chemistry has been similar to what @eykanal describes (especially when patentable methods or results are involved)...
BUT: software often contains bugs, which may change the results you get in ways that are not obvious from a paragraph description of the algorithm. In some cases, this has lead to huge, sweeping errors (like a retraction of papers cited 729 times), and some journals or funding agencies are adopting policies that encourage release of code alongside the first paper that uses it. If it's not already part of your peer review process, releasing the code early might become a requirement in the future. (It is difficult to properly review findings when they depend on subtle, unstated decisions in potentially buggy code)
So, just be sure to separate what you are expected to do from what best accomplishes your goals. Norms involving software are still evolving, and it's a good idea to evaluate your strategy based on time, resources, and expected audience.