Name of each item when comparing two things

I am thinking specifically of comparing two files using diff in linux or git (for those of you familiar with it), but this relates, I think, to any comparison.

I have two files. File 1 and File 2. File 1 is the older, original file - the one that is the base of comparison. File 2 is the 'draft' file - the one that will be compared against File 1 to assert differences, in this case additions or reductions in lines of text.

I want to compare them - how can I refer to each file?

My ideas:

File 1: comparer, original, base, original, current, active
File 2: comparee, draft, new

Is there an agreed upon naming convention for this scenario?


Solution 1:

Just about every diff (comparison) system I've used has labelled these source and target respectively.

Note that this convention does privilege the file named first -- the source -- as the canonical, "normative", reference. For example, if file1 has a line file2 lacks, then tools following this convention will say the line has been deleted (to produce the target) rather than added (because a source isn't produced).

For the sake of having a reference, the Wikipedia article on data differencing uses the terms this way, which means they will probably be clear enough to your audience without a lot of introduction.


By the way, for a little bit of fun, the two files, collectively, can be called the "comparands" (viz "operands", "summands", etc).

Solution 2:

This seems to be one of these circumstances where you have answered your own question.

I have two files. File 1 and File 2. File 1 is the older, original file - the one that is the base of comparison. File 2 is the 'draft' file - the one that will be compared against File 1 to assert differences, in this case additions or reductions in lines of text.

Original

a primary form or type from which varieties are derived.

Draft

a preliminary form of any writing, subject to revision, copying, etc.

The words you have suggested are already clear enough not to cause confusion.

Solution 3:

According to the majority of definitions of the diff command, the technical terms for the two files are the from_file and the to_file.

The important thing to note here is that the command makes no underlying assumption of relationship between the two files- so original and draft or old and new arent correct in the context of the command, but may be correct in the context of your application of it.

In the simplest case, diff compares the contents of the two files from-file and to-file.

source:about.com, unixhelp.ed.ac.uk

Indeed, simply using FileA and FileB, or File1 and File2 (etc) could suffice, unless you wish to imply an implicit relationship.