figuerres wrote:
 |
Massif wrote:
I've tended to consistently name any parameters which get altered by a function "victim".
e.g.
void MakeLowerCase(char* victim) { ... }
(except of course, I never ever wrote a MakeLowerCase function, that's just an example.) |
well I try to *NOT* modify params...
but then I come from the old "C" style of
f() is a FUNCTION so something like that would be
string MakeLowerCase( string TextIn){
}
I only use out x in C# when .net has already asked for it like with
Int32.TryParse() for example.

I've been exposed to the COM style of "return some code to say you worked, and return all data in parameters". I've also been exposed to the "let's try to use C as an OO language, without just adopting an OO language" model of basically replacing all functions with something of the form:
<ret_type> SomeFunction( <pointer to struct> this, <some params> )
Which is one of those: "Why are we doing this again?" moments.
Of course, ideally I try not to modify anything. But sometimes you just need to return two things from a function.