How can the Eight Commandments of the Source Code be modernized?

How do you update this? I have never seen any current command that actually “checks” the file. I don’t compile either. It seems that they were before the branching days.

  • You should check in advance and check often. You outrage your colleagues when you check the file and insist on checking it until some future point in time is measured using variables that exist exclusively in your brain.
  • You should never check the code to build. If your code does not compile, it does not belong to the source control repository.
  • You do not have to go home in a day with checked files and you do not go on a weekend or vacation, with the files checked out.
  • You must leave a descriptive comment when checking your code. You do not need to include a name or date in a comment as this information is already being tracked.
  • You must use “Cancel Validation” if you look at the file and do not make any changes. It is unhappy with your colleagues when you check a code that has not changed from the original.
  • You should not use comments to “save” non-existent code. Do not be afraid, for the code you delete still exists in the source to control the history of the code and maybe if necessary.
  • You should use source control more than archiving code only. The source code check repository makes excellent storage for technical docs, SQL scripts and other documents and files related to the project.
  • You should religiously back up the database source code on a regular basis and keep a copy on a remote site site.

From http://scottonwriting.net/sowblog/posts/13581.aspx

+4
source share
7 answers

Continuous integration .

  • Maintain a single source repository.
  • Build automation
  • Do a build self-test.
  • Everyone commits every day
  • Each team must create a core line on the integration machine.
  • Keep the build fast
  • Clone test
  • Make it easy for anyone to get the latest executable version
  • Everyone can see what is happening.
  • Deployment Automation
+6
source

Whether you perform checks or not depends on the version control system VCS used. If you use SCCS (an old school, but part of the Single Unix specification), or if you use Atria ClearCase (from IBM Rational), then blocking checks is part of life. When using more modern systems when creating a working sandbox, you actually perform a check, but this is a non-blocking control that does not prevent others from making simultaneous changes from the same starting point.

You say that you are not compiling ... I bet your code is read by some program, and then it acts. Perl does not have a separate compiler as such, but it does have a compilation phase. Shell scripts are read and validated. Similar to Python and Ruby. A modern form of rule would say:

  • You will never check code that is unacceptable to its language processor, whether it be an interpreter or a compiler. If your code is not at least syntactically correct, it does not belong to the main branches of the version control repository (although it may belong to your private working branch).

Clause 3, that he does not leave the verified code, remains essentially valid. If you keep the code in your sandbox for extended periods of time, then you will make your own life more difficult, as you will probably have more merging to deal with other people who have been working on the same code while You were in your private branch.

All other points seem valid in Git or SVN or CVS or ... since they are under SCCS or ClearCase.

+2
source

2008 updates.

  • You must commit earlier and commit . You annoy your colleagues when you break the assembly in the main branch .
  • You should never check code that the construction bot does not accept .
  • You should not go home for a day without merging your branch with others
  • When checking the code, you should leave a descriptive comment. You should not include your name or date in the comments, as this information is already being tracked.
  • REMOVE!
  • You should not use comments to “save” invalid code. Do not be afraid, because the code you delete still exists in the history of version control code and can be extracted if necessary.
  • You should use a control source for more than archiving code only. The source control repository provides an excellent repository for technical documents, SQL scripts, and other documents and files associated with the project. You can even use source control in your OpenOffice documents with the SVN plugin
  • Religiously mirror your branch on the backup server .
+2
source

What does it mean to "upgrade"? I do not see anything related to COBOL or Ada ...

+1
source

Why do they need to upgrade? They look as relevant as on the day they were written, IMHO.

+1
source

Since most modern source code management systems allow the possibility of simultaneous checks, I can see where (3) can be relaxed, although it is still a good idea to register at night to be reinforced. TFS allows you to defer pending changes so that you can save your changes without checking them when your code breaks the assembly, but you want to register before you leave at night.

+1
source

You should not go home in a day with checked files and not go on weekends or on vacation, while the files are checked.

You must use the "Cancel purchase" option if you check the file and do not make any changes. This displeases your colleagues when you check a code that has not changed at all from the original

You should regularly back up your source code management database on a regular basis and keep a copy in a place off site.

If you need to worry about this, your SCM is full of failures. Get the best option .

The rest of them are good ideas ...

0
source

All Articles