Why are imperative verbs used in computer science?

8

I came across such a question when I needed to design some diagrams, take the below diagram as an instance.

An activity diagram as an instance

As you clearly see, all verbs are imperative, I think it depends on the point of view though. I guess the commands you give to the system is considered as the point of view which it's you who gives it the commands. But since I was not sure what the right thing is to do, I mean for example could we have gerund verbs instead of imperative ones?

Devin Hudson

Posted 2016-06-26T01:10:58.640

Reputation: 387

This is an excellent question. We absolutely could use gerunds, if we assume not that we're giving an order to a computer, to-do-list style, but describing the stages or parts of a process, the Creating Order Stage or the Sending Invoice Process or the Receiving Payment Module. I suspect that the imperative voice is a historical artifact of early languages, which were generally procedural, in which instructions were, well, "commands" to the computer, e.g. "GOTO 20". It is interesting to think if, for instance, functional languages might be better described in a different grammar. – Codeswitcher – 2016-06-26T02:15:48.070

6This use of the imperative in task-flow contexts goes back a thousand years and more. A recipe for making a curative potion, say, represents an analogous task-flow (though it may lack the visuals of a chart). – Tᴚoɯɐuo – 2016-06-26T13:52:18.073

@Codeswitcher It could be, but the given example is clearly a process flow, and there are no decision blocks. A different example might have a different answer. – user3169 – 2016-06-26T16:53:45.957

1Interesting question. I'm not sure I'd say that this is the imperative form as some steps might not necessarily be commands, "receive order" for example. Perhaps this uses just the root form of the verb because is it the shortest form and has the least amount of associative baggage? For example if you use the gerund form of the verb it has a continuous feeling to it. – Leo – 2016-06-30T02:13:44.663

This verb form is also more concise. Given that the purpose of a flowchart is to facilitate thinking about the process, unnecessary clutter is undesirable (and can result in large cost differences). A flowchart is an abbreviation of sorts, a thinking tool, not the place for flowery expression. – Stew C – 2017-04-08T18:00:54.237

Answers

6

I haven't been able to find definitive information about this, but here's my current understanding. (I'm a native American English speaker, by the way, and I used to write this kind of documentation for a living.)

Infinitive

In traditional grammar, the verbs that you find in a flow chart are infinitives, not imperatives. The reason is that there is no speaker or person spoken to. In traditional grammar, the first person is the person speaking, the second person is the person being spoken to, and the third person is whatever you're talking about (which might not be a human being, but is still a "person" in this terminology). An imperative verb is in the second person: its subject is the reader, and it says "You—do this!" An infinitive verb doesn't have any "person" at all; it only names an action.

The steps in your flow chart are not commands given to the reader, nor are they commands given to a computer. They're just actions, performed by some combination of or interaction between computers and humans. For example, "Create order" probably involves a person typing as well as a computer storing data. The infinitive is ideal for expressing this kind of idea, because it doesn't take a point of view about first person and second person. The infinitive form of a verb doesn't agree in person (or number) with its subject, because it doesn't make a claim about its subject. Indeed, the infinitive form does not even need a subject. The infinitive just denotes the action abstractly—the way it appears in a flow chart.

Imperative

On the other hand, it is possible to make a flow chart or procedure description that is intended to be understood as commands: "How to repair an air conditioner: First, disconnect the power; second, remove the fan guard; third, lift out the fan; etc. These are indeed commands given by the author (first person) to the reader (second person).

The fact that you can reasonably think of these verbs in an infinitive way or in an imperative way is illustrated by how different, closely related languages handle them. In Spanish, it's customary to use the infinitive for buttons on user interfaces. In Italian, it's customary to use the imperative. See here and here for some discussion. Most languages where I've looked into this (not extensively) have favored the infinitive for abstract steps.

Some recent schools of thought might hold that the distinction between infinitive and imperative is meaningless in English, at least in flow charts, because the verbs have the same form. In any event, the "bare form" of the verb is customary here, whether you're describing actions abstractly or telling the reader what to do.

Gerund

Gerunds would be unconventional in a flow chart. Just like the infinitive, the gerund denotes a verb's meaning abstractly, without asserting it in a proposition and without agreeing in person or number with its subject. However, the -ing form of the verb, outside the context of a sentence, vaguely suggests the continuous aspect. "Creating order" suggests that something is in the process of creating an order. Consequently, it doesn't clearly suggest that the action must end before the next action begins. If you worded it that way inside a flow chart, I'm sure that most people would understand that you mean that the order should be created before the invoice is sent (that only makes sense, and Petri nets make it completely unambiguous), but using the gerund there is a little jarring. It doesn't agree with people's expectations about how verb forms normally reflect the timing of the different actions.

The gerund is more suitable for indicating that an action is not acceptable, like "No smoking" or "No parking." You could also use gerunds in a series of steps where the temporal boundaries of each action are hazy, like "What happens at the family Christmas party: 1. Saying hello. 2. Mingling. 3. Nibbling. 4. Exchanging presents. 5. Saying goodbye." In this case, because of the hazy overlaps among actions, the gerund is preferable to the infinitive.

Third Person

By the way, if you need to specify a subject in a step of a flow chart, you would have to switch to the third person: "Realtor calls inspector; inspector visits site; buyer reads inspection report; etc." Why not use an infinitive or gerund here? This is just the general murkiness of English grammar, where a small number of inflections serve a large number of grammatical roles. The reader understands a third-person step as making an assertion about its subject rather than naming an action abstractly. For this reason, third-person verbs tend to be favored in program comments and documentation: they explicitly make a claim about their subject. The first person is the author, telling the reader (second person) what the command or subroutine does (third person).

Ben Kovitz

Posted 2016-06-26T01:10:58.640

Reputation: 25 752

2

I would only use imperative verb forms. Gerunds can not indicate completion of an action, which is the need of a process step.

For example, if you used "Closing Order", then what if there is some problem while "closing"? In actuality you do not want to move to the next step until the previous process step is completed.

user3169

Posted 2016-06-26T01:10:58.640

Reputation: 29 679

Flow charts like the one above always use imperative. – Ringo – 2016-06-30T03:19:53.207