Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 90299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:51:06+00:00 2026-05-10T22:51:06+00:00

Background In a C# command-line app I’m writing, several of the parameters have yes

  • 0

Background

In a C# command-line app I’m writing, several of the parameters have ‘yes’ and ‘no’ as the possible values.

I am storing their input using the Enum type shown below.

enum YesNo {      Yes,      No } 

Which is fine – the code works. No problem there.

NOTE: Yes, I could store these as bool (that’s how it used to work). My design choice is to be explicit about the Yes/No choice made by the user because they will see this printed in other contexts and I’d like it to be more obvious what the choice was.

My Question

  • It just seems odd to have an enum called ‘YesNo’ – what are some suggestions for better names for an enum for ‘yes’ and ‘no’ values.

So Finally

I asked this question relatively early in StackOverflow’s life. It wasn’t fake question – I really did have this situation. I just thought it would be nice to use it see what the community would do. Because it is, I admit a somewhat odd question.

First, thanks to all who spent the time replying. I’m trying to pay that back with a thoughtful conclusion.

Comments on the answers

switching to bool. I understand your motivation, but I feel I need to point out that having a binary choice (and by that I mean a choice between any two values – alive/dead, married/unmarried, etc.) is not the same as boolean choice between true and false. We find as programmers switching between yes/no and true/false easy – fair enough. Had my choice in this case been for example ‘Democrat’ or ‘Replication” (contrived example, I know) then you can see possibilities for confusion or at least awkwardness. I do think the bool option is valid in this case, but less so in other binary choices.

localization – great point. In my specific case it didn’t matter – this was not and is never going to be localized, but for other situations it is something to consider.

more than three options – In fact, later on I had to add a third value called to represent the valid (in my application) condition of a user specifically not making the choice.

There were a lot of good comments, thank you all!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:51:06+00:00Added an answer on May 10, 2026 at 10:51 pm

    I’d suggest you use a name that indicates the Value which is set to Yes or No.

    E.G.

     public enum Married {     YES,     NO } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to call several (> 10) .exe command line programs in the background.
When I run several background processes my output of the command jobs is for
This is actually 2 questions... Background: After using the command line in MySQL for
I have a command line server for which I want to create a wrapper
I'm trying to use C# to control a command line application background, which can
I'm using start cmd.exe /c to start new command line processes in the background.
I have a command-line application called xooky_nabox that was programmed using c++. It reads
Background: I have a winforms app written in C# that converts xlsx files to
I have an operation in my Heroku-hosted Rails app that runs in a background
Background I am automating some Office application (Word and PowerPoint) via command-line tool. One

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.