J
Jeroen
Hi,
I've found that C# 2 has several non-basic-programming-features turn
out to be a great help in making code readable and typesafe, most
notable the Generics stuff. Consequently, when I was creating the code
below, I figured there must be an easier and above all more readable
way to do this:
/*---------------------------------------*/
private string ImplodeMyObjects (MyClass[] items)
{
string result = string.Empty;
foreach (MyClass item in items)
result += item.ToString();
return result;
}
private void InterestingFunction()
{
MyClass[] items = GetFromFoo();
string coolstring = ImplodeMyObjects(items);
}
/*---------------------------------------*/
It seems that C# 3.5 will provide even cooler stuff to do the above,
but even in C# 2 there should be a nicer way to do this? Any comments
and suggestions on how to handle this kind of stuff would be much
appreciated. Please indicate for which version any suggestions would
be.
Thanks.
-Jeroen
I've found that C# 2 has several non-basic-programming-features turn
out to be a great help in making code readable and typesafe, most
notable the Generics stuff. Consequently, when I was creating the code
below, I figured there must be an easier and above all more readable
way to do this:
/*---------------------------------------*/
private string ImplodeMyObjects (MyClass[] items)
{
string result = string.Empty;
foreach (MyClass item in items)
result += item.ToString();
return result;
}
private void InterestingFunction()
{
MyClass[] items = GetFromFoo();
string coolstring = ImplodeMyObjects(items);
}
/*---------------------------------------*/
It seems that C# 3.5 will provide even cooler stuff to do the above,
but even in C# 2 there should be a nicer way to do this? Any comments
and suggestions on how to handle this kind of stuff would be much
appreciated. Please indicate for which version any suggestions would
be.
Thanks.
-Jeroen