I’ve been assigned to do some work on a huge Java project, and the influence of several iterations of developers is obvious. There is no standard coding style, formatting, naming conventions or class structure. It’s a good day when I come across a class with Javadoc, and unit testing is a happy daydream.
So far those of us on the project have been “blending in”, adapting to the existing convention of whatever class we’re working on, but the time is coming to impose some order and consistency.
It’s a daunting challenge, and I’m looking for any advice people might have on such a task. Are there any strategies that have been particularly effective, or pitfalls to look out for? Is it even a good idea to try?
Edit to add: I don’t want to give the impression that the project is bad – it is in fact solidly designed and largely well-written. It’s just feeling its age and the inevitability of maintenance…
I find Eclipse to be an incredibly powerful tool for operations such as this.
A lot of people swear by command-line tools and modal-based text editors for programming but there are strong advantages of using a full IDE for major refactoring:
In addition to Eclipse’s toolset you might look in to utilizing other modern Java tools for ensuring your code is always functioning.
edit:
I also personally prefer Eclipse because I am the one doing the refactoring, not some automated tool that knows next to nothing about my code.