Alternative to "Case" for C Programming

  • Thread starter Thread starter mikestampone
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around finding an alternative term to "case" in C programming, specifically seeking a word that conveys the meaning of "a set of conditions." The conversation explores various terminology options and their implications within the context of programming data types.

Discussion Character

  • Exploratory, Technical explanation, Conceptual clarification

Main Points Raised

  • One participant seeks a synonym for "case" due to its status as a reserved word in C.
  • Another participant suggests "state" as a potential alternative, relating it to the condition of a system or object.
  • A different participant indicates that "state" is already in use for another data type, proposing "instance" instead.
  • One participant critiques the term "instance," noting it typically refers to a single object rather than a set of conditions, and suggests prefixing "state" with an object qualifier as an alternative.
  • The original poster decides to replace the previously used "state" data type with "instruction," allowing "state" to be used for a set of conditions.

Areas of Agreement / Disagreement

Participants express differing opinions on the suitability of various terms, with no consensus reached on a single alternative. The discussion reflects multiple competing views on terminology.

Contextual Notes

Participants' suggestions depend on their specific use cases and existing terminology within their code, which may limit the applicability of proposed terms.

mikestampone
Messages
14
Reaction score
0
I am looking for a word that means "a set of conditions". I was going to use "case", but that is a reserved word in C. Any thoughts?
 
Technology news on Phys.org
"State", as in the "state" of a system or object?
 
Thank you, but I am using "state" for another data type already. What do you think about "instance"?
 
Instance usually refers to a single object or moment in time, a reference to a state of existence, not a reference to the condition of that state.

You could always prefix "state" with a object qualifier, such as object_xyz_state, ...
 
Ok, so I won't use instance. I think I will replace my previously name "state" data type with instruction. Because currently the instructions are nested in the "state" type, but the state can be nested within the "instruction" type. So state will be replaced by "instruction", and I can use "state" for a set of conditions. Yes, that is what I will do. Thanks for helping me with this rcgldr.
 

Similar threads

Replies
4
Views
3K
Replies
86
Views
3K
Replies
69
Views
11K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 22 ·
Replies
22
Views
5K
Replies
35
Views
8K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 102 ·
4
Replies
102
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 25 ·
Replies
25
Views
1K