Chapter 4. Source Code Management

for RuBoard

I'm not a great programmer, I'm just a good programmer with great habits.

Kent Beck [1]

[1] Fowler, Martin. Refactoring:Improving the Design of Existing Code . Reading, MA:Addison-Wesley, 1999. Page 57.

I've placed this chapter as early as I have in the book because I think it's crucial to adopt good source code management habits if you're going to develop robust code for complex projects. Successfully building a sophisticated system with faulty code management practices in place is about as likely as building a space ship in a junkyard: Although it's theoretically possible, it's not very likely (Andy Griffith's Salvage I notwithstanding).

There's a tendency among Transact -SQL developers, especially inexperienced ones, to treat Transact-SQL code as though it's not "real" source code. They don't edit it with a decent editor. They're content to work eight hours a day in a tool that's more suited to editing batch files than program code. They don't comment their code or follow any of the standard conventions you might see with other types of programming languages. And they don't "version control" their code. They don't use source code management tools such as VSS, PVCS, or Source Integrity (Vertical Sky Software Manager) to manage their Transact-SQL source code.

Instead, stored procedure code is viewed as more of a database resource than program code, and is therefore managed in the atomic, transactional manner that other types of database objects normally are. From this perspective, Transact-SQL procedural code is just data. After all, it resides in the database in a table named syscomments, and it is protected from corruption via backups just like other data. So the thinking goes.

The purpose of this chapter is to refute the myth that Transact-SQL code is not "real" source code and to establish the value of source code management (a.k.a. version control) software in working with it. Although you could use virtually any text file-based version control or source code management system to control your code, this chapter covers VSS because it's the one I use.

for RuBoard


The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
ISBN: 201700468
EAN: N/A
Year: 2005
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net