Denis
Denis

Reputation: 3747

Naming object and its string representation

Sirs, I have a lot of places in my code where method receives raw user input as string, then TryParses it to actual data type (decimal, enum, etc). The object I name by its actual purpose (for example, decimal amount). But I can't figure what is the best naming convention for raw strings? rawAmount? amountString? amount_raw? something else? Please let me know what do you think.

Upvotes: 0

Views: 110

Answers (1)

DrKoch
DrKoch

Reputation: 9772

I always go:

string amountStr = GetInput();
double amount = double.Parse(amountStr);

Upvotes: 1

Related Questions