Reading code and discussions pertaining to code, I often see the words "state" and "status" used interchangeably, but the following tendencies seem to exist:


When a variable holds a value intended to indicate that something is in a certain state, the name of that variable more often than not contains the word "state", or an abbreviation thereof.
However, when the return value of a function serves to indicate some such state, we tend to call that value a "status code"; and when that value is stored in a variable, this variable is commonly named "status" or something similar.


In isolation that's all fine I guess, but when the aforementioned variables are actually one and the same, a choice needs to be made involving the perverted intricacies of English language (or human language in general).

What is the prevailing coding-standard or convention when it comes to disambiguating between the two? Or should one of those two always be avoided?

This english.stackexchange question is also relevant, I suppose.

I like this question. The following is from my head but I think it fits quite well.


status is used to describe an outcome of an operation (e.g. success/fail).
state  is used to describe a stage in a process (e.g. pending/dispatched).




I also like this definition:


status is a final (resulting) state.


It is quite clear when applied to programming. Much less clear when you apply it to natural language. Let's take the examples from the english thread and see if it holds with the most upvoted answer.

"What is the current status of this project?" The answer should be "In testing."

Well, this might seem to contradict my definitions at a first look but we must realize the context. Probably some supervisor is asking his team about the project and how far they have reached. The point is that the supervisor is interested in the outcome up to now. The fact that there will be something after is just put away because it is not the point of the question.

"What is the current state of this project?" The answer should be "On hold for financial analysis."

So I think that this very nicely demonstrates an essence of a state. "On hold for financial analysis." clearly focuses on the fact that the current situation is a part of some encompassing process and even suggests the next state.

I would say it holds pretty well.
