T
Tony Johansson
Hello!
Assume you have this statement
total = total + item.Quantity * UnitPrice;
in a loop and it occurs in several places in the code.
Is it then any point for example to create a method with only one singe line
of code like this one
private static double GetItemTotal(int quantity, double unitPrice
{
return quantity * unitPrice;
}
With this method you get this statement instead.
total = total + GetItemTotal(quantity ,unitPrice);
I just want you opinion about this.
//Tony
Assume you have this statement
total = total + item.Quantity * UnitPrice;
in a loop and it occurs in several places in the code.
Is it then any point for example to create a method with only one singe line
of code like this one
private static double GetItemTotal(int quantity, double unitPrice
{
return quantity * unitPrice;
}
With this method you get this statement instead.
total = total + GetItemTotal(quantity ,unitPrice);
I just want you opinion about this.
//Tony