New developers tend to take a problem that needs solving and start coding right away. Before commencing consider:
Are the requirements clear enough to complete the work?
Have you consulted an experienced developer about the planned approach?
Is there a design pattern documented that already solves the problem?
Is there an open source library available that will do the same thing?
Has some code already been written on the project that could be reused? Ideally reused by calling, not by cutting-and-pasting.
Is there another project in the company that does the same thing? Ask around.
In all cases avoid writing new code if you don't have to. Most generic application modules are already available as open source libraries (e.g. Apache, Spring) and are mature. It is difficult to find a reason not to use them.
“Our application accepted nine XML data feeds. The import jobs that loaded in these feeds were built using a nasty combination of Java, shell scripts and cron jobs. This solution worked well until something went wrong; error reporting was not integrated with the rest of the system.
Installation of the scripts in correct file locations was also troublesome and error prone, and the scripts ran only on particular flavors of Linux. I asked Rob to investigate moving all the scheduling logic into Java so we could integrate error reporting, avoid manual processing, keep our platform independence and more easily maintain the codebase using our existing developers.
Rob went away and coded furiously, at times late into the evenings.
One week later, a somewhat tired Rob proudly presented us with Rob's Complete Java Scheduling Solution (RCJSS) that he had engineered from the ground up. RCJSS worked well and even had its own complex and flexible configuration language. Unfortunately for Rob, he had reinvented an open source scheduling library that already existed: Quartz. If he had done a small amount of research on the web or discussed amongst his peers he would have found that most Java projects use Quartz for their scheduling and it works very well. I felt a little bad about making Rob throw RCJSS away and use Quartz. I didn't actually ask him to throw his work away - he did that himself, quietly removing it from CVS. We never spoke of it again.”