Is hard-coding literals ever acceptable?
问题 The code base I'm currently working on is littered with hard-coded values. I view all hard coded values as a code smell and I try to eliminate them where possible...however there are some cases that I am unsure about. Here are two examples that I can think of that make me wonder what the best practice is: 1. MyTextBox.Text = someCondition ? "Yes" : "No" 2. double myPercentage = myValue / 100; In the first case, is the best thing to do to create a class that allows me to do MyHelper.Yes and