When I'm creating a function, I try to make sure it passes two simple tests:
- Using the function should require less code than just duplicating what the function does, and
- whatever the function does shouldn't be the same as a built-in operator
That said, this code that Paul G. sent in doesn't meet my criteria.
public string StringConcat(string param0, string param1, string param2) { return param0 + param1 + param2; } public string StringConcat(string param0, string param1, string param2, string param3, string param4, string param5) { return param0 + param1 + param2 + param4 + param5; }
Actually, come to think of it, that second function is OK, because presumably a rule in their organization is to ignore every fourth string. Also, it is cute that the author of this code was so close to discovering the params keyword...