I know that this general topic has been discussed here before. What I am interested in is if there is a good solution for my specific case:
I have a command line tool like this (simplified):
static void Main(string[] args)
{
if (args.Length < 2)
{
Console.WriteLine("Usage: MyTool <InputFolder> <OutputFolder>");
return;
}
string inputFolder = args[0];
string outputFolder = args[1];
// ...
}
I assign names to the argument values to make the code more readable. I would also like to express that these values will not be modified later.
Neither const nor readonly can be used here because the values is not known at compile time and because they are local 'variables' and not class members.
So how could I make this code more expressive and readable?