Have a look to the following example. Clearly it's very hard to understand the meaning of each parameter passed to the string.Format to be replaced to the numeric sequence of {0}, {1}, ...
I want to improve the software quality: Maintainability\Code readability http://en.wikipedia.org/wiki/Software_quality
The problem is also bound to the difficulty of associating numbers to the corrisponding values in the template. i.e. at a first glance what is the meaning of {8}?
@"<?xml version='1.0'?>
<RemoteXMLData>
<Username agent_diff_type=""{10}"" usertype=""{5}"" ticket_language=""{6}"" min_slip_stake=""{7}"" max_stake=""{8}"" location=""{9}"">{0}</Username>
<Password>{1}</Password>
<Reseller>{2}</Reseller>
<Function>AutoLogin</Function>
<AppKey>{3}</AppKey>
<Sub>{4}</Sub>
</RemoteXMLData>";
What should I change?
string autoLoginRequest = String.Format(
AutoLoginRequestTemplate,
username,
password,
Config.Val1,
Config.Val2,
requestSub,
Language,
minValue,
maxValue,
agentDiffType);