What should I call a variable that is used for indentation?

private string _indentString = "\t"; // can be set to "   " or "\t\t", etc.

Is the purpose of the variable clear from the name?


closed as primarily opinion-based by BCdotWEB, t3chb0t, Heslacher, Peilonrayz, Mast Jan 30 '17 at 16:08

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ _amountOfIndent? \$\endgroup\$ – Mast Jan 30 '17 at 15:55
  • \$\begingroup\$ Is this a silly question? Is that why I'm being downvoted? \$\endgroup\$ – pushkin Jan 30 '17 at 15:55
  • 3
    \$\begingroup\$ Unfortunately an answer to this question is primarily opinion-based. There are no silly question. No downvote from me but a close vote. \$\endgroup\$ – Heslacher Jan 30 '17 at 15:56
  • 7
    \$\begingroup\$ More context please. We can't even see why the variable is needed, much less suggest a name for it or review the "code". \$\endgroup\$ – 200_success Jan 30 '17 at 15:58
  • \$\begingroup\$ @200_success There are several places in code where we prepend the output with " ". I wanted a variable to store that information. \$\endgroup\$ – pushkin Jan 30 '17 at 16:01

I think it's fine. As long as it's descriptive to someone coming after you to follow. I usually try to follow a .NET class if I know they have something similar. In this case I would have followed the xmlwriter class IndentChars property. But it's quibbling over little things and not worth investing too much time once you have a name that is clear.


Not the answer you're looking for? Browse other questions tagged or ask your own question.