HomePractices Page 5 - The Art Of Software Development (part 3): Coding To A Plan
An Elephant's Memory - Practices
With the design out of the way, it's time to finally sit downand write some code. This article discusses the implementation phase ofthe software cycle, outlining some ideas and techniques that should helpyou deliver cleaner, faster and more maintainable code. Miss it at yourperil!
For large projects that involve multiple developers; small- to medium-size applications that are updated on a frequent basis; or software products that go through a regular upgrade cycle, version control is a critical issue, and one which, if ignored, can cause significant problems over the long term.
A version control system is a very powerful tool in the arsenal of any developer or software programmer. It is a system which allows you to keep track of the software code you write, to maintain it in a logical manner, and to easily backtrack to previous versions or releases of the software. By storing your code in version control software, you can easily mark specific points in development, log changes made over time, and extract a snapshot of a specific file as it looked six or eight months in the past.
In addition to keeping track of different software versions, version control software also helps to manage large, distributed software development projects (common to many open-source projects), in which developers located in different geographical locations collaborate to build a piece of software. In such situations, keeping track of changes made by individual developers to the overall body of code is almost impossible, and version control software provides an elegant solution to the problem by allowing each developer to work on copies of the original source and then merging the changes into the main code tree. Finally, most version controls systems also support "code branches", which are essentially offshoots of the main code tree, usually initiated to fix bugs in older versions of the code.
During the implementation phase of your software project, it's important that you commit your work to a version control system on a regular basis, so that your changes are logged and can be reversed in the event of a problem. Saving your code in a version control system also makes it possible, over the long term, to retrieve earlier versions of the code in case your customer detects problems in a later release and needs to be downgraded while you fix the problem and issue a new release, and also serves to provide a history of the progress of the project.
Most version control systems also ask you to write a brief description of the changes made to the source tree every time you commit code to the system. Many programmers find this to be a tedious task and don't bother entering this information...and this oversight can come back to bite them if they ever need to find out what changed between two versions of a piece of code. Make it a point to have your development team clearly and consistently identify every change to the source tree, and enforce this rule strictly.
Since your source code repository is pretty important, you should make sure that it's backed up periodically, and that backups are stored in a safe location. Make sure that your development team leads and project managers know how to restore data from the backup, and verify, via at least one dummy run, that the process actually works and delivers the desired results. Finally, make sure that as additional project assets are developed - documents, schedules, bug reports et al - they are also archived on a regular basis, so that you can refer to them at any time in the future.
That said, it should be noted that version control software is merely a mechanism to manage different versions of your code. It does not help you write better code, provide you with deep and meaningful insights on software architecture, or assist you in building you a better thingamajig. Think of it as an elephant, one with a long memory - if you're a good coder, it'll help you reminisce about the bee-yoo-tiful software you wrote in your younger days... and if you're a bad one, it'll make it hard for you to forget your mistakes.