'input-file' and 'output-file' vs. 'source-file' and 'target-file' as generic names

When documenting command-line things, it is often necessary to use generic names.

Sometimes I use input and output words, and they play nice:

# example 1
pandoc input_file.md -o output_file.htm

But sometimes they don’t play nice, and I use source and target instead:

# example 2
mv source_file.txt target_folder/

I have two questions here.

The first question is whether it is fine (from the side of English language, which is a foreign one for me, logic, etc.) to use source and target pair only? Is it correct to say that this pair of words is more versatile then input and output?

The second question is whether it is fine to use target when we don’t use source? For example:

# example 3. ImageMagick will copy all the .jpg and .png files
# to target_folder, and then trim them there
magick mogrify -path target_folder/ -trim +repage *.(jpg|png)
Asked By: jsx97

||

The first question is whether it is fine (from the side of English language, which is a foreign one for me, logic, etc.) to use source and target pair only?

Only if you’re really describing that something moves from the source (like water from a water source) to somewhere else.

(This works with locations, like with mv, but it also works with "source formats" and "target formats", like with, say pandoc. The thing is that you take something, and bring it somewhere else.)

Is it correct to say that this pair of words is more versatile then input and output?

No. A program might take input and produce output without any notion of moving something from a source to a target. For example, the bc calculator can take input and generates output. It doesn’t translates anything from a source to a target.

The second question is whether it is fine to use target when we don’t use source?

yes.

Answered By: Marcus Müller
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.