Scott on Writing

Musings on technical writing...

The Eight Commandments of Source Code Control

Feel free to print out a copy of these commandments and tape them to your coworker's monitor.

  1. You shall check in early and check in often. You anger your coworkers when you check out a file and insist on keeping it checked out until some future point in time that is measured using variables that exist solely in your brain.
  2. You shall never check in code that breaks the build. If you code does not compile, it does not belong in the source control repository.
  3. You shall not go home for the day with files checked out, nor shall you depart for the weekend or for a vacation, with files checked out.
  4. You shall leave a descriptive comment when checking in your code. You need not include your name or the date in the comment as that information is already tracked.
  5. You shall use the 'Undo Checkout' option if you check out a file and do not make any changes. It displeases your coworkers when you check in code that has not changed at all from the original.
  6. You shall not use comments to 'save' defunct code.  Fear not, for the code you delete still exists in the source control code history and can be retrieved if needed.
  7. You shall use source control for more than archiving just code. The source code control repository makes an excellent storage for technical docs, SQL scripts, and other documents and files related to the project.
  8. You shall religiously backup your source code control database on a regular basis and store a copy in an off-site location.

 

posted on Thursday, November 13, 2008 8:28 AM

Feedback

# re: The Eight Commandments of Source Code Control 11/13/2008 8:52 AM Adam

#1, #2 and #3 all conflict when dealing with certain changes, so you need a #9 and #10.

9. You will branch experimental, large, or risky changes.
10. You will merge branched changes into the trunk as early and as often as possible.

# re: The Eight Commandments of Source Code Control 11/13/2008 9:26 AM Adam

... or if branch-averse, use the TFS shelve feature.

# re: The Eight Commandments of Source Code Control 11/13/2008 12:01 PM abhinav

A couple of these are based on the concept of exclusive locking. In fact the entire idea of "check-out" is not a scalable approach. The source control should not really care or even try and track who is working on what. The only operation that matters is "check-in" when all rules should kick in.

I, like many others, have had to unlearn many habits developed because of using VSS.

I would say 3 and 5 are something that a good Source control should manage without user intervention

# re: The Eight Commandments of Source Code Control 11/14/2008 5:36 AM Esparta Palma

That's great!, can I translate to spanish and publish it into our website? (http://portalfox.com, a Visual FoxPro developer portal)

# re: The Eight Commandments of Source Code Control 11/14/2008 6:29 PM Scott Mitchell

Esparta, feel free to translate, but please provide a link back here to the original.

Thanks

# Thou shalt not ignore my source control commandments 11/17/2008 1:34 PM The Way I Think

Thou shalt not ignore my source control commandments

# re: The Eight Commandments of Source Code Control 12/10/2008 1:18 AM Aaron Seet

Thou shalt keep up with the times; avoid using VSS and a single-check-out culture.

Unless, you love duelling against opponents armed with gatling guns using a rusty musket.

# re: The Eight Commandments of Source Code Control 12/18/2008 5:15 AM Zack Jones

#11 - Thou shall include good comments when checking in your code. "Fixed Bug" doesn't cut it.

#12 - Thou shall associate your check in with a work item or something to show the reason for the change.

Title:  
Name:  
Url:
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments   

My Links

Ads Via DevMavens

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<February 2010>
SMTWTFS
31123456
78910111213
14151617181920
21222324252627
28123456
78910111213

Comment Stats

DayTotal% of Total
Sunday 2046.8%
Monday 42514.1%
Tuesday 51617.1%
Wednesday 55318.4%
Thursday 58019.2%
Friday 54718.2%
Saturday 1886.2%
Total 3013100.0%

Hour1Total% of Total
12:00 AM 772.6%
1:00 AM 812.7%
2:00 AM 682.3%
3:00 AM 822.7%
4:00 AM 692.3%
5:00 AM 1264.2%
6:00 AM 1183.9%
7:00 AM 1806.0%
8:00 AM 1926.4%
9:00 AM 1585.2%
10:00 AM 1876.2%
11:00 AM 1936.4%
12:00 PM 2016.7%
1:00 PM 1846.1%
2:00 PM 1695.6%
3:00 PM 1354.5%
4:00 PM 1153.8%
5:00 PM 1063.5%
6:00 PM 1013.4%
7:00 PM 1073.6%
8:00 PM 923.1%
9:00 PM 882.9%
10:00 PM 893.0%
11:00 PM 953.2%
Total 3013100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 4.94158
Monday 4.80384
Tuesday 4.08477
Wednesday 7.47680
Thursday 6.25675
Friday 5.02462
Saturday 4.78177
Total 5.413013

Hour1 Entry MadeAvg.Total
12:00 AM 5.2937
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 3.8550
8:00 AM 3.72134
9:00 AM 6.02295
10:00 AM 5.63276
11:00 AM 4.20193
12:00 PM 6.14350
1:00 PM 3.17133
2:00 PM 5.00230
3:00 PM 7.62320
4:00 PM 4.00108
5:00 PM 6.04169
6:00 PM 4.64116
7:00 PM 8.95188
8:00 PM 8.63164
9:00 PM 5.00115
10:00 PM 6.31101
11:00 PM 4.5732
Total 5.413013

Learn More About Comment Stats
1 - All times GMT -8...


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles