Alternative to "Case" for C Programming

  • Thread starter Thread starter mikestampone
  • Start date Start date
AI Thread Summary
The discussion revolves around finding a suitable term to describe "a set of conditions" in programming. The user initially considered using "case," but noted it is a reserved word in C. They explored alternatives like "state" but found it unsuitable since it was already assigned to another data type. The term "instance" was also deemed inappropriate, as it typically refers to a single object rather than a set of conditions. Ultimately, the user decided to replace their existing "state" data type with "instruction," allowing them to use "state" to represent a set of conditions effectively. The conversation highlights the importance of naming conventions in programming to avoid conflicts and enhance clarity.
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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top