views:

44

answers:

4

Is there any deeper meaning in the fact that the word "statement" starts with the word "state", or is that just a curious coincidence? Note that english is not my native language, so the answer might be obvious to you, but not me ;)

A: 

It derives from the verb sense of "state".

Ignacio Vazquez-Abrams
+1  A: 

The English word "statement" does derive from the verb form of "state", but the programming terms "state" and "statement" aren't related to each other in any meaningful way. A statement in a programming language is merely a syntactic construct and does not imply that any state is involved.

Christopher Barber
What use would a statement without state be? I can't imagine a real world statement that does not cause state to change, otherwise it would be pointless to execute it, wouldn't it?
FredOverflow
Statements aren't necessarily "executed". Many programming languages include purely declarative statements, such as import statements in Java. These affect what symbols are visible in the compilation unit but do not necessarily cause any executable code to be generated. Now statements do affect the state of the compiler that processes them, but that is true of all syntax elements. Or consider the empty statement ";" in C/C++ which does absolutely nothing but is still considered a "statement".
Christopher Barber
A: 

Etymologically, the answer is yes, as Christopher pointed out.

However, I would argue that in programming, too, there is a connection. Statements (as opposed to expressions, which are syntactic elements which may be evaluated for their value) are syntactic elements representing imperative commands. (You may hear that in C, many statements (ex. assignment) are also expressions.)

As such, statements necessarily involve some change in the state of the program (ex x := 5), or the imposition of some control flow (ex GOTO 10). You will note that a purely functional language (say, Haskell), contains no statements, but only expressions.

Derrick Turk
A: 

The key concept of imperative programming paradigm is that programs are represented by the sequence of statements one of which change the program state.

So you change the state or you can say you actually state (declare) something with each statement. For me it seems that -ment suffix is used here in its third sense ("The means or instrument of an action"). Statements are instruments to state something in imperative program.

In universal usage it seems that -ment suffix is used in its first sense ("An action, process, or skill").

kemiisto